Change revolute joint parameter in env.ResetFcn during reinforcement learning

10 views (last 30 days)
Sayak Mukherjee
Sayak Mukherjee on 19 Oct 2020
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));
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?

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by