Active ROS 2 engineering workspace for building modular robotics software examples with Python (rclpy), supported by a reproducible Docker development environment and an automated GitHub Actions CI workflow.
The workspace demonstrates ROS 2 package organization, node communication, custom interfaces, launch and configuration, debugging, and practical development workflows.
- ✔ Publishers & Subscribers
- ✔ Services & Clients
- ✔ Actions
- ✔ Custom Interfaces
- ✔ Modular Package Architecture
- ✔ Parameters
- ✔ Namespaces & Remapping
- ✔ XML Launch Files
- ✔ Python Launch Files
- ✔ Docker-based Development Environment
- ✔
colconBuilds - ✔ GitHub Actions CI
- ✔ Docker Image Publishing
- ✔ Quality of Service (QoS)
- ✔ ROS 2 Diagnostics & Observability
- ✔
rosbag2Analysis & Debugging
- Executors, Callback Groups & Lifecycle Nodes
- State Estimation with
robot_localization - Nav2 Behavior Trees & Recovery Behaviors
ros2_control- C++ /
rclcpp - SIL &
launch_testing
This repository is a continuously maintained ROS 2 development workspace focused on practical, modular examples rather than a single finished robot application.
The workspace is used to develop and validate ROS 2 packages while maintaining a consistent development environment and repeatable build workflow.
ROS 2 Packages
│
▼
Docker Development Environment
│
▼
colcon Build & Validation
│
▼
GitHub Actions CI
│
▼
Docker Image Published to Docker Hub
Changes to the Docker environment or CI configuration trigger the GitHub Actions workflow.
The ROS 2 development environment is containerized with Docker to provide a consistent and reproducible development environment.
GitHub Actions is used to:
- Build the Docker image.
- Validate the Docker-based ROS 2 environment.
- Publish the image to Docker Hub.
Docker image:
preeet/ros2-jazzy-dev
Docker Hub:
https://hub.docker.com/r/preeet/ros2-jazzy-dev
Workflow:
.github/workflows/docker-build.yml
- Build and maintain a modular ROS 2 workspace.
- Practice ROS 2 communication and package development using Python.
- Maintain a reproducible Docker-based development environment.
- Automate image build, validation, and publishing through GitHub Actions.
- Keep the repository structured and extensible for future robotics projects.
ros2-programming-examples/
├── .github/
│ └── workflows/
│ └── docker-build.yml
├── docker/
│ ├── entrypoint.sh
│ └── README.md
├── Dockerfile
├── LICENSE
├── README.md
└── src/
├── my_robot_bringup/
├── my_robot_interfaces/
├── robot_bringup_sensors/
├── robot_core/
├── robot_navigation/
├── robot_navigation_diagnostics/
├── robot_safety/
├── robot_sensors/
└── robot_state/
Most packages are ament_python; my_robot_interfaces and my_robot_bringup use ament_cmake for interface and bringup-related functionality.
| Package | Description |
|---|---|
my_robot_bringup |
CMake-based bringup package containing launch files and configuration for system-level startup and diagnostics. |
my_robot_interfaces |
Custom messages, services, and actions for robot state, safety, mode control, and navigation. |
robot_bringup_sensors |
Sensor bringup, health monitoring, IMU tilt guard, power switching, and QoS publisher examples. |
robot_core |
Basic ROS 2 node examples and publisher/subscriber communication. |
robot_navigation |
Area navigation action server using the custom MapsArea action. |
robot_navigation_diagnostics |
Position tracking, goal markers, and navigation/path safety checking examples. |
robot_safety |
Safety service/client, thermal guard, and emergency velocity command examples. |
robot_sensors |
Battery, motor temperature, LiDAR publisher/watchdog, and IMU monitoring examples. |
robot_state |
Robot state publisher/subscriber, robot mode service/client, and pose tracking examples. |
- Multi-package ROS 2 workspace structure
- Python node development with
rclpy - Publishers, subscribers, services, clients, and actions
- Custom
msg,srv, andactioninterfaces - Timers and callbacks
- Parameters
- Namespaces and remapping
- ROS 2 logging
- XML and Python launch files
- CLI-based build and execution with
colcon - Node and graph validation using ROS 2 CLI and
rqt_graph
Requirements:
- Ubuntu with ROS 2 Jazzy
- Python 3
colcon- ROS 2 dependencies
Clone the repository:
git clone https://github.com/Preetbandgar/ros2-programming-examples.git
cd ros2-programming-examples
source /opt/ros/jazzy/setup.bashInstall dependencies:
rosdep update
rosdep install --from-paths src --ignore-src -r -yBuild:
colcon build
source install/setup.bashThe repository also provides a Docker-based ROS 2 development environment.
Pull the published image:
docker pull preeet/ros2-jazzy-dev:latestRun the development container:
docker run --rm -it \
-v "$PWD":/home/ubuntu/ros2-programming-examples \
-w /home/ubuntu/ros2-programming-examples \
preeet/ros2-jazzy-dev:latestInside the container:
source /opt/ros/jazzy/setup.bash
colcon build
source install/setup.bashList available executables:
ros2 pkg executables robot_core
ros2 pkg executables robot_sensors
ros2 pkg executables robot_state
ros2 pkg executables robot_safety
ros2 pkg executables robot_navigationExample commands:
ros2 run robot_core robot_speaker_exe
ros2 run robot_core robot_listener_exe
ros2 run robot_state robot_mode_server_exe
ros2 run robot_state robot_mode_client_exe
ros2 run robot_sensors lidar_fake_node_exe
ros2 run robot_sensors lidar_watchdog_node_exe
ros2 run robot_navigation area_navigation_action_server_exeAfter changing packages or interfaces:
colcon build
source install/setup.bash- ROS 2 Jazzy
- Python 3
rclpyament_pythonament_cmakerosidl_default_generatorscolcon- ROS 2 CLI
- Docker
- GitHub Actions
- Docker Hub
- RViz2
- Gazebo Harmonic
- Foxglove
rqt_graph
This repository is actively maintained as a structured ROS 2 engineering workspace.
Implemented work is kept separate from planned topics so the repository reflects the current state of the project.
This project is licensed under the MIT License. See the LICENSE file for details.
