...
Robot Operating System 2 (ROS2) is a framework for programming robots that we use as the backbone for our software architecture. Despite the name, it is not truly an OS, but actually a set of packages installed over Ubuntu that aid robotic software development by simplifying communications between processes and providing common functionality so we don’t have to reinvent the wheel. The version of ROS2 we use is called foxygalactic (please check with the software lead or senior member that this is the version we are using for our current rover). Before getting started with ROS, first install it by following the official tutorial: https://docs.ros.org/en/foxygalactic/Installation/Ubuntu-Install-Debians.html
ROS2 Basic Concepts
The challenge of programming an entire robot is that it quickly becomes hugely complicated. Between firmware to control your sensors and actuators, and the logic to perform various functions, if you tried to code everything at once you would end up a) reinventing the wheel on many components, and b) end up with a hugely messy program that probably won’t adapt well to changes in objectives, and any changes you make will likely break other things. When tackling such a challenge it is important to decompose your problem into smaller subproblems which can be self-contained. This way each sub-problem can be solved more simply, and the system gains modularity because you can swap out subcomponents without affecting other parts.
...
Another nice thing about ROS2 is the ability to tweak the values of parameters rather than hard-coding them and recompiling if a number needs to change. You can create config files (typically a yaml YAML file) defining values for parameters you’d like, which can be loaded on launch. Then your node can read parameters by name in order to set values (eg scales, thresholds, topic names, speed/joint angle limits, etc). Parameters read from file are loaded onto the ROS2 parameter serverfiles are hosted on that current node (As compared to ROS1 where there was a parameter server). A nice feature in ROS2 is the ability to declare parameters from within our nodes (fairly easily) that can then be modified from a configuration file. Keep in mind that if other things modify the parameter, it's up to the programmer to catch changes in the value and deal with itthem. Keep an eye out for parameters in the tutorials linked below.
...
Go through these tutorials to get a better understanding of ROS2. They are pretty thorough and cover almost everything you need to know. Although there is much more to ROS2 - the idea behind this guide is not meant to overwhelm you but to serve as a guide. There are many neat things in ROS2 such as topic statistics, life cycle nodes, quality of service, and callback groups. In the effort of making this training as simple and straightforward as possible, I will not explore these concepts here. The tutorials I have attached below are HIGHLY RECOMMENDED to be completed before you move on to completing the software training challenge. In fact, I would go far enough to say it is (more) difficult to complete the software training challenge without the ROS2 foxy tutorials. These tutorials are helpful, but you do not need to go through all of them. Only go through the ones that you believe will help you best.