ROS is intended to be run on computer hardware, like the notebook you indicated. rosserial is intended to allow you to bridge physical hardware and sensors to the ROS computation graph using a micro controller (at this time, the Arduino has client libraries developed). rosserial should be used when the hardware doesn't already have a ready-made interface and driver (for example, you shouldn't use a GPS receiver with rosserial).
Example Subscriber
For example, if you have a motor controller implemented on an Arduino, you will want to create a ROS Subscriber that will listen to a Twist Message on a given topic. Many people use /cmd_vel
as the topic for this purpose.
Now, with a ROS core running, and the rosserial_python node running, you should see a /cmd_vel
appear in a rostopic list
command. You can use another node on your system to publish messages to /cmd_vel
, that the Arduino will interpret into motor commands. The Arduino firmware should be able to turn a Twist message (linear and angular velocities) into appropriate motor commands for your platform.
Example Publisher
Another application may be reading an ultrasonic rangefinder. You will physically interface the line sensor to your Arduino, and then create a ROS Publisher. You could make this message type a Float32 if you wanted to represent a floating point distance or perhaps an Int32, if you wanted to get the raw ADC values. These would then be published into the computation graph on the topic of your choice (say /rangefinder
). You could then see these values by doing rostopic echo /rangefinder
on the command line.
You can get a better idea of the capabilities of rosserial on the rosserial tutorials page.
Putting it all together
Now, if your robot can receive movement commands from ROS via /cmd_vel
and can broadcast readings of the physical world, then you can start creating (or using) other ROS nodes to process this data and make decisions.
For example, if your robot can accept command velocities, can publish range scans, and can publish odometry information, you can start to use higher-level nodes for navigation, localization, and path planning.
Hope this helps.
Thnks sir. i try to go trough with /cmd_vel . thnks for the information.