An example of Publisher/Subscriber package for ROS2 written in C++
Anukriti Singh - MEng Robotics
ROS2 Humble package is created and tested on ubuntu 20.02 (Linux). The colcon build is used for building the package. To run, build and source ROS2 Humble
In new tutorial:
mkdir ros2_ws/src
cd ros2_ws/src
git clone <repo>
cd ..
source <path to ros2 setup>/install/setup.bash
colcon build
source install/setup.bash
For publisher in new terminal:
cd ros2_ws
source <path to ros2 setup>/install/setup.bash
source install/setup.bash
ros2 run cpp_pubsub talker
Parallely open new terminal:
cd ros2_ws
source <path to ros2 setup>/install/setup.bash
source install/setup.bash
ros2 run cpp_pubsub listener
ros2 run cpp_srvcli server
ros2 run cpp_srvcli client 2 3
cd launch
ros2 launch my_launch.yaml
cd ros2_ws/src
run_cpplint.sh
cd ros2_ws/src/
run_cppcheck.sh
- Invoke rqt console GUI
rqt_console
rqt_graph