Simulation 3D camera error while training with RL agent

I started to train an RL agent with a vehicle model with a camera. I'm getting this error after 1 episode
Caused by:
Error using rl.env.SimulinkEnvWithAgent>localHandleSimoutErrors (line 667)
Error in 'model/Environment/Subsystem/Simulation 3D Camera Forward Facing': Failed to evaluate mask initialization commands.
Error using rl.env.SimulinkEnvWithAgent>localHandleSimoutErrors (line 667)
Cannot change property 'Enabled' of 'model/Environment/Subsystem/Simulation 3D Camera Forward Facing' while simulation is running

4 个评论

It seems like you are changing a property during simulation? If that's the case, have you tried enabling the camera from the start?
It gets enabled during episode 1. But when the episode finishes and episode 2 is about to start, this error appears. Is there any code to invoke the enabling of the camera in the reset function for the next episode?
Also I didnt find any RL tutorials which involves a camera. Is there a chance that the current matlab RL framework doesn't support the camera usage?
There should not be any issues using camera blocks. I would try 'SetBlockParameter' as showin in the reset function in this example
So i have tried something like this to test it but still the same error.
function in = ResetFunction(in)
enables = get_param('model/Environment/3dsim/Simulation 3D Camera Forward Facing', 'MaskInitialization');
blk = 'model/Environment/3dsim/Simulation 3D Camera Forward Facing';
in = setBlockParameter(in, blk, 'MaskInitialization', enables);
end

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by