🤖 ROS 2 Robotics & Embedded Control Workspaces
A consolidated, modular collection of ROS 2 packages covering motor telemetry, actuator controllers, action servers, service clients, and autonomous mobile rover simulations (Gazebo & SLAM).
🏗️ Repository Architecture
This repository organizes modular ROS 2 nodes into two core domain workspaces:
ros2-workspaces/
├── motor_control_ws/ # Motor actuation, thermal telemetry & custom state interfaces
│ ├── motor_build_up/ # Multi-node launch orchestration
│ ├── motor_ctrl/ # Closed-loop motor controller node
│ ├── motor_interfaces/ # Custom ROS 2 messages (MotorState.msg)
│ ├── motor_state/ # Real-time state publisher & telemetry logger
│ └── motor_temp/ # Temperature sensor publisher & thermal threshold alerts
│
└── robotics_and_rover_ws/ # Mobile rover, action/service interfaces & system controllers
├── my_rover/ # URDF model, SLAM launch, Gazebo world & RViz configs
├── battery_manager/ # Service server/client for power & battery health monitoring
├── distance_action/ # Goal-oriented action server/client for distance tracking
├── led_controller/ # Dynamic parameter-driven LED matrix status indicators
├── custom_interfaces/ # Custom Actions (Maps, Navigation) & Services (Battery, Arithmetic)
└── my_package/ # Core utility clients, servers & asynchronous handlers
⚡ Core Modules Overview
1. Motor Control & Telemetry (motor_control_ws)
motor_interfaces/msg/MotorState.msg: High-frequency telemetry packet tracking motor velocity, load current, winding temperature, and error status flags.motor_ctrl: Listens for setpoint targets, executes PID-based speed adjustments, and commands hardware bridge drivers.motor_temp: Temperature monitoring node that broadcasts sensor readings and flags overheating states to prevent hardware failure.motor_build_up: Unified launch scriptmotor_ctrl.launch.pyto bring up the complete powertrain monitoring stack simultaneously.
2. Autonomous Rover & SLAM (robotics_and_rover_ws/my_rover)
- URDF Model: Custom differential-drive robotic rover featuring caster stabilizers and sensor mount points.
- Gazebo Simulation: Simulated physical world (
world.sdf) equipped with obstacles and boundary walls. - Mapping & SLAM: Cartographer / Nav2 SLAM integration (
slam.launch.py) utilizing laser scan data to generate occupancy grid maps (tb3_world.pgm/.yaml).
3. Asynchronous Actions & Services
distance_action: ROS 2 Action mechanism executing long-running movement sequences with continuous real-time progress feedback and cancellation support.battery_manager: ROS 2 Service enabling synchronized battery level queries and low-voltage fail-safe responses.led_controller: Real-time diagnostic indicator updating hardware LED patterns based on robot operational states.
🚀 Getting Started
Prerequisites
- Ubuntu 22.04 LTS (or ROS 2 Docker container)
- ROS 2 Humble / Iron
colconbuild tools androsdep
sudo apt update
sudo apt install python3-colcon-common-extensions python3-rosdep
Building the Workspaces
Building the Motor Control Workspace:
cd motor_control_ws
colcon build --symlink-install
source install/setup.bash
Building the Rover & Robotics Workspace:
cd robotics_and_rover_ws
colcon build --symlink-install
source install/setup.bash
🎮 Execution & Launch Examples
1. Launching Motor Telemetry System
ros2 launch motor_build_up motor_ctrl.launch.py
2. Visualizing Rover in RViz
ros2 launch my_rover display.launch.py
3. Running SLAM Mapping Simulation
ros2 launch my_rover slam.launch.py
4. Calling Battery Service
ros2 run battery_manager battery_client
👨💻 Author & Maintenance
- Deepak R (@Arkz-Deepak)
- Portfolio & Lab: lab.deepak-arkz.me