A ROS2-based autonomous robot system for wildfire cold trailing operations, running on Raspberry Pi 4 with flight controller integration.
EMBR is designed to assist in wildfire response by mapping hot spots that may reignite into fires after a wildfire burns through an area, a procedure known as cold trailing. The system integrates a Cube Orange flight controller, RFD 900x radio telemetry, thermal camera, temperature sensors, and LIDAR to detect and map thermal anomalies and environmental conditions in post-wildfire areas.
- Main Computer: Raspberry Pi 4B
- Operating System: Ubuntu 22.04.05 LTS
- ROS Version: ROS2 Humble
- Flight Controller: Cube Orange
- Radio: RFD 900x-US
- Thermal Camera: FLIR Lepton 3.1R with PureThermal 3
- Temperature Sensor: Arduino-based (via serial)
- Quick Start
- Simulation
- Docker Simulation
- Installation
- Hardware Setup & Wiring
- Running the System
- System Architecture
- Testing
- Documentation
- Development
- Contributing
- Troubleshooting
For a complete system setup on a fresh Raspberry Pi:
cd Tools/Setup-Scripts
./setup-allThis will install ROS2 Humble, system dependencies, Python dependencies, patch DroneKit for Python 3.10+, configure the thermal camera, and install raspi-config.
Important: After installation, you must configure serial ports (see Serial Port Configuration below) before starting the system.
To start all system components:
cd Tools
./start-embr.shEMBR-Bot includes a comprehensive sensor abstraction layer that allows you to run the system with simulated sensors, enabling development and testing without any physical hardware.
The system supports two modes for each sensor:
real(default) - Use actual hardware sensorssim- Use simulated sensors (no hardware required)
All sensor modes are configured through JSON configuration files in ros2_ws/src/embr/config/.
Option 1: Full Simulation (All Sensors)
ros2 launch embr embr_launch.py config_file:=src/embr/config/sensors_sim.jsonOption 2: Mixed Mode (Some Real, Some Simulated)
ros2 launch embr embr_launch.py config_file:=src/embr/config/sensors_mixed.jsonOption 3: Real Hardware (Default)
ros2 launch embr embr_launch.py
# Uses config/sensors.json by defaultOption 4: Custom Configuration
# Create your own config file based on examples
ros2 launch embr embr_launch.py config_file:=/path/to/custom_config.jsonFor detailed configuration options, see Configuration Guide.
Temperature Sensor
- Realistic sine wave pattern with noise
- Configurable base temperature, variation, and noise levels
- Default: 22°C ± 2°C with ±0.1°C random noise
GPS (Cube Orange)
- Three movement patterns:
circle- Circular flight pattern (~11m radius)line- Linear northward movementhover- Stationary with small random variations
- Configurable starting position, velocity, and altitude
- Realistic GPS coordinate updates (latitude/longitude in degrees × 10^7)
MAVLink Radio
- Records all transmitted messages for verification
- Supports message injection for testing
- Compatible with real MAVLink message types
To start Docker and run EMBR in simulation mode:
# Build and start container
docker compose up -d
# Access container
docker compose exec embr-sim /bin/bash
# Inside container: Source ROS
source install/setup.bash
# Launch with simulation config
ros2 launch embr embr_launch.py config_file:=config/sensors_sim.json- DOCKER_CHEATSHEET.md - Quick command reference
- Configuration Guide - Sensor config documentation
- Raspberry Pi 4B running Ubuntu 22.04 LTS
- Internet connection for downloading dependencies
Run the master setup script to install all components:
cd Tools/Setup-Scripts
./setup-allThe setup script will:
- Install ROS2 Humble
- Install system dependencies (python3-pip, libuvc-dev)
- Install Python dependencies (ros2_ws/requirements.txt)
- Patch DroneKit for Python 3.10+ compatibility
- Configure thermal camera (PureThermal 3) with udev rules
- Install raspi-config for serial configuration
If you prefer to install components individually:
1. Install ROS2 Humble:
cd Tools/Setup-Scripts
./install-ROS2-Humble2. Install Dependencies:
cd Tools/Setup-Scripts
./install-dependencies3. Setup Thermal Camera:
cd Tools/Setup-Scripts
./setup-thermal-camera4. Install Python Requirements:
cd ros2_ws
pip install -r requirements.txt5. Patch DroneKit for Python 3.10+:
Follow the steps in Cube Orange DroneKit Modification below to update the dronekit package for Python 3.10+ compatibility.
This step is required for both automated and manual installation.
The system requires two UART connections. Follow these steps to enable them:
1. Run the configuration tool:
sudo raspi-config2. Navigate to:
Interface Options → Serial Port
- Disable login shell over serial
- Enable serial interface
3. Enable second UART manually:
sudo su
cd /boot/firmware
nano config.txtAdd or confirm:
# Enable the serial pins
enable_uart=1
dtoverlay=uart2
dtoverlay=disable-bt
Save and exit, then reboot.
4. Verify configuration:
After rebooting, verify with ls -l /dev/serial* - you should see two devices.
| UART Interface | TXD Pin | RXD Pin | CTS Pin | RTS Pin | Device |
|---|---|---|---|---|---|
| UART0/ttyAMA0 | GPIO14 | GPIO15 | GPIO16 | GPIO17 | Cube Orange |
| UART2/ttyAMA1 | GPIO0 | GPIO1 | N/A | N/A | RFD 900x Radio |
| Raspberry Pi Pin | RFD 900x Pin |
|---|---|
| Pin 4 (5V) | Pin 4 (5V) |
| Pin 6 (GND) | Pin 1 (GND) |
| Pin 27 (GPIO0/TX) | Pin 7 (RX) |
| Pin 28 (GPIO1/RX) | Pin 9 (TX) |
| Cube Orange TELEM Pin | Signal Name | Raspberry Pi GPIO | RPi Physical Pin |
|---|---|---|---|
| 1 | 5V (VCC) | 5V Power | Pin 2 |
| 2 | TX (from Cube) | RXD (GPIO15) | Pin 10 |
| 3 | RX (to Cube) | TXD (GPIO14) | Pin 8 |
| 4 | CTS (from Cube) | RTS (GPIO17) | Pin 11 |
| 5 | RTS (to Cube) | CTS (GPIO16) | Pin 36 |
| 6 | GND | Ground | Pin 14 |
- Temperature Sensor:
/dev/ttyACM0(Arduino via USB) - Thermal Camera: USB connection with udev rule creating
/dev/pt3symlink
For detailed pinout diagrams, see Serial and Pins Documentation.
Use the provided startup script to launch all ROS2 nodes:
cd Tools
./start-embr.shIf you need to build and run manually:
1. Build the ROS2 workspace:
cd ros2_ws
colcon build
source install/setup.bash2. Launch all nodes:
ros2 launch embr embr_launch.py3. Run individual nodes:
ros2 run embr getCube # Cube Orange telemetry
ros2 run embr getTemp # Temperature sensor
ros2 run embr radio # Radio transmission- Some nodes require superuser permissions for serial access
- If running with
sudo, manually source ROS2:source /opt/ros/humble/setup.bash - The system automatically pulls latest changes on startup via
git pull
The EMBR-Bot system consists of three main ROS2 nodes:
- Purpose: Reads telemetry from Cube Orange flight controller
- Device:
/dev/ttyAMA0(UART0) - Published Topic:
gps(GPS location, altitude, velocity) - Data: Latitude, Longitude, Altitude, Ground Speed
- Purpose: Reads temperature data from Arduino sensor
- Device:
/dev/ttyACM0(USB Serial) - Published Topic:
temperature(Temperature readings) - Update Rate: 1 Hz
- Purpose: Transmits data via RFD 900x radio using MAVLink protocol
- Device:
/dev/ttyAMA1(UART2) - Subscribed Topics:
gps,temperature,/pointcloud(LIDAR) - Protocol: MAVLink v2.0
- Features:
- Transmits GPS and temperature data
- Processes LIDAR point cloud into 72 sectors
- Sends distance obstacles over radio link
Cube Orange → getCube → gps topic → radio → RFD 900x → Ground Station
Arduino → getTemp → temperature topic → radio → RFD 900x → Ground Station
LIDAR → /pointcloud topic → radio → RFD 900x → Ground Station
Comprehensive documentation is available in the Documentation/2025/ directory:
- Overview and Basics - System overview, OS information, and ROS2 setup
- Serial and Pins - Complete wiring diagrams and serial configuration
- Cube Orange Setup - Flight controller configuration and motor setup
- ROS2 Workspace Guide - Detailed ROS2 build and run instructions
Previous year documentation is preserved in Documentation/2023-24/ including KR260 FPGA development work.
EMBR-Bot/
├── ros2_ws/ # ROS2 workspace
│ ├── src/
│ │ ├── embr/ # Main EMBR package
│ │ │ ├── embr/ # Python nodes
│ │ │ │ ├── getCube.py
│ │ │ │ ├── getTemp.py
│ │ │ │ └── radio.py
│ │ │ ├── launch/ # Launch files
│ │ │ └── setup.py # Package configuration
│ │ └── msg_interface/ # Custom message definitions
│ └── requirements.txt # Python dependencies
├── Tools/
│ ├── Setup-Scripts/ # Installation scripts
│ └── start-embr.sh # EMBR startup
├── Documentation/
│ └── 2025/ # Current documentation
└── temp_sensor/ # Arduino temperature sensor code
- Create your node in
ros2_ws/src/embr/embr/ - Add entry point to
ros2_ws/src/embr/setup.py - Add node to
ros2_ws/src/embr/launch/embr_launch.py - Rebuild:
colcon build - Source:
source install/setup.bash
DroneKit requires a patch for Python 3.10+. Edit the DroneKit __init__.py file:
Note: This patch is applied automatically when running Tools/Setup-Scripts/setup-all.
# Change:
import collections
# To:
import collections.abc as collections
from collections.abc import MutableMapping
# Change:
class Parameters(collections.MutableMapping, HasObservers)
# To:
class Parameters(MutableMapping, HasObservers)Location: ~/.local/lib/python3.10/site-packages/dronekit/__init__.py
The EMBR-Bot project includes comprehensive tests for the sensor abstraction layer and ROS2 nodes.
Run all tests:
cd ros2_ws
source install/setup.bash
colcon testView test results summary:
colcon test-resultView detailed failures only:
colcon test-result --verboseView all test details (including passed tests):
colcon test-result --allRun tests with live output:
colcon test --event-handlers console_direct+Run specific test file:
pytest src/embr/test/test_sensors.py -v1. Unit Tests (test/test_sensors.py)
- Tests sensor implementations (Temperature, GPS, Thermal, Radio)
- Tests simulated sensor behavior
- Tests sensor factory and configuration loading
- Run with:
colcon testorpytest
2. Example Code (examples/sensor_testing_examples.py)
- Demonstrates sensor usage patterns
- Shows configuration options
- Not a test - educational examples
- Run with:
python3 src/embr/examples/sensor_testing_examples.py
When contributing to this repository:
- Test all changes on actual hardware when possible
- Update relevant documentation in
Documentation/2025/ - Ensure ROS2 nodes follow the established patterns
- Verify serial communications don't conflict
- Run tests before submitting:
colcon test
Components of this project use various licenses:
- EMBR package: Apache-2.0
- See individual component LICENSE files for details
Serial Port Permissions:
sudo usermod -a -G dialout $USER
# Log out and back inROS2 Not Found:
source /opt/ros/humble/setup.bash
# Or add to ~/.bashrcMultiple Serial Devices:
- Verify with
ls -l /dev/serial*andls -l /dev/tty* - Check udev rules in
/etc/udev/rules.d/
Build Failures:
cd ros2_ws
rm -rf build/ install/ log/
colcon buildHEAT Robotics