Unexpected behavior when using forcerange ws ctrrlrange #2614
-
IntroHey, using Mujoco with libtorch to learn RL algorithms My setupMuJoCo version 3.3.0 on Ubuntu 22.04 docker container My questionI'm trying to get an understanding of how mujoco model files work and basically I have the following simple model, <mujoco model="inverted pendulum">
<compiler inertiafromgeom="true"/>
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.02"/>
<size nstack="3000"/>
<worldbody>
<!--geom name="ground" type="plane" pos="0 0 0" /-->
<geom name="rail" pos="0 0 0" quat="0.707 0 0.707 0" rgba="0.3 0.3 0.7 1" size="0.02 1" type="capsule" contype="0" conaffinity="0"/>
<body name="cart" pos="0 0 0">
<geom name="cart" pos="0 0 0" quat="0.707 0 0.707 0" size="0.1 0.1" type="capsule" contype="0" conaffinity="0"/>
<body name="pole" pos="0 0 0">
<joint axis="0 1 0" name="pivot" pos="0 0 0" type="hinge" limited="false" damping="0.05"/>
<geom fromto="0 0 0 0.001 0 0.6" name="cpole" rgba="0 0.7 0.7 1" size="0.049 0.3" type="capsule" contype="0" conaffinity="0"/>
</body>
</body>
</worldbody>
<actuator>
<motor ctrllimited="true" ctrlrange="-30 30" joint="pivot" name="motor"/>
</actuator>
</mujoco>
What is confusing to me is when I run <motor forcelimited="true" forcerange="-30 30" joint="pivot" name="motor"/> It will only set the joint torque in the motor box in the UI on |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ah, this is purely a UI thing. You're not giving it a range but it needs to do something for the slider, so it picks [-1, 1]. If you add |
Beta Was this translation helpful? Give feedback.
Ah, this is purely a UI thing.
You're not giving it a range but it needs to do something for the slider, so it picks [-1, 1].
If you add
ctrlrange="-30 30" ctrllimited="false"
(so the is no ctrl clamping, but the values are set in the mjModel), everything will behave as you expect.