How gsarenas/mogbe works
Project type and purpose
• MOGBE is a ROS 2–based autonomous mobile robotics platform for both simulation (Gazebo+RViz) and real‐world use (Raspberry Pi + Arduino Nano + LiDAR). It is not a monolithic app but a distributed robotics system combining hardware, sensor drivers, control nodes, SLAM, navigation, and simulation nodes.
File‐structure analysis
• Top‐level:
• config/: ROS 2 parameter YAMLs for Gazebo, Nav2, SLAM, controllers, twist_mux, RViz configs
• description/: URDF/XACRO robot description, inertial, sensors, ros2_control integration
• launch/: Python launch scripts for simulation, real robot (Pi), dev environment, online/async SLAM, navigation
• worlds/: Gazebo world files (hospital, warehouse, wall, empty)
• meshes/, models/: 3D assets for Gazebo simulation
• scripts/: simple ROS 2 “talker”–style Python scripts for manual movement, line follower
• mogbe/: ROS 2 package source code (nodes, controllers, interfaces)
• package.xml, CMakeLists.txt: ROS 2 build and dependency definitions
Key runtime components (to show
• Hardware (Real)
• Raspberry Pi (runs ROS 2 core, sensor nodes, controllers)
• Arduino Nano (low‐level PWM/motor control)
• LiDAR (LD19‐STL)
• Motor drivers/wheels, battery, IMU (via XACRO)
• Dev Machine
• Gazebo simulator (+ gazebo_ros)
• RViz2 for visualization
• SLAM Toolbox (online_async, localization)
• Navigation2 stack (nav2)
• teleop_twist_keyboard, twist_mux
• Controller Manager (spawner diff_cont, joint_broadcaster)
• ROS 2 Middleware
• DDS-based communication between Pi↔Dev/simulation nodes
• Data flows
• sensor → scan topic → SLAM/Navigation
• cmd_vel → twist_mux → diff_drive_controller → motor commands → Arduino
• robot_description (URDF) broadcast by robot_state_publisher → TF2 tree
• Gazebo ↔ spawn_entity, gazebo_ros plugins ↔ robot_description
Architectural patterns and principles
• Modular, node‐based microservices: each ROS 2 node has a single responsibility (SLAM, navigation, controller, state publisher, teleop).
• Parameter‐driven configuration: YAML files injected at launch.
• Separation of simulation vs real‐hardware: use_sim_time parameter toggles time source; use_ros2_control toggles hardware interface.
• Publish/subscribe for sensor and control data; service/action for nav goals.
• tf2 for coordinate transforms; launch files for composition.