How can I set ResetFcn?
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm trying to set resetFcn.
My purpose is set initialcondition and target posture in every trainsets.
- s0 = [1 0 0 0] **s0 is initial state
- a0 = [1; 0; 0; 0;] ** a0 is initial action
- sG = [1 rand rand rand] **sG is target posture
Here is my code:
env.ResetFcn = @(in)motorResetFcn(in); // start to set ResetFcn called 'motorResetFcn'
Here is my code : motorResetFcn.m
function in = motorReset(in)
% randomize target posture
blk = sprintf('sphericalMotorRL/Target_Posture');
t = ['1' '2/3*pi*randn-pi/3' '2/3*pi*randn-pi/3' '2/3*pi*randn-pi/3'];
in = setBlockParameter(in,blk,'Value',num2str(t));
% randomize initial action and state
h = ['1' '0' '0' '0'];
blk = 'sphericalMotorRL/sphericalMotor/s';
in = setBlockParameter(in,blk,'InitialCondition',num2str(h));
h = ['1'; '0'; '0'; '0';];
blk = 'sphericalMotorRL/sphericalMotor/a';
in = setBlockParameter(in,blk,'InitialCondition',num2str(h));
end
My initialcondition and target posture is maxtrix,
I don't know how to declare maxtrix..... what do I have to fix?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Predictive Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!