ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
This will convert the Twist to Ackermann messages: http://wiki.ros.org/teb_local_planner/Tutorials/Planning%20for%20car-like%20robots
def convert_trans_rot_vel_to_steering_angle(v, omega, wheelbase):
if omega == 0 or v == 0:
return 0
radius = v / omega
return math.atan(wheelbase / radius)
v = data.linear.x
steering_angle = convert_trans_rot_vel_to_steering_angle(v, data.angular.z, wheelbase)
This will convert angular velocity to steering angle.
Once you have the steering angle you can send the servo PWM value that corresponds to that angle. Or put a control loop around your steering angle sensor.