ctu-mrs / ros2_examples

Examples for individual ROS2 functionalities inc. Subscribers, Publishers, Timers, Services, Parameters. ...
63 stars 10 forks source link
cpp examples robot-operating-system ros2

ROS2 examples

This example package is meant to explore the possibilities of ROS2 from the point of view of current ROS1 features and how the ROS1 feature translate into the new ROS2 architecture. We investigate the aspects that are currently utilized in MRS UAV System with the intention of a potential future transition.

Meant to be tested on 20.04 Galactic

Minimalistic Examples

Everything is a component. We happily nodelet everything in ROS1, so why otherwise?

Running the examples

./tmux/start.sh (change the sourced workspace path in tmux/session.yml)

First ROS2 impressions

Migration Guide

Messages/Services

General Tips

The API documentation of rclcpp and rclpy is hard to find. It is here for Humble rclcpp and here for Rolling rclpy (I didn't find version-specific documentation of rclpy).

%% Note: The API documentation unfortunately sucks. Do not rely on it. A lot of the features are poorly or not at all documented. For example, the %% C++ %% bool get_parameter(const std::string &name, rclcpp::Parameter &parameter) const %% %% function can throw a rclcpp::exceptions::InvalidParameterTypeException if the declared and loaded parameter types mismatch, which is not documented, but can crash your code.