What is the unit of the commands from the diff_drive_controller?
Hi,
I'm trying to get a differential drive robot running with ros_control and the diff_drive_controller. I have a working setup except for knowing exactly what the commands written to the command variable in the diff_drive_controller actually means (the ones I'm supposed to convert to motor commands in my RobotHW-instance). I've gone through the code for the diff_drive_controller to actually understand what's happening and I've tried to trace down how a vel_cmd is being translated to something else in the controller.
This is the move robot code from the diff_drive_controller:
// Compute wheels velocities:
const double vel_left = (curr_cmd.lin - curr_cmd.ang * ws / 2.0)/wr;
const double vel_right = (curr_cmd.lin + curr_cmd.ang * ws / 2.0)/wr;
My configuration file for the controller specifies the wheel separation to 0.341 meters and the wheel radius to 0.05 meters. When I'm sending a cmd_vel with a linear velocity of 0.5m/s and no angular velocity (hence, the robot should move straight ahead..) the calculations will translate to:
vel_left = (0.5 - 0.0 * 0.341 / 2.0) / 0.05; // Equals 10
vel_right = (0.5 + 0.0 * 0.341 / 2.0) 0.05; // Equals 10
So what unit is the value 10 in? S.I m/s? Can't be! I want to go with 0.5m/s straight ahead.
Trying to wrap my head around this but right now I'm just feeling stupid.. x-(
Thanks!
Could you please tell me how you interfaced diff_drive_controller with ros_control? What is the output of diff_drive_controller that is used by the ros_control?