Clear Filters
Clear Filters

Avoid Obstacles with DDPG Error in raycastInternal.m (line 102)

2 views (last 30 days)
I was trying to run this example:
https://www.mathworks.com/help/robotics/ug/avoid-obstacles-using-reinforcement-learning-for-mobile-robots.html
and I am running with the following error after random of episodes. For example the following error occures after 173 successfull episode:
Error using rl.train.SeriesTrainer/run
An error occurred while running the simulation for model 'exampleHelperAvoidObstaclesMobileRobot' with the following RL agent blocks:
exampleHelperAvoidObstaclesMobileRobot/Agent
Error in rl.train.TrainingManager/train (line 456)
run(trainer);
Error in rl.train.TrainingManager/run (line 224)
train(this);
Error in rl.agent.AbstractAgent/train (line 126)
trainingResult = run(trainMgr,checkpoint);
Error in RL_Example (line 142)
trainingStats = train(obstacleAvoidanceAgent,env,trainOpts);
Caused by:
Error using rl.env.internal.reportSimulinkSimError
Assertion failed.
Error in raycastInternal.m (line 102)
% the bottom left corner of the grid, gridLocation.
Error in raycast.m (line 36)
Error in calculateRanges.m (line 40)
Error in calculateRanges.m (line 27)
Error in RangeSensorBase.m (line 140)
Error in function_handle.m (line 63)
Error in RangeSensorBase.m (line 149)
Error in 'exampleHelperAvoidObstaclesMobileRobot/Environment/MATLAB Function' (line 6)

Answers (1)

Subhajyoti
Subhajyoti on 11 Sep 2024
It is my understanding that you are trying to run the example ‘robotics/AvoidObstaclesUsingReinforcementLearningForMobileRobotsExample’ and facing error from the ‘raycastInternal.m’.
When I ran this example in MATLAB R2024a, it ran without any error. You can update your MATLAB Installation to R2024a or later releases to fix the issue. Also, you can try running the updated model files from the latest release to see if the issue persists.
Refer to following resource to know more about ‘Update an Existing Installation’ of MATLAB:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!