ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You have to write a function that performs the body-frame velocities to wheel velocities transformation. Then a second, much simpler function that converts the wheel velocities to motor RPM commands and then PWM commands.

If your robot is a differential-drive one, you can probably Google search for the corresponding equations. There might even be a ROS package that can help with that. The key takeaway is that this function is robot-specific, as it depends on things like number of wheels, wheel configuration, distance between wheels, wheel radius, etc.

Various functions in RobotControl might already be doing some of that work. But based on the input argument of goAhead, I doubt it does the transformation. It probably just has all wheels spin at the same, fixed RPM (in an open-loop fashion).

You have to write a function that performs the body-frame velocities to wheel velocities transformation. The body-frame velocities are contained in the Twist messages published on /cmd_vel. Then you have to also write a second, much simpler function that converts the wheel velocities to motor RPM commands and then PWM commands.

If your robot is a differential-drive one, you can probably Google search for the corresponding equations. There might even be a ROS package that can help with that. The key takeaway is that this function is robot-specific, as it depends on things like number of wheels, wheel configuration, distance between wheels, wheel radius, etc.

Various functions in RobotControl might already be doing some of that work. But based on the input argument of goAhead, I doubt it does the transformation. It probably just has all wheels spin at the same, fixed RPM (in an open-loop fashion).