Change revolute joint parameter in env.ResetFcn during reinforcement learning

1 次查看(过去 30 天)
What is the best way to randomize the initial revolute joint angle during eacg episode of reinforcement learning
right now I am using
function in = Arm_ResetFcn(in, init_angle)
init_angle_up = -pi/2 + 2*rand*pi/2;
if rand > 0*5
in = set_param(in,blk_init,'PositionTargetValue',num2str(init_angle_up));
else
in = set_param(in, blk_init,'PositionTargetValue',num2str(init_angle));
But i am getting errors during simulation
Is it better to define a variable and then use
in = in.setVariable('init_angle',init_angle);
to update the initial angle before each episode?

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by