ROS (Robot Operating System) is a “set of software libraries and tools that help you build robot applications”. We used the newest stable ROS release, which at the time of creating this project was ROS 2: Foxy Fitzroy.
Nodes are separated into packages. A package is the minimal publishable unit of ROS ‘stuff’.
To control our rover we created one package: “paddy”. This package contains all nodes to handle camera input, steering, oversight etc.
We discuss the various nodes and their function in our package’s readme.
Advantages of using ROS¶
Besides encouraging a modular approach, ROS also offers some nice debugging functionality.
To debug a ROS topic (“/paddy/steering” in this example), use:
ros2 topic echo /paddy/steering
Something similar can be used for Image topics:
ros2 run image_tools showimage --ros-args -r image:=/paddy/rgb
Because topics are just strings, and nodes are thus loosely coupled, it is possible to rewrite topics.
I often used:
ros2 run paddy mav --ros-args -r /paddy/steering_safe:=/paddy/steering
…during development to run the rover with ‘unsafe’ steering (steering messages that aren’t protected by the dead man’s switch).