Ask Your Question
4

Whats the best way to use ROS to control motors on a simple robot?

asked 2011-10-10 00:37:18 -0500

Chrimo gravatar image

updated 2011-10-10 12:50:31 -0500

Hello community,

I've started a new ros project called MockBot at home... The robot contains the following modules:

Simple lowcost homebrew chassis, which can be build from cheap components.

http://192.166.253.145/BLOG/serendipity/uploads/MockBot-Design-Sheet.pdf

Currently the nodes for Kinect, GPS, Audio and motorcontroller are up and running.

What is the next step in ros design to make these components work together ? I'd like to create a simple discover-world or ant-brain behaviour...

Problem: what do I need to control the motors or what do I need to make the motorcontrol ros-compatible ? What can be reused from the turtlebot project ?

Current state: both motor subscribers are listening at /servo1 and /servo2 topics.

Thanks for many tips and tricks from the professionals with experience from practice Cheers Christian

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2011-10-10 07:21:30 -0500

fergs gravatar image

Control of a mobile base is usually done though a geometry_msgs/Twist message, and the topic is often called "cmd_vel".

edit flag offensive delete link more
3

answered 2011-10-10 15:00:27 -0500

Ryan gravatar image

If you're trying to figure out what speed to drive your motors at (in m/s):

left_speed_out = cmd_vel.linear.x - cmd_vel.angular.z*ROBOT_WIDTH/2
right_speed_out = cmd_vel.linear.x + cmd_vel.angular.z*ROBOT_WIDTH/2

This assumes that twist.linear.x is your translational speed in m/s, twist.angular.z is your rotational speed in rad/s, and ROBOT_WIDTH is the width between your wheels in m.

edit flag offensive delete link more
0

answered 2011-10-10 10:01:12 -0500

Chrimo gravatar image

This means, I need a simple controller to map between my differential motor drives and the twist messages ? I think, I will try to analyze http://www.ros.org/wiki/nxt_controllers first. Are there better examples for such differential controllers available ?

Cheers Christian

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2011-10-10 00:37:18 -0500

Seen: 6,792 times

Last updated: Oct 10 '11