Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Just like you, I was new to ROS just 3 months ago. So my idea of "programming a robot" was to write codes that will run on a microcontroller (that pretty much runs everything from the motor control to the sensors and communication).

How I finally got my two wheel robot running using ROS:

  1. The tutorials (the publishing/subscribing one that Dimitar pointed out was very useful)
  2. Looking at the codes for turtlebotsim and turtlebot
  3. Using the tutorials to see how the turtlebot codes are related (in particular what each node publishes, and which nodes subscribe to that topic)
  4. The easiest was the 'cmd_vel' topic where you can see the result in both turtlebotsim and turtlebot (if you have it). So this was the starting point to get my own robot working.
  5. With the turtlebot_teleop node/code already there, I started writing my own subscriber to printout what was on 'cmd_vel' while running the teleop program, and then progressing to pushing the 'cmd_vel' values out onto my robot motors.
  6. Once I got the basic idea of how the nodes run separately, yet are connected through ROS topics, I progressed to writing publishers/subscribers for sensor data.

I think the crucial step for me while learning ROS was the understanding that there is no longer a need for a central brain/control to tell the robot to 'do this at this time'. Instead, each robot module (sensors, motors) would just do what they do best when they see something published. Eg. motors subscribe to a robot velocity command and convert that into wheel velocity; sensors just keep reading and publishing their readings, without the need to know what the readings are used for.