| # systemd service for the SONIC composed camera server. | |
| # | |
| # Publishes JPEG-encoded camera frames over ZMQ so the data exporter | |
| # (on the workstation) can subscribe and record. | |
| # | |
| # ββ Setup ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # The install script can generate and install this automatically: | |
| # bash install_scripts/install_camera_server.sh | |
| # | |
| # Or manually: | |
| # 1. Edit USER, HOME, REPO_DIR, and the ExecStart command below. | |
| # 2. Copy to systemd: | |
| # sudo cp systemd/composed_camera_server.service /etc/systemd/system/ | |
| # 3. Enable and start: | |
| # sudo systemctl daemon-reload | |
| # sudo systemctl enable composed_camera_server.service | |
| # sudo systemctl start composed_camera_server.service | |
| # 4. Check status: | |
| # sudo systemctl status composed_camera_server.service | |
| # journalctl -u composed_camera_server.service -f | |
| # | |
| # ββ Finding your device ID βββββββββββββββββββββββββββββββββββββββ | |
| # OAK cameras: | |
| # python -c "import depthai as dai; print(dai.Device.getAllAvailableDevices())" | |
| # RealSense: | |
| # rs-enumerate-devices --short | |
| # USB: | |
| # ls /dev/video* # use the index number, e.g. "0" for /dev/video0 | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| [Unit] | |
| Description=SONIC Composed Camera Server (ZMQ) | |
| After=network.target | |
| [Service] | |
| Type=simple | |
| # ββ EDIT THESE for your robot ββββββββββββββββββββββββββββββββββββ | |
| User=nvidia | |
| Environment="HOME=/home/nvidia" | |
| Environment="REPO_DIR=/home/nvidia/GR00T-WholeBodyControl" | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| WorkingDirectory=${REPO_DIR} | |
| # Edit the ExecStart line to match your camera setup. | |
| # Single ego-view OAK camera (device ID required when multiple OAK devices connected): | |
| ExecStart=${REPO_DIR}/.venv_camera/bin/python -m gear_sonic.camera.composed_camera \ | |
| --ego-view-camera oak \ | |
| --ego-view-device-id YOUR_MXID_HERE \ | |
| --port 5555 | |
| # Multi-camera example (ego + wrist cameras): | |
| # ExecStart=${REPO_DIR}/.venv_camera/bin/python -m gear_sonic.camera.composed_camera \ | |
| # --ego-view-camera oak --ego-view-device-id EGO_MXID \ | |
| # --left-wrist-camera oak --left-wrist-device-id LEFT_MXID \ | |
| # --right-wrist-camera oak --right-wrist-device-id RIGHT_MXID \ | |
| # --port 5555 | |
| Restart=on-failure | |
| RestartSec=5 | |
| StandardOutput=journal | |
| StandardError=journal | |
| [Install] | |
| WantedBy=multi-user.target | |