changeDynamics fails to set the maxJointVelocity when used in a loop #3962
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
After reading the relevant parts in the server command processor (search for m_maxJointVelocity), I am afraid that you can only set the maximum velocity of all links but not individually. However, when using |
Beta Was this translation helpful? Give feedback.
-
Hi @bttner, thanks for the reply. |
Beta Was this translation helpful? Give feedback.
-
The maxJointVelocity in changeDynamics is a safety measure, set to 100 radians per second by default. Your robot should never reach this safety velocity clamping. The API is there, so you can increase the values, in case you hit this threshold. I'll add a mention in the PyBullet Quickstart Guide. For setJointMotorControl2, when using position control or velocity control, you can have a per-joint max velocity threshold, once the velocity exceeds no more torque will be added by the actuator. Since you use torque control, this won't help you. We used PyBullet using pure torque control in our MPC, or feed the torques using external PD control, that should work fine. Usually energy is dissipated using joint friction/damping (which you can simulate using a velocity motor, with a small maximum (friction) force. This works alongside torque control. |
Beta Was this translation helpful? Give feedback.
-
Hi @erwincoumans thanks for clearing out my misunderstanding. Following your advice I will then try to use the torque control and modify a the actuation model by including some additional joint friction to dissipate more energy. |
Beta Was this translation helpful? Give feedback.
-
Hi @erwincoumans as a follow up I report a much better behavior following your advice and including a proper model of the actuation of the system. The plot that I have are much closer to the desired trajectories than the one previously shown and the difference mainly comes from the discrepancy between the presence of friction in simulation which unfortunately the trajectory optimizer is not taking into account in the dynamics. |
Beta Was this translation helpful? Give feedback.
The maxJointVelocity in changeDynamics is a safety measure, set to 100 radians per second by default. Your robot should never reach this safety velocity clamping. The API is there, so you can increase the values, in case you hit this threshold. I'll add a mention in the PyBullet Quickstart Guide.
For setJointMotorControl2, when using position control or velocity control, you can have a per-joint max velocity threshold, once the velocity exceeds no more torque will be added by the actuator. Since you use torque control, this won't help you.
We used PyBullet using pure torque control in our MPC, or feed the torques using external PD control, that should work fine.
Usually energy is dissipat…