# What is the velocity assigned to the gazebo-ros-conrtol controller

When I create a transmission for the wheels of my robot like this

  <transmission name="tran_robot_wheel">
<type>transmission_interface/SimpleTransmission</type>
<joint name="wheel_joint">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="wheel_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>


or

  <transmission name="tran_robot_wheel">
<type>transmission_interface/SimpleTransmission</type>
<joint name="wheel_joint">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="wheel_motor">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>


And I configure the controller as so

  joint_wheel_controller:
type: effort_controllers/JointVelocityController
joint: wheel_joint
pid: {p: 100, i: 10, d: 0.1}


or

  joint_wheel_controller:
type: velocity_controllers/JointVelocityController
joint: wheel_joint
pid: {p: 100, i: 10, d: 0.1}


And I run the simulation and sent a command to both left and right wheel to set velocity to 1.0

rostopic pub /robot/joint_wheel_controller/command std_msgs/Float64 "data: 1.0"


The robot moves about 1 meter in 10 second. The robot wheel turns once around in about 8 seconds. What kind of velocity unit is that? How do I convert it to m/s?

edit retag close merge delete

Sort by » oldest newest most voted

The robot wheel turns around once in about 8 seconds (6.283, actually), because the value assigned as velocity is angular velocity omega

omega = 2 * pi * f

that means the time t it takes to turn the wheel all the way around

t = 1/f

is

t = ( 2 * pi ) / omega = 2 * 3.1415 / 1 = 6.283 s

and you need to assign the velocity omega of 6.283 to achieve 1 rotation per second

omega = 2 * pi * f = 2 * 3.1415 * 1 = 6.283

To get the desired linear velocity v you divide the desired linear velocity v with the radius r of the wheel in meters.

v = 2 * pi * f * r = omega * r

omega = v / r

more