This repository contains tutorials from ROS2 Beginner: Client libraries. The tutorials cover publishers, subscribers, services, logging, and launch files with respect to the ROS2 Foxy.
- Driver : Rishabh Singh (UID - 117511208)
- ubuntu 20
- ros2 foxy
- ament_cmake
- rclcpp
- std_msgs
1. Make a directory using command "mkdir name_of_your_directory"
2. cd name name_of_your_directory
3. git clone https://github.com/rish2911/beginner_tutorials.git
4. rosdep install -i --from-path src --rosdistro foxy -y (for installing dependencies)
5. colcon build
6. source "your_colcon_workspace"/install/setup.bash
1. Open a new terminal, navigate to name_of_your_directory, and source the setup files:
. install/setup.bash
2. ros2 run cpp_pubsub talker (for publisher)
3. ros2 run cpp_pubsub listener (for subscriber)
1. Open a new terminal, navigate to name_of_your_directory, and source the setup files:
. install/setup.bash
2. ros2 run cpp_pubsub talker (for publisher/server)
3. ros2 run cpp_pubsub client_c input (for client request)
input can be: fatal, error, info, warn, debug
Note: This is just a way to request to modify the default message published by publisher
and also to display different logging levels
1. Open a new terminal, navigate to name_of_your_directory, and source the setup files:
source "your_colcon_workspace"/install/setup.bash
2. ros2 launch cpp_pubsub cpp_pubsub.yaml
1. Open a new terminal, navigate to name_of_your_directory, and source the setup files:
source "your_colcon_workspace"/install/setup.bash
2. ros2 launch cpp_pubsub rosbag_launch.py record:=True
3. ros2 bag play recorded_cpppubsub_bag
4. ros2 run cpp_pubsub listener