How varunvaidhiya/mecanum-wheel-robot works
Project type and purpose
• This is a robotics software/firmware project built on ROS2 (Jazzy) for an omnidirectional Mecanum-wheel robot.
• It comprises three main software packages (bringup, description, driver) running on a Raspberry Pi (Ubuntu + ROS2) and embedded firmware on an STM32F407VG Discovery board.
• Purpose: Provide a modular, layered robotics control stack—high-level ROS2 nodes for motion commands, URDF/model description for visualization, and real-time motor control on the microcontroller.
File structure
• Top-level directories:
• src/omnibot_bringup – launch files and RViz config
• src/omnibot_description – URDF/XACRO robot model
• src/omnibot_driver – C++ and Python ROS2 nodes for motor control and serial bridging
• src/omnibot_firmware – STM32 embedded C code (HAL drivers for GPIO, USART, TIM)
• build/ and install/ hold colcon build artifacts and install layouts.
• config and launch subdirectories group ROS2 parameters and launch definitions.
• CMakeLists.txt and package.xml in each package denote ROS2/CMake build integration.
README for additional insights
• Hardware architecture layered into Compute (Raspberry Pi 5 + ROS2), Control (STM32 + L298N drivers), Perception (future sensors).
• Workflow: colcon build → source install → ros2 launch → topics (/cmd_vel) → firmware flash via OpenOCD.
Main components & interactions
a. Components
• Compute Layer (Raspberry Pi 5)
• ROS2 Core
• omnibot_drive nodes
• omnibot_bringup launch manager
• omnibot_description URDF server (for RViz)
• Control Layer (STM32F407VG Discovery)
• Embedded firmware (motor control tasks)
• HAL: USART for serial comm, Timer for PWM, GPIO for direction
• L298N motor driver boards
• Communication
• Serial/UART link between ROS2 serial_bridge_node and STM32 firmware
• Peripherals (future)
• ROS2 sensors (LIDAR, cameras)
• AI/ML inference modules
b. Relationships and data flow
• ROS2 user publishes Twist messages → omnibot_driver/mecanum_controller_node → serial_bridge_node formats and sends over UART → STM32 firmware reads commands → PWM & GPIO drive L298N → motors turn wheels.
• omnibot_description supplies URDF to RViz via bringup launch → visualization of robot state.
• bringup launch script kicks off driver nodes, loads parameters (from config/*.yaml), and opens RViz for monitoring.
c. Architectural patterns and principles
• Layered architecture: separation of high-level planning (ROS2) and low-level control (firmware).
• Modular ROS2 packages: clear boundaries (bringup vs description vs driver).
• Publish/subscribe for decoupled inter-node communication.
d. Relevant technologies
• ROS2 (rclcpp, rclpy)
• colcon/CMake build system
• Python launch API for ROS2
• STM32Cube HAL, OpenOCD for flashing
• L298N motor drivers