This pull request addresses issue #66, which identifies the clamping of joint torque commands to ±55 Nm by UnitreeJointController. This limitation hinders the accurate simulation of B1 motors, which have ±140 Nm capability.
The impact is evident in the following visualizations, where B1 is commanded to trot in place:
Notably, this clamping is redundant, as the joint torque computation is already clamped to URDF specifications (line 181, above) by the effortLimits() function.
Solution:
This pull request proposes the removal of the ±55 Nm clamp from computeTorque(), introducing the following implementation:
This modification allows for the utilization of UnitreeJointController to accurately simulate B1 control, while preserving its original functionality for smaller quadrupeds.
B1 trotting in Gazebo via updated code
Update enables accurate B1 torque computation
A1 trotting in Gazebo via updated code
Update maintains identical torque computation in the [-55,55] Nm range
Description:
This pull request addresses issue #66, which identifies the clamping of joint torque commands to ±55 Nm by
UnitreeJointController
. This limitation hinders the accurate simulation of B1 motors, which have ±140 Nm capability.The impact is evident in the following visualizations, where B1 is commanded to trot in place:
Problem:
The issue lies in
UnitreeJointController
's usage (line 180, below) of thecomputeTorque()
function from unitree_ros/unitree_legged_control/lib, which inadvertently clamps its output to ±55 Nm.https://github.com/unitreerobotics/unitree_ros/blob/67ac2124494e93af87d34d6e53ef9060dbf9c923/unitree_legged_control/src/joint_controller.cpp#L178-L181
Notably, this clamping is redundant, as the joint torque computation is already clamped to URDF specifications (line 181, above) by the
effortLimits()
function.Solution:
This pull request proposes the removal of the ±55 Nm clamp from
computeTorque()
, introducing the following implementation:Rationale:
This modification allows for the utilization of
UnitreeJointController
to accurately simulate B1 control, while preserving its original functionality for smaller quadrupeds.