Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Gazebo ROS diff drive controller cmd_vel timeout

I'm using ROS melodic and Gazebo 9.9.0 on an Ubuntu 18.04.2 LTS.

I have defined this diff drive controller for a Pioneer 2DX that I use in Gazebo. The robot comes from Gazebo library, and I have changed its controller for this one:

<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
  <alwaysOn>true</alwaysOn>
  <updateRate>100</updateRate>
  <leftJoint>left_wheel_hinge</leftJoint>
  <rightJoint>right_wheel_hinge</rightJoint>
  <torque>20</torque>
  <commandTopic>mybot/cmd_vel</commandTopic>
  <odometryTopic>mybot/odom_diffdrive</odometryTopic>
  <odometryFrame>odom</odometryFrame>
  <rosDebugLevel>1</rosDebugLevel>
  <publishWheelTF>false</publishWheelTF>
  <publishOdomTF>true</publishOdomTF>
  <publishWheelJointState>false</publishWheelJointState>
  <wheelAcceleration>0</wheelAcceleration>
  <wheelTorque>5</wheelTorque>
  <odometrySource>world</odometrySource>
  <publishTf>1</publishTf>
  <robotBaseFrame>chassis</robotBaseFrame>
  <wheelSeparation>0.39</wheelSeparation>
  <wheelDiameter>0.15</wheelDiameter>
</plugin>

I'm new in ROS development, and I have read that most mobile base drivers will time out and stop the robot if they don't receive at least several messages per second.

Reading Diff Drive Controller ROS API, I have found that there is a parameter called cmd_vel_timeout that will do what I want to do.

Is there something similar in the libgazebo_ros_diff_drive.so that will stop the robot after no receiving cmd_vel messages for n seconds?

By the way, now, when I press Ctrl.+C, the robot doesn't stop. It seems that the robot doesn't any timeout value configured.