How purduelunabotics/purdue_lunabotics works
This repository is a ROS 2 robotics stack for Purdue Lunabotics, spanning autonomous behavior, teleoperation, navigation, perception, simulation, and embedded robot control. A principal workflow is an operator or autonomy state machine producing motion and mechanism commands; navigation and perception support robot operation, while embedded firmware interfaces with physical actuators. The graph preserves these documented and tree-visible subsystems. Some links are dashed because the sampled excerpts do not show their runtime wiring.
Main entry points: state_manager.py State manager · teensy_driver_node.cpp Teensy driver · nav2_bridge.cpp Nav2 bridge · lunabot_msgs Robot messages
Components 20
Autonomous behavior
- State manager
lunabot_behavior/lunabot_behavior/state_manager.py - Behavior states
lunabot_behavior/lunabot_behavior/states - Main state machine
lunabot_behavior/lunabot_behavior/main_states.py
Robot control and I/O
- Manual controller
lunabot_control/src/lunabot_control/manual_controller.py - Drive controllers
lunabot_control/src/lunabot_control/differential_drive_controller.py - Control algorithms
lunabot_control/src/lunabot_control/pid_controller.py - Teensy driver
lunabot_embedded/src/teensy_driver_node.cpp - Firmware drivers
lunabot_embedded/firmware/teensy_main/lib/lunabot_drivers - USB HID
lunabot_embedded/src/hid.c
Navigation and perception
- Nav2 bridge
lunabot_nav/src/nav2_bridge.cpp - STheta* planner
lunabot_nav/src/stheta_star.cpp - Perception nodes
lunabot_perception
Simulation and description
- Gazebo control
gz_ros2_control/src/gz_system.cpp - Gazebo ROS plugin
gz_ros2_control/src/gz_ros2_control_plugin.cpp - Robot description
lunabot_description/launch/robot_description.launch.py
Messages and configuration
- LED colors
lunabot_config/lunabot_config/led_colors.py - Robot messages
lunabot_msgs
Other components
- Operator
- Gazebo simulator
- Robot hardware
Connections 18
- Operator → Manual controller: sends joystick input
lunabot_control/src/lunabot_control/manual_controller.py - Manual controller → Robot messages: publishes effort
lunabot_control/src/lunabot_control/manual_controller.py - Main state machine → State manager: starts manager
lunabot_behavior/lunabot_behavior/main_states.py - State manager → Behavior states: runs state
lunabot_behavior/lunabot_behavior/state_manager.py - State manager → LED colors: encodes colors
lunabot_behavior/lunabot_behavior/state_manager.py - State manager → Robot messages: handles events
lunabot_behavior/lunabot_behavior/state_manager.py - Nav2 bridge → STheta* planner: requests paths
- Perception nodes → Nav2 bridge: provides observations
- Drive controllers → Control algorithms: uses control
- Teensy driver → USB HID: uses HID
lunabot_embedded/src/teensy_driver_node.cpp - Teensy driver → Firmware drivers: exchanges commands
- Robot messages → Teensy driver: defines payloads
lunabot_embedded/src/teensy_driver_node.cpp - Gazebo ROS plugin → Gazebo control: loads system
gz_ros2_control/src/gz_ros2_control_plugin.cpp - Gazebo control → Gazebo simulator: reads and writes joints
gz_ros2_control/src/gz_system.cpp - Robot description → Gazebo simulator: launches simulation
- State manager → Nav2 bridge: requests navigation
- Drive controllers → Robot hardware: commands drive
- Firmware drivers → Robot hardware: drives actuators