How cedbossneo/mowgli-docker works
Project Type and Purpose
• This is a full-stack, containerized robotics application.
• It orchestrates hardware interfaces (Mowgli device, GPS), a ROS backend (OpenMower/Mowgli software), an MQTT broker, and web UIs (Mowgli GUI & OpenMower web) via Docker Compose.
• It supports local execution on a Raspberry Pi or remote setups via TCP redirection (ser2net) or split host/mower deployments.
Main Components
A. Physical Layer (Host & Devices)
• Host OS (Raspberry Pi or Remote Machine) running Docker Engine
• Hardware devices:
– /dev/mowgli (Mowgli serial interface)
– /dev/gps (GPS serial interface)
B. Container Layer
1. openmower container
– ROS master and nodes: mowgli_driver, GPS/IMU fusion (ekf), planners (move_base_flex), ftc local planner, costmaps
– Mowgli GUI server (port 4006)
2. mosquitto container
– MQTT broker for telemetry & control
3. nginx (reverse-proxy)
– Serves OpenMower web app (port 4005) and proxies websocket/API to ROS/MQTT
4. ser2net container (only in serial-redirect mode)
– Exposes /dev/mowgli and /dev/gps over TCP ports (4001, 4002)
5. ublox container (optional GPS emulator)
C. Web Assets
– Flutter-based OpenMower UI (static assets under web/)
– Websocket/REST clients that communicate with backend over MQTT/WebSocket/ROS bridge
D. Configuration & Supporting Scripts
– config/ (driver, MQTT, mower configs)
– utils/ and tools/ (udev rules installer, RViz launcher, button press scripts)
Component Relationships & Data Flows
• Serial Data Flow:
Physical Device → Host OS /dev symlink → openmower container (or ser2net container)
In ser2net mode:
/dev/mowgli → ser2net → TCP → remote openmower container’s rosserial node
• ROS Internals:
mowgli_driver publishes sensor topics → ekf node → planner nodes → control topics
• Messaging:
ROS bridge ↔ MQTT broker (mosquitto container)
– Telemetry and commands flow via MQTT topics
• Web UI Interaction:
Browser ↔ nginx ↔ (Websocket/API) ↔ MQTT → ROS
• Remote Deployment:
Remote Host and Mower Pi each run Docker Compose; interact over network using MOWER_IP and ROS_IP variables
Architectural Patterns & Design Principles
• Microservices: one container per service (ROS, MQTT, reverse-proxy, device proxy)
• Message-broker pattern: decouples UI and backend via MQTT
• Device-proxy pattern: ser2net abstracts serial devices to TCP
• Layered separation: Physical → Container/Services → APIs/WebSockets → Presentation
Critical Details to Capture
• udev rules: mapping physical USB devices to /dev symlinks
• port mappings in docker-compose.yaml (4005, 4006, ROS ports)