saltylab-firmware/jetson/systemd/saltybot-here4.service
sl-perception 26e71d7a14 feat: systemd auto-start for ROS2 + dashboard on Orin boot (bd-1hyn)
Implements full boot-time auto-start for the SaltyBot ROS2 stack on
Jetson Orin. Everything comes up automatically after power-on with
correct dependency ordering and restart-on-failure for each service.

New systemd services:
  saltybot-ros2.service         full_stack.launch.py (perception + SLAM + Nav2)
  saltybot-esp32-serial.service ESP32-S3 BALANCE UART bridge (bd-wim1, PR #727)
  saltybot-here4.service        Here4 DroneCAN GPS bridge (bd-p47c, PR #728)
  saltybot-dashboard.service    Web dashboard on port 8080

Updated:
  saltybot.target               now Wants all four new services with
                                boot-order comments
  can-bringup.service           bitrate 500 kbps → 1 Mbps (DroneCAN for Here4)
  70-canable.rules              remove bitrate from udev RUN+=; let service
                                own the bitrate, add TAG+=systemd for device unit
  install_systemd.sh            installs all services + udev rules, colcon
                                build, enables mosquitto, usermod dialout
  full_stack.launch.py          resolve 8 merge conflict markers (ESP32-S3
                                rename) and fix missing indent on
                                enable_mission_logging_arg — file was
                                un-launchable with SyntaxError

New:
  scripts/ros2-launch.sh        sources ROS2 Humble + workspace overlay,
                                then exec ros2 launch — used by all
                                ROS2 service units via ExecStart=
  udev/80-esp32.rules           /dev/esp32-balance (CH343) and
                                /dev/esp32-io (ESP32-S3 native USB CDC)

Resolves bd-1hyn

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:20:40 -04:00

51 lines
1.6 KiB
Desktop File

[Unit]
Description=SaltyBot Here4 GPS DroneCAN Bridge (bd-p47c)
Documentation=https://gitea.vayrette.com/seb/saltylab-firmware/issues/bd-p47c
# Requires package: saltybot_dronecan_gps (merged in bd-p47c → PR #728)
# Requires: can0 at 1 Mbps (set by can-bringup.service)
#
# Publishes:
# /gps/fix NavSatFix 5 Hz → navsat_transform EKF
# /gps/velocity TwistWithCovarianceStamped 5 Hz
# /here4/fix NavSatFix 5 Hz (alias)
# /here4/imu Imu 50 Hz
# /here4/mag MagneticField 10 Hz
# /here4/baro FluidPressure 10 Hz
# /here4/status String JSON 1 Hz (node health, fix quality)
# /here4/node_id Int32 once (auto-discovered DroneCAN ID)
#
# Subscribes:
# /rtcm ByteMultiArray on demand (RTCM corrections)
# /rtcm_hex String on demand (hex fallback)
After=network-online.target can-bringup.service
Requires=can-bringup.service
# If can-bringup stops (CANable2 unplugged), stop this service too
BindsTo=can-bringup.service
[Service]
Type=simple
User=orin
Group=dialout
Environment="ROS_DOMAIN_ID=42"
Environment="ROS_DISTRO=humble"
Environment="SALTYBOT_WS=/opt/saltybot/jetson/ros2_ws/install"
ExecStart=/opt/saltybot/scripts/ros2-launch.sh \
saltybot_dronecan_gps here4.launch.py
Restart=on-failure
RestartSec=5s
StartLimitInterval=60s
StartLimitBurst=5
TimeoutStartSec=30s
TimeoutStopSec=10s
StandardOutput=journal
StandardError=journal
SyslogIdentifier=saltybot-here4
[Install]
WantedBy=saltybot.target