To learn robotics and eventually program robot brains I’ve started building some ROS2 modules. I have several Raspberry Pi 3B’s so I bought some stepping motors and an Adafruit 16-channel PWM HAT and set about building some ROS2 packages.
Well, I soon discovered that, while ROS2 is a modernization of the original ROS (which grew organically over the last decade plus), it is not all done. There are many, many features, modules, and conventions that are not complete. So, I scaled my project back a little and started building some basic modules so I could learn the state of things.
First thing I published is a fork of Christian’s raspicam2_node which compiles and runs under the latest ROS2 build (bouncy). This lead me to needing a version of ROS2 on Raspbian. ROS2 is targeted at the latest versions of operating systems and tools. So ROS2 wants that latest version of Linux and also wants 64-bit hardware. But everything hasn’t caught up – the latest version of Raspbian is 32-bit and the previous LTS version of Ubuntu.
To build ROS2 on Raspbian, I created a script in ROS2OnPiTools that fetches and builds ROS2 on Raspbian. It takes several hours but it results in a directory that can be copied onto multiple Raspberry Pi’s.
Future blog posts will describe the details of this project but the first step is a ROS2 node to drive the Adafruit 16-channel PWM HAT. So the project ros2_adafruit_pwmhat_node is a simple, Python only node that subscribes to several topics and sets the PWM values on the HAT.
Now that I have stepping motors moving, I will work on capturing images and animating my little camera project. Future blog posts will describe this as it comes together.