Skip to content

Commit ead4398

Browse files
committed
Couple of changes
1 parent 44d9284 commit ead4398

4 files changed

Lines changed: 58 additions & 87 deletions

File tree

Makefile

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
REMOTE=omdev.local
22
ARTIFACT=build/firmware.elf
33
REMOTE_ARTIFACT=/tmp/firmware.elf
4-
MICRO_ROS_AGENT_IMAGE=omros2firmware:microros
4+
MICRO_ROS_AGENT_IMAGE=ghcr.io/jkaflik/omros2-firmware:micro-ros
55
MICRO_ROS_DEVICE=/dev/ttyAMA0
66

77
PHONY: upload
@@ -12,22 +12,10 @@ upload:
1212

1313
PHONY: debug
1414
debug:
15-
@ssh $(REMOTE) bash -s debug < ./utils/remote-openocd.sh
15+
@ssh -t $(REMOTE) bash -s debug < ./utils/remote-openocd.sh
1616

1717
agent:
18-
@docker run --rm -it \
19-
-v /dev:/dev \
20-
-e "SERIAL_DEVICE=$(MICRO_ROS_DEVICE)"
21-
--network host \
22-
--name micro-ros-agent \
23-
$(MICRO_ROS_AGENT_IMAGE)
18+
@./utils/run-micro-ros-agent.sh
2419

2520
agent_remote:
26-
@./utils/remote-forward-agent-tcp.sh \
27-
$(REMOTE) \
28-
$(MICRO_ROS_DEVICE) \
29-
38123 \
30-
docker run --rm -it \
31-
--name micro-ros-agent \
32-
$(MICRO_ROS_AGENT_IMAGE) \
33-
tcp4 $(REMOTE) --port 38123
21+
@ssh -t $(REMOTE) bash -s $(MICRO_ROS_DEVICE) < ./utils/run-micro-ros-agent.sh

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,29 @@ More details about this firmware can be found in [documentation](https://jkaflik
88
## Features
99

1010
- [x] ROS2 node using Micro-ROS
11+
- [x] Auto-reconnect
12+
- [ ] Power-related publishers
13+
- [ ] IMU publisher
1114
- [x] Charging
1215
- [x] LED status
1316
- [x] IMU
1417
- [ ] Emergency mode
1518

19+
## Usage
20+
21+
### LED Status Indicators
22+
23+
The firmware uses onboard NeoPixel LED(s) to display the current system status. Multiple status conditions can be active simultaneously and will be displayed in sequence.
24+
25+
**LED Status Colors:**
26+
- **Green**: ROS connected
27+
- **Yellow**: Battery charging
28+
- **Magenta**: Battery discharging
29+
- **Red**: Battery low
30+
- **Blue**: IMU sensor failure
31+
32+
When multiple statuses are active, each status will be shown for approximately 800ms with a 200ms black separator between them. The sequence will continue to cycle through all active statuses.
33+
1634
## Build
1735

1836
### Prepare environment
@@ -44,3 +62,17 @@ platformio run -t upload
4462

4563
Use your IDE integration to debug the code. You can use `pio debug` command as well.
4664
This will run the same bash script as in the upload command, but it will not upload the firmware. You can use `pio debug -t upload` to upload the firmware and start debugging.
65+
66+
## Micro-ROS agent for testing
67+
68+
You can use the Micro-ROS agent container to test the firmware. To run it a remote RaspberryPi device run the following command:
69+
70+
```bash
71+
make agent_remote
72+
```
73+
74+
If you have an access to the Pico's UART0 directly on your host machine run:
75+
76+
```bash
77+
make agent MICRO_ROS_DEVICE=/dev/ttyAMA0
78+
```

utils/remote-forward-agent-tcp.sh

Lines changed: 0 additions & 71 deletions
This file was deleted.

utils/run-micro-ros-agent.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Default device path
4+
DEVICE=${1:-/dev/ttyAMA0}
5+
6+
# Check if docker or podman is available
7+
if command -v podman &>/dev/null; then
8+
CONTAINER_ENGINE="podman"
9+
elif command -v docker &>/dev/null; then
10+
CONTAINER_ENGINE="docker"
11+
else
12+
echo "Error: Neither podman nor docker is installed. Please install one of them."
13+
exit 1
14+
fi
15+
16+
echo "Using $CONTAINER_ENGINE with device $DEVICE"
17+
18+
# Run the container with the specified or default device
19+
sudo $CONTAINER_ENGINE run --rm -it --name micro-ros-agent \
20+
--device $DEVICE \
21+
ghcr.io/jkaflik/omros2-firmware:micro-ros \
22+
serial --dev $DEVICE -b 115200

0 commit comments

Comments
 (0)