Skip to content

diff_drive_controller

F Pucher edited this page Mar 12, 2020 · 17 revisions

Differential Drive Controller

The diff_drive_controller package for a differential drive mobile base. See also the corresponding controller's ROS wiki page and the C++ API documentation.

The controller works with a velocity twist (subscribes to cmd_vel of type geometry_msgs/Twist) from which it extracts the x component of the linear velocity and the z component of the angular velocity. Velocities on other components are ignored.

The data of the received velocity twist message is split then sent on the two wheels of a differential drive wheel base using the hardware_interface::JointHandle::setCommand method of the hardware_interface::VelocityJointInterface. Odometry is computed from the feedback from the hardware (also via hardware_interface::VelocityJointInterface using pointers and not relying on ROS interfaces (e.g. topics, services, actions)), and published over the odom topic of type nav_msgs/Odometry.

Note that hardware_interface::VelocityJointInterface inherits from hardware_interface::CommandJointInterface which allows both reading joint state and commanding [effort|velocity|position]-based joints (see this answer).

Clone this wiki locally