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: “pathy”. 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 (“/pathy/steering” in this example), use:
ros2 topic echo /pathy/steering
Something similar can be used for Image topics:
ros2 run image_tools showimage --ros-args -r image:=/pathy/rgb
Because topics are just strings, and nodes are thus loosely coupled, it is possible to rewrite topics.
I often used:
ros2 run pathy mav --ros-args -r /pathy/steering_safe:=/pathy/steering
…during development to run the rover with ‘unsafe’ steering (steering messages that aren’t protected by the dead man’s switch).