Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c02ae4d
Brought over 2025 software/firmware & converted i2c to uart
LoganJanes Nov 18, 2025
4335c29
2025 repo with i2c replaced with uart
LoganJanes Nov 22, 2025
8051344
feat: moving 2026 firmware to use hdlc + message framing
Zaid-Duraid Dec 19, 2025
2ac0871
fix: remove git submoudle
Zaid-Duraid Dec 19, 2025
988e3ce
feat: pico code updated for LapisLazuli (not including motor control …
Zaid-Duraid Dec 20, 2025
8cfa040
fix: comment
Zaid-Duraid Dec 20, 2025
468e432
fix: commit gitmodules
Zaid-Duraid Dec 20, 2025
17ad540
fix: compile errors and warnings
Zaid-Duraid Dec 20, 2025
32beca5
feat: modified bluestar backend code to work with new firmware
Zaid-Duraid Dec 23, 2025
abc8c69
feat: updated frontend for bluestar
Zaid-Duraid Dec 23, 2025
650969e
fix: miswritten config
Zaid-Duraid Dec 23, 2025
4c9c843
fix: ROS.hpp
Zaid-Duraid Dec 23, 2025
b400879
fix: IMGui requires an integer in the ImGui::SliderInt
Zaid-Duraid Dec 23, 2025
ff729c0
fix: more ImGui slider issues and not breaking out arrays
Zaid-Duraid Dec 23, 2025
cff2ac3
fix: update launch files
Zaid-Duraid Dec 23, 2025
defc9e7
fix: rename common_backend to config_manager
Zaid-Duraid Dec 23, 2025
a726d64
fix: keyboard bindings remapped to avoid conflicts with power presets
Zaid-Duraid Dec 23, 2025
b2cff93
fix: do not latch dc motor direction input
Zaid-Duraid Dec 23, 2025
b153375
temp: adding logging for servo and pcdcm rotate commands
Zaid-Duraid Dec 23, 2025
a3962d6
fix: change binding for pcdcm turn cc and ccw
Zaid-Duraid Dec 23, 2025
3c47bb9
feat: add a byte wrapper for logging
Zaid-Duraid Dec 23, 2025
f7aed35
fix: the logging wrapper for transmitted bytes was a bad idea
Zaid-Duraid Dec 24, 2025
299805d
feat: updated repository documentation + experimenting with AI agents…
Zaid-Duraid Dec 26, 2025
26475d1
fix: framing offset bit and thruster value publishing bugs
Zaid-Duraid Dec 28, 2025
1c5c50f
feat: added docker compose quickstart and refactored frontend
Zaid-Duraid Dec 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copilot Instructions for EER Software_2026

## Project Overview
ROV (Remotely Operated Vehicle) control software for Eastern Edge Robotics' **Bluestar** ROV. Two-layer architecture: ROS2 packages (topsides) communicate with RP2040 firmware (onboard) via RS-485 UART.

## Architecture

### Data Flow
```
Frontend (ImGui GUI) → ROS2 Topics → Backend (pilot_listener) → UART/RS-485 → Firmware (RP2040)
```

### Key Components
| Layer | Location | Purpose |
|-------|----------|---------|
| **Frontend** | `ros_workspace/src/bluestar_frontend/` | ImGui-based C++ GUI for pilot control (requires display, run natively) |
| **Backend** | `ros_workspace/src/bluestar_backend/` | Translates ROS2 messages to UART commands |
| **Interfaces** | `ros_workspace/src/eer_interfaces/` | Custom ROS2 msg/srv definitions |
| **Config Manager** | `ros_workspace/src/config_manager/` | JSON config persistence via ROS2 services |
| **Firmware** | `firmware/LapisLazuli/` | RP2040 code controlling thrusters/servos/LEDs |

> **Note**: This ROV is built for the 2026 International MATE ROV Competition. Core controls are the current focus; autonomy and image recognition features will follow.

### Communication Protocol
- **minihdlc**: HDLC framing library used on both sides for reliable serial communication
- Command IDs defined in [pilot_listener.cpp](ros_workspace/src/bluestar_backend/src/pilot_listener.cpp#L29-L38) match [main.c](firmware/LapisLazuli/main.c#L62-L87) frame handler
- Commands: `0x00-0x05` (thrusters), `0x06-0x07` (LEDs), `0x08-0x0B` (servos), `0x0C-0x13` (DC motors)

## Build & Development

### ROS2 Workspace (Ubuntu 24.04 + ROS2 Jazzy)

Detailed steps for both the development and production environtment are found in the [ros_workspace](../ros_workspace/README.md)

### Firmware (Pico SDK)
```bash
cd firmware/LapisLazuli/build
cmake .. && make # Generates LapisLazuli.uf2
# Flash: copy .uf2 to Pico in BOOTSEL mode
```

More details in [firmware](../firmware/README.md)

## Code Conventions

### ROS2 Patterns
- **Custom interfaces** in `eer_interfaces/msg/` and `eer_interfaces/srv/` - add new messages there
- **Service clients** wait for availability: `client->wait_for_service()` before calls
- **Nodes** use `rclcpp::Node` base class; multiple nodes run via `StaticSingleThreadedExecutor`

### Thruster Control
- 6 thrusters with configurable mapping via `THRUSTER_CONFIG_MATRIX[6][6]` in pilot_listener
- Thrust values: 0-255 maps to 1100-1900μs PWM pulse width
- Configuration stored in `configs/bluestar_config.json`

### Adding New Peripherals
1. Define command ID in firmware `main.c` frame handler switch case
2. Add matching command ID constant in `pilot_listener.cpp`
3. Add fields to `PilotInput.msg` if UI-controlled
4. Update the frontend to expose controls

### JSON Configuration
- Configs stored in `configs/` directory as `.json` files
- Use `get_config` service to retrieve, `save_config` topic to persist
- `nlohmann/json` library for parsing (already included)

## Key Files Reference
- [pilot_listener.cpp](../ros_workspace/src/bluestar_backend/src/pilot_listener.cpp) - Backend UART communication
- [main.c](../firmware/LapisLazuli/main.c) - Firmware command handler and PWM control
- [PilotInput.msg](../ros_workspace/src/eer_interfaces/msg/PilotInput.msg) - Control message definition
- [ConfigManager.cpp](../ros_workspace/src/config_manager/src/ConfigManager.cpp) - Config service implementation
- [frontend_node.cpp](../ros_workspace/src/bluestar_frontend/src/frontend_node.cpp) - GUI program loop
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build/
install/
log/
config/
.vscode/
imgui.ini
.DS_Store
configs/
venv/
24 changes: 24 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[submodule "firmware/LapisLazuli/minihdlc"]
path = firmware/LapisLazuli/minihdlc
url = https://github.com/mengguang/minihdlc.git
[submodule "firmware/LapisLazuli/pico-sdk"]
path = firmware/LapisLazuli/pico-sdk
url = https://github.com/raspberrypi/pico-sdk.git
[submodule "ros_workspace/src/bluestar_backend/include/json"]
path = ros_workspace/src/bluestar_backend/include/json
url = https://github.com/nlohmann/json
[submodule "ros_workspace/src/bluestar_frontend/include/json"]
path = ros_workspace/src/bluestar_frontend/include/json
url = https://github.com/nlohmann/json
[submodule "ros_workspace/src/bluestar_frontend/include/imgui"]
path = ros_workspace/src/bluestar_frontend/include/imgui
url = https://github.com/ocornut/imgui
[submodule "ros_workspace/src/bluestar_frontend/include/glfw"]
path = ros_workspace/src/bluestar_frontend/include/glfw
url = https://github.com/glfw/glfw
[submodule "ros_workspace/src/bluestar_frontend/include/stb"]
path = ros_workspace/src/bluestar_frontend/include/stb
url = https://github.com/nothings/stb
[submodule "ros_workspace/src/bluestar_backend/include/minihdlc"]
path = ros_workspace/src/bluestar_backend/include/minihdlc
url = https://github.com/mengguang/minihdlc.git
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Memorial University Eastern Edge Robotics
Copyright (c) 2026 Memorial University Eastern Edge Robotics

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
# Software_2026
# Software_2026

[Eastern Edge Robotics](https://www.easternedgerobotics.com/) (EER) is a student-led engineering design team based at the Memorial University of Newfoundland and the Fisheries and Marine Institute. The team competes in the annual MATE ROV Competition. Every year at EER, we build a small remotely-operated vehicle (ROV). This repository is EER's 2026 software package.

This code repository contains code for EER's current ROV, Bluestar.

## Table of Contents

- [Repository Structure](#repository-structure)
- [ros_workspace](#ros_workspace)
- [firmware](#firmware)
- [How To Contribute](#how_to_contribute)

## Repository Structure

### ros_workspace
This project uses ROS2 Jazzy.

#### ROS2 Packages
| Package Name | Description |
|----------------------|-----------------------------------------------------------------------------|
| **bluestar_backend** | Backend code for interfacing with Bluestar (both physical ROV and simulation) |
| **config_manager** | Stores user and ROV configuration/preferences in JSON format |
| **eer_interfaces** | Custom ROS2 interfaces used by EER. |
| **waterwitch_frotnend** | A C++ GUI for Bluestar made with ImGui |

More details [here](./ros_workspace/)

### firmware
This folder contains the firmware that runs onboard Bluestar on an RP2040 microcontroller, which communicates with topsides via RS-485.

More details [here](./firmware/).

PCB schematics can be found in the [Electrical_2026 Repository](https://github.com/EasternEdgeRobotics/Electrical_2026).

### Agentic AI Tools

Agentic AI tools, such as the Github Copilot Extension, should automatically use the [copilot-instructions.md](./.github/copilot-instructions.md) file for context. This file contains useful technical information for onboarding in natural language.

34 changes: 34 additions & 0 deletions compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
services:
bluestar_backend:
build:
context: ./ros_workspace
dockerfile: Dockerfile
tty: true
container_name: bluestar_backend
restart: always
ipc: host # Required for ros2 communication with host network
privileged: true # Required for access to the USB-to-Serial adapter for UART
volumes:
- /dev:/dev # Required for access to the USB-to-Serial adapter for UART (ttyUSB0)
- ./configs:/app/configs
- ~/.ssh/:/root/.ssh
entrypoint: ["/bin/bash", "/app/docker_backend_entry_script.sh"]
bluestar_frontend:
build:
context: ./ros_workspace
dockerfile: Dockerfile
tty: true
container_name: bluestar_frontend
ipc: host
environment:
- DISPLAY=:99
- VNC_PORT=5900
- VNC_RESOLUTION=1280x720x24
- XDG_RUNTIME_DIR=/tmp/xdg
ports:
- "5900:5900"
volumes:
- ./configs:/app/configs
entrypoint: ["/bin/bash", "/app/docker_frontend_entry_script.sh"]


1 change: 1 addition & 0 deletions firmware/LapisLazuli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
43 changes: 43 additions & 0 deletions firmware/LapisLazuli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.13)

include("${CMAKE_CURRENT_LIST_DIR}/pico-sdk/pico_sdk_init.cmake")

project(LapisLazuli C CXX ASM)

pico_sdk_init()

# LED Pins have different positions on the Pico v.s. LapisLazuli (tooling board)
if(NOT DEFINED ENV{LapisLazuli})
set(ENV{LapisLazuli} "1") # Set the default value only if not set externally
endif()
add_compile_definitions(LAPIS_LAZULI=$ENV{LapisLazuli})

add_executable(LapisLazuli
minihdlc/minihdlc.c
main.c )

pico_set_program_name(LapisLazuli "LapisLazuli")
pico_set_program_version(LapisLazuli "0.1")

pico_enable_stdio_usb(LapisLazuli 1)
pico_enable_stdio_uart(LapisLazuli 0)

target_link_libraries(LapisLazuli
pico_stdlib
hardware_i2c
pico_i2c_slave
hardware_pwm
pico_multicore
)

target_include_directories(LapisLazuli PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/..
${CMAKE_CURRENT_LIST_DIR}/minihdlc
)

target_link_libraries(LapisLazuli
hardware_i2c
)

pico_add_extra_outputs(LapisLazuli)
Loading