# Revision history [back]

### How does Gazebo compute joint effort limits?

In the past days, I've been trying to understand how Husky ROS commands are handed to Gazebo-9 and then translated into wheel torques. So far this is what I found out:

• Husky diff_drive_controller, by default, doesn't use any PID gains (Question, ROS Documentation) and simply computes the right-wheels and left-wheels angular velocities using simple kinematic relations.
• When Gazebo receives the wheels speed it computes the wheels effort using the DefaultRobotHWSim package (Gazebo Tutorial)
• Within the DefaultRobotHWSim package, if no PID gains are found, Gazebo will directly set the wheel speeds (joints velocity) using the Joint Motors (Source Code, Gazebo Tutorial). Its logic is as follows:
1. Compute the effort required to achieve the requested wheel angular velocity within a time step
2. If it's smaller than the maximum joint effort limit (joint_effort_limits) then it will apply the computed torque/effort
3. If the required torque is greater than the maximum joint effort limit (joint_effort_limits), it will try to achieve the commanded speed in the smallest number of iterations possible.

Now my questions are:

1. Is everything I wrote above correct?
2. Given that in the Husky description files (LINK) no joint effort limit is declared for the wheels, how does Gazebo evaluate them? What values does it use as joint_effort_limits? I tried to interpret the source code but couldn't find an answer.

Context: I'm trying to understand how the initial command (/cmd_vel expressed in linear velocity dx and angular velocity around z axes) is translated into wheel torques. The final goal is to represent the whole model in Simulink and develop some new controllers without having to run the simulation in Gazebo. It will only be used for future tests.

What I'm using: ROS Melodic, Gazebo-9 (intalled with ROS), Husky default packages