You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
So normally we have the u_rot to be specified as torque (or at least this is what the simulator wants it to be), however, the dynamics need angular velocity as u_rot (since runge_kutta expects the change of rotation over time).
This is not specified anywhere so some description would be nice, because the example is somewhat wrong.
However, this would give unpredictable behavior. It is barely seen in the example given as you have a u_rot_multiplier of 0.001, so this is barely visible, but if you zoom in and tweaks the agent parameters enough, you can see the misbehavior.
The process_action code should look something like this instead:
def process_action(self, agent: Agent):
if hasattr(agent, 'dynamics'):
# assuming input is in forces
torque = agent.action.u_rot
angular_vel = torque / agent.moment_of_inertia * self.dt
agent.action.u_rot = angular_vel
agent.dynamics.process_force()
agent.action.u_rot = torque
# or assuming input is in velocities
agent.dynamics.process_force()
angular_vel = agent.action.u_rot
torque = angular_vel * agent.moment_of_inertia / self.dt
agent.action.u_rot = torque
By adding docs to the dynamics.process_force() code, these input units would be much more apparent.
Correct me if I'm wrong, as I might be.
The text was updated successfully, but these errors were encountered:
Coming back to this after a while (sorry about it).
If you look closely at the dynamics we are not actually computing any integral (the name euler and rk4 may not have helped here).
But if you look at the simple euler case, all we are doing is a change of coordinates.
The inputs and the outputs are all torque and forces (just in a different frame)
In fact you can see that in both cases the input u_rot is left untouched (and considered as torque)
Hi,
So normally we have the u_rot to be specified as torque (or at least this is what the simulator wants it to be), however, the dynamics need angular velocity as u_rot (since runge_kutta expects the change of rotation over time).
This is not specified anywhere so some description would be nice, because the example is somewhat wrong.
Example code:
However, this would give unpredictable behavior. It is barely seen in the example given as you have a u_rot_multiplier of 0.001, so this is barely visible, but if you zoom in and tweaks the agent parameters enough, you can see the misbehavior.
The process_action code should look something like this instead:
By adding docs to the dynamics.process_force() code, these input units would be much more apparent.
Correct me if I'm wrong, as I might be.
The text was updated successfully, but these errors were encountered: