Skip to content

mohammad-alghazawi/ros2-learning-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 Learning Projects 🚀

_A collection of ROS2 fundamentals — hands-on nodes, services, and custom interfaces built in both C++ and Python.

This repository contains my ROS2 (Robot Operating System 2) learning projects, developed while following the ROS2 for Beginners course by Edouard Renard. It includes implementations of publishers, subscribers, services, custom messages, and launch files in both C++ and Python.


📂 Project Structure

src/
├── my_cpp_pkg/              # C++ nodes
│   ├── add_two_ints_client.cpp
│   ├── add_two_ints_server.cpp
│   ├── robot_news_station.cpp
│   ├── smartphone.cpp
│   ├── number_publisher.cpp
│   ├── hardware_status_publisher.cpp
│   ├── led_panel_publisher.cpp
│   └── ...
│
├── my_py_pkg/               # Python nodes
│   ├── add_two_ints_client.py
│   ├── add_two_ints_server.py
│   ├── robot_news_station.py
│   ├── smartphone.py
│   ├── number_publisher.py
│   ├── hardware_status_publisher.py
│   ├── led_panel_publisher.py
│   └── ...
│
├── my_robot_bringup/        # Launch & config files
│   ├── config/
│   │   ├── name_robo_station.yaml
│   │   └── number_app.yaml
│   ├── launch/
│   │   ├── number_app.launch.py
│   │   ├── number_app.launch.xml
│   │   └── news_station_robo.launch.xml
│   ├── CMakeLists.txt
│   └── package.xml
│
└── my_robot_interfaces/     # Custom messages & services
    ├── msg/
    │   ├── HardwareStatus.msg
    │   └── LedPanelState.msg
    ├── srv/
    │   └── SetLed.srv
    ├── CMakeLists.txt
    └── package.xml

🧩 Features

  • Publishers & Subscribers

    • Number publisher/subscriber
    • Robot news station & smartphone subscriber
  • Services

    • Add two integers (C++ & Python)
    • LED panel control with custom service
  • Custom Interfaces

    • HardwareStatus.msg
    • LedPanelState.msg
    • SetLed.srv
  • Launch Files

    • XML and Python launch files for running multiple nodes

▶️ How to Run

  1. Clone the repo into your ROS2 workspace:

    cd ~/ros2_ws/src
    git clone https://github.com/mohammad-alghazawi/ros2-learning-projects.git
    cd ~/ros2_ws
    colcon build
    source install/setup.bash
  2. Run a node (example: number publisher):

    ros2 run my_cpp_pkg number_publisher
  3. Launch multiple nodes:

    ros2 launch my_robot_bringup number_app.launch.py

📚 What I Learned

  • Differences between C++ and Python node implementations in ROS2

  • How to create and use custom messages and services

  • Writing launch files in both XML and Python

  • Organizing a ROS2 workspace with multiple packages

🔮 Next Steps

  • Add unit tests for service and topic communication

  • Improve visualization with RViz plugins

🙋‍♂️ Author

Mohammad Alghazawi — Mechatronics engineer (MSc) passionate about robotics, simulation, and ROS2 development.

About

ROS2 learning projects with publishers, subscribers, services, custom messages, and launch files in C++ and Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors