The Real Roboticist (lesson 4): Some Important ROS theory

roboparkour1111

Since you’re going to be working with an operating system, it’s best to know how exactly the system works so you can manipulate it in order to take full advantage of this virtually limitless tool.

ros101one

Nodes and Master

ROS is used primarily to establish a connection between modules, known as nodes. A node is just but some code that you can execute. Your ‘Hello world.py’ program is a node (albeit not a very useful one). ROS’s flexibility lies in the fact that these nodes can lie anywhere. You can have a node on your laptop, a node on a raspberry pi and another node on your desktop, and all of these nodes will work with each other to make your robot function. The advantage of this distribution is to organize system control. For a robot that processes and image, finds a face and then drives towards said face, you can have a node for receiving camera images and processing them and another node for controlling the steering of the robot in response.

Nodes

Nodes perform and action; they’re actually just software modules but can communicate with other nodes and register with the master (we’ll get to that). These nodes can be created in a number of ways. You can type up a command in a terminal window to create a node or you can create them using Python or C++ as a script.

Nodes Publish and Subscribe

In ROS, a series of task

s can be split into a series of simpler tasks (both, simplicity in execution and simplicity of code can be achieved) . For a wheeled robot the tasks can include the perception of the environment using a camera or laser scanner, map making, planning a route, monitoring the battery level of the robot’s battery, and controlling the motors driving the wheels of the robot.

Some nodes provide information to others. The feedback from the camera is an example. This node is said to publish information to other nodes.

A node that receives the camera image is subscribed to the other node. As an example,  The wheels could be subscribed to a camera, which is publishing.

In some cases, a node can both publish and subscribe to one or more topics. You’ll see more of those as you progress.

ROS Master

If nodes were like railway stations in a complicated subway, ROS master is like the map. ROS master provides naming and registration services to individual nodes and allows them to locate with each other. It does so primarily using the TCP/IP, called TCPROS. In short, this enables communication over the Internet.

Enough of the boring theory, in the next lesson, we’ll get more hands on. For more information on how to list nodes and other handy tips, go to this website.

node_host

Leave a comment