This repository is designed to teach ROS2 (Robot Operating System 2) for beginners using the Jazzy distribution.
- Docker
- Xming (for Windows users)
-
Start Docker:
docker-compose up -d
-
Attach to Docker container:
docker-compose exec ros bash
To forward video from Docker to the base OS, ensure you have Xming installed and running.
-
Build the code inside the workspace directory:
colcon build
-
Source the setup script inside the install folder:
source install/setup.bash
-
Run the Python talker node:
ros2 run talker_listener_py talker
-
Run the Python listener node:
ros2 run talker_listener_py listener
-
Run the C++ talker node:
ros2 run talker_listener_cpp talker
-
Run the C++ listener node:
ros2 run talker_listener_cpp listener
You can also experiment by running nodes written in different languages together. For example:
-
Run the C++ talker node and the Python listener node:
ros2 run talker_listener_cpp talker ros2 run talker_listener_py listener
-
Run the Python talker node and the C++ listener node:
ros2 run talker_listener_py talker ros2 run talker_listener_cpp listener
The keystroke talker node allows you to send keystrokes as messages. To run the keystroke talker node, follow these steps:
-
Run the keystroke talker node in
C++:ros2 run talker_listner_cpp keyboard_talker_char
-
Run the keystroke talker node in
python:ros2 run talker_listner_py keyboard_talker_char
This node will publish keystrokes to a topic, which can be subscribed to by other nodes. This will help you understand how ROS2 nodes written in different languages can communicate with each other.
- For more details on the implementation of the keystroke talker node in
c++, please refer to the Keystroke Talker README. - For more details on the implementation of the keystroke talker node in
Python, please refer to the Keystroke Talker README.
This project is licensed under the GNU General Public License v3.0.