How ifurusato/ros works
This repository is a Python robot operating system for Raspberry Pi differential-drive robots. Its principal workflow is to configure and discover hardware, collect sensor or operator events, prioritize behavior through the subsumption/BBS control layers, and command the motors. The graph includes documented sensor, display, and device capabilities; unsampled implementation details are represented only where the README supports them, so uncertain internal wiring is omitted.
Main entry points: lib Sensor drivers · message_factory.py Event messages · motors.py Drive motors · ros.py ROS runtime
Components 21
Runtime and setup
- ROS runtime
ros.py - YAML configuration
lib/config_loader.py - I²C discovery
lib/i2c_scanner.py - Event messages
lib/message_factory.py - Message bus
lib/message_bus.py - Async message queue
lib/async_message_bus.py
Inputs and sensing
- Sensor drivers
lib - Composite ranging
lib/lidar.py - Gamepad input
lib/gamepad.py - IFS controls
lib/ifs.py
Behavior and control
- Task arbitrator
lib/arbitrator.py - Behavior state machines
lib/fsm.py - Robot controller
lib/controller.py - PID and odometry
lib/pid_motor_ctrl.py
Actuation and feedback
- Drive motors
lib/motors.py - ThunderBorg driver
lib/ThunderBorg3.py - UltraBorg driver
lib/UltraBorg3.py - LED displays
lib/rgbmatrix.py
Other components
- Operator
- Robot environment
- Robot hardware
Connections 27
- Operator → Gamepad input: provides controls
- Operator → IFS controls: triggers events
- ROS runtime → YAML configuration: loads settings
- ROS runtime → I²C discovery: discovers devices
- ROS runtime → Message bus: initializes bus
- Sensor drivers → Robot environment: measures
- Robot environment → Sensor drivers: physical signals
- Sensor drivers → Event messages: creates events
- Composite ranging → Event messages: reports ranging
- Gamepad input → Event messages: creates events
- IFS controls → Event messages: creates events
- Event messages → Message bus: publishes messages
- Message bus → Async message queue: queues messages
- Async message queue → Task arbitrator: dispatches tasks
- Task arbitrator → Behavior state machines: prioritizes behavior
- Behavior state machines → Robot controller: selects actions
- Robot controller → Drive motors: commands motion
- Robot controller → LED displays: updates feedback
- PID and odometry → Drive motors: regulates velocity
- Drive motors → ThunderBorg driver: sets drive power
- Drive motors → Robot hardware: drives wheels
- ThunderBorg driver → Robot hardware: controls motors
- UltraBorg driver → Robot hardware: controls servo and sonar
- LED displays → Robot hardware: shows status
- Robot hardware → Sensor drivers: supplies readings
- I²C discovery → Sensor drivers: identifies devices
- I²C discovery → Composite ranging: identifies devices