IMU jetzt sauber als ROS Node eingebunden
This commit is contained in:
@@ -45,6 +45,8 @@ f710_joy_node ──────────────────────
|
||||
/rover_command ──► robot_node ──► /motor_commands ──► motor_node ──► PCA9685 PWM ──► Motoren
|
||||
```
|
||||
|
||||
Zusätzlich ist ein BNO085-IMU-Sensor auf I2C-Bus `1` mit Adresse `0x4A` angebunden. Er läuft als eigener Python-3-Service auf dem Pi (`exomy-imu-ros.service`), publiziert über `rosbridge` nach ROS und wird von der Admin-API wieder aus ROS gelesen.
|
||||
|
||||
**Software auf dem Pi:** `/home/pi/ExoMy_Software/`
|
||||
**ROS-Workspace im Container:** `/root/exomy_ws/src/exomy/`
|
||||
|
||||
@@ -56,6 +58,7 @@ f710_joy_node ──────────────────────
|
||||
|---|---|
|
||||
| `exomy-admin-api.service` | Admin-API (`exomy_admin_api.py`) |
|
||||
| `exomy-camera-stream.service` | MJPEG Kamera-Stream |
|
||||
| `exomy-imu-ros.service` | Liest den BNO085 per Python 3 auf dem Pi und publiziert IMU-Daten nach ROS |
|
||||
| `exomy-wifi-bootstrap.service` | Wählt beim Start `4pi` oder `eskimue.de`, sonst eigener Access Point |
|
||||
|
||||
### WLAN-Startlogik
|
||||
@@ -102,6 +105,24 @@ docker exec -it exomy_autostart bash
|
||||
| `rosbridge_websocket` | WebSocket-Bridge für die Web-GUI (Port 9090) |
|
||||
| `rosapi_node` | ROS-API für die Web-GUI |
|
||||
|
||||
### IMU: BNO085
|
||||
|
||||
- Sensor: Adafruit BNO085 Breakout
|
||||
- Bus: I2C `1`
|
||||
- Adresse: `0x4A`
|
||||
- Standardrate: `15 Hz`
|
||||
- Der IMU-Sensor läuft nicht im ROS-Melodic-Container, sondern als eigener Python-3-Systemd-Service auf dem Pi.
|
||||
- Grund: Der restliche ROS-Stack im Container nutzt noch überwiegend Python 2, der BNO085-Treiber benötigt aber Python 3.
|
||||
- Der Service `exomy-imu-ros.service` liest den Sensor und publiziert über `rosbridge` nach ROS.
|
||||
|
||||
### IMU-Topics
|
||||
|
||||
| Topic | Typ | Inhalt |
|
||||
|---|---|---|
|
||||
| `/imu/data` | `sensor_msgs/Imu` | Quaternion, Gyro und lineare Beschleunigung |
|
||||
| `/imu/mag` | `sensor_msgs/MagneticField` | Magnetfeld |
|
||||
| `/imu/status` | `std_msgs/String` | Statusmeldung des IMU-Dienstes |
|
||||
|
||||
### Admin-Funktionen
|
||||
|
||||
- Admin-Seite: `http://<IP>:8000/admin.html`
|
||||
@@ -114,6 +135,16 @@ docker exec -it exomy_autostart bash
|
||||
- `GPS neu starten`
|
||||
- `GPS-Kaltstart` für den GlobalSat `BU-353N5`
|
||||
|
||||
IMU in der Admin-Seite:
|
||||
|
||||
- Status
|
||||
- Adresse
|
||||
- Beschleunigung
|
||||
- Gyro
|
||||
- Magnetfeld
|
||||
- Quaternion
|
||||
- `Roll / Pitch / Yaw`
|
||||
|
||||
### Ports
|
||||
|
||||
| Port | Verwendung |
|
||||
@@ -149,6 +180,34 @@ ssh pi@192.168.1.9 "docker cp /home/pi/ExoMy_Software/gui/index.html exomy_autos
|
||||
# Kein Neustart nötig — Browser-Reload genügt
|
||||
```
|
||||
|
||||
IMU-/Admin-API-Änderungen:
|
||||
|
||||
```bash
|
||||
# Python-Datei auf den Pi kopieren
|
||||
scp src/imu_node.py pi@192.168.1.9:/home/pi/ExoMy_Software/src/
|
||||
scp scripts/exomy_admin_api.py pi@192.168.1.9:/home/pi/ExoMy_Software/scripts/
|
||||
scp scripts/exomy-imu-ros.service pi@192.168.1.9:/home/pi/ExoMy_Software/scripts/
|
||||
|
||||
# Admin-API neu starten
|
||||
ssh pi@192.168.1.9 "sudo systemctl restart exomy-admin-api.service"
|
||||
|
||||
# IMU-ROS-Service aktualisieren/neu starten
|
||||
ssh pi@192.168.1.9 "sudo cp /home/pi/ExoMy_Software/scripts/exomy-imu-ros.service /etc/systemd/system/exomy-imu-ros.service && sudo systemctl daemon-reload && sudo systemctl restart exomy-imu-ros.service"
|
||||
```
|
||||
|
||||
Wichtige Checks:
|
||||
|
||||
```bash
|
||||
# IMU-Service auf dem Pi
|
||||
systemctl status exomy-imu-ros.service
|
||||
|
||||
# IMU-Topics im Container
|
||||
docker exec exomy_autostart bash -lc "source /opt/ros/melodic/setup.bash && rostopic list | grep ^/imu"
|
||||
|
||||
# Beispielstatus
|
||||
docker exec exomy_autostart bash -lc "source /opt/ros/melodic/setup.bash && rostopic echo -n 1 /imu/status"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Bekannte Probleme & Fixes
|
||||
|
||||
Reference in New Issue
Block a user