pip install ai-teammate-ros2-bridge==2.6.80 Copy PIP instructions
Connects ROS2 robots to the AI Teammate platform via WebSocket + MQTT.
curl -sL "https://ai-teammate.net/api/b2b/install/MY-ROBOT-01?key=YOUR_API_KEY" | bash This single command will:
Get your API key from Control Tower > Devices > + button.
curl -sL "..." | bash -s -- --proxy=http://proxy:8080 Step 3. Verify Installation # Check service status systemctl --user status ai-teammate-bridge # Watch live logs tail -f ~/ai-teammate-bridge/bridge.log # Review detected config cat ~/ai-teammate-bridge/.env cat ~/ai-teammate-bridge/sensors.yaml Step 4. Verify in Control Tower Open Control Tower > Devices tab Robot should show as connected with green indicator Click the robot > Health section should show IMU, odom, lidar as OK SLAM tab should display sensor data Troubleshooting Symptom Cause Fix sensor: no data (never received) Topic name mismatch Run ros2 topic list to find actual names, update ~/ai-teammate-bridge/.env, then systemctl --user restart ai-teammate-bridge SHUTDOWN/REBOOT not working Missing sudoers echo "$USER ALL=(ALL) NOPASSWD: /usr/sbin/shutdown, /usr/sbin/reboot" | sudo tee /etc/sudoers.d/ai-teammate-bridge && sudo chmod 440 /etc/sudoers.d/ai-teammate-bridge Bridge not starting after reboot Linger not enabled loginctl enable-linger $USER WS connection failed Firewall/proxy Test with curl https://ai-teammate.net/api/health, use --proxy flag if needed ros2: command not found in service ROS2 env not sourced Ensure /etc/env.sh exists and sources ROS2 setup, or add source /opt/ros/humble/setup.bash to service ExecStart Manual Topic Override If auto-detection picks the wrong topic:
# Check what's actually publishing ros2 topic list | grep -E 'odom|imu|scan|cmd_vel' # Edit .env vi ~/ai-teammate-bridge/.env # Example: ODOM_TOPIC=/base_controller/odom # Restart systemctl --user restart ai-teammate-bridge Common non-standard topic names:
pip3 install ai-teammate-ros2-bridge Configuration mkdir -p ~/ai-teammate-bridge && cd ~/ai-teammate-bridge ai-teammate-bridge init # → Creates .env with interactive prompts # Or manually: cat > .env MQTT_PASS= EOF Run # Source ROS2 environment first source /opt/ros/humble/setup.bash ai-teammate-bridge Environment Variables Variable Default Description DEVICE_ID required Unique device identifier GATEWAY_URL required Device Gateway WebSocket URL API_KEY required Device API key (dk_xxx) CONNECTION_MODE rclpy rclpy for ROS2, simulator for testing STATUS_REPORT_INTERVAL 1.0 Sensor update interval (seconds) CMD_VEL_TOPIC /cmd_vel ROS2 velocity command topic IMU_TOPIC /imu/data IMU subscription topic ODOM_TOPIC /odom Odometry subscription topic SCAN_TOPIC /scan LiDAR scan topic MQTT_BROKER (empty=disabled) MQTT broker hostname MQTT_PORT 1883 MQTT broker port MQTT_USER robot_bridge MQTT username MQTT_PASS (empty) MQTT password MQTT_TRANSPORT tcp tcp or websockets MQTT_TLS (off) 1 to wrap the connection in TLS MQTT_WS_PATH /mqtt WebSocket path (only for websockets) COORD_ENABLED (off) 1/true/yes/on to obey fleet coordination hold leases COORD_DEGRADED_SPEED 0.15 Forward cap (m/s) while no valid lease is held FLEET_TENANT (empty) Tenant namespace for the coordination topic — not the same as FLEET_ID, see below FLEET_ID (from gateway) Fleet id for the broadcast e-stop topic — not the same as FLEET_TENANT, see below MAP_INSTALL_ROOT ~/maps/installed Where MAP_INSTALL keeps installed map versions, the current/previous pointers and the receipt journal. Commands cannot override it MAP_INSTALL_ALLOWED_HOST_SUFFIXES (empty = any https host) Comma-separated host suffixes the map bundle may be downloaded from (e.g. .amazonaws.com). IP-literal hosts, localhost, non-https and redirects are always refused ROBOT_SERIAL (empty) Robot serial number — required for ai-teammate-bridge qr (the server's registration request needs it) ROBOT_NAME (hostname) Display name shown in the app's robot list (QR and LAN discovery) ROBOT_MODEL (empty) Robot model, put in the QR only ROBOT_MANUFACTURER (empty) Manufacturer, put in the QR only BRIDGE_DISCOVERY (on) 0 to stop advertising _mobio-robot._tcp over mDNS 로봇 QR 만들기 (공용 앱 등록) 공용 lite 앱은 로봇 QR 을 찍어 서버에 등록 요청을 보내고, 등록된 로봇은 같은 와이파이에서 mDNS(_mobio-robot._tcp.local.)로 자동으로 찾습니다.
# .env 에 ROBOT_SERIAL(필수)·ROBOT_NAME·ROBOT_MODEL·ROBOT_MANUFACTURER 를 넣은 뒤 ai-teammate-bridge qr # 터미널에 QR 출력 ai-teammate-bridge qr --png robot.png # 라벨용 PNG 도 저장 ai-teammate-bridge qr --host 192.168.0.12 # 주소 자동 선택이 틀릴 때 QR 형식: mobio-robot://register?v=1&id=&name=&serial=&model=&mfr=&host=&port= — 공개 정보만. API_KEY·BRIDGE_LAN_TOKEN·relay 토큰은 QR 에 들어가지 않습니다. BRIDGE_LAN_TOKEN 을 쓰는 로봇은 토큰을 앱에 따로 입력해야 연결됩니다(명령이 안내합니다). mDNS 응답에는 robot_id·표시 이름만 담기고 사설 IPv4 만 광고합니다(docker 172.17.0.0/16 제외). 실패해도 브리지 기동에는 영향이 없고, BRIDGE_DISCOVERY=0 으로 끌 수 있습니다. Fleet coordination (교차로 hold lease) Off by default. When COORD_ENABLED is on, the bridge subscribes to fleet/ /coordination/hold/ and turns the leases it receives into one forward-speed cap, applied both in-process and in the Nav2 cmd_vel relay.
This is traffic management, not safety — the edge hard-stop (safety.py) runs after it and is never weakened by it. Three states: a live clear lease uncaps, a live hold lease stops the robot, and no valid lease means COORD_DEGRADED_SPEED — "if you don't know, go slow". That fallback is deliberately not a full stop, so a dead cloud cannot brick the fleet; values of 0 or below are rejected at startup (logged, replaced by the default).
FLEET_TENANT must match what the coordination service publishes under, or the robot never receives its leases and stays capped at the degraded speed.
FLEET_TENANT and FLEET_ID are different identifiers. They look alike, they both namespace a fleet/... topic, and setting one to the other's value fails in a way that is hard to trace:
They also default differently. FLEET_ID falls back to the gateway-supplied project_id/fleet_id (ws_client._subscribe_fleet_topic), so it usually works without being set — which is exactly why someone reaches for that same value when filling in FLEET_TENANT. FLEET_TENANT has no fallback: unset means the legacy un-namespaced topic, and any non-matching value means silence. Coordination silence is never read as permission (that is the point of the degraded fallback), so the symptom is a fleet that mysteriously crawls, not one that errors.
Release ordering — bridge before skills. Robots update the skills package by extracting a .so tarball straight into site-packages, which bypasses pip entirely, so the bridge floor declared in ai-teammate-ros2-skills' pyproject.toml is not enforced on the robot. A skills build that imports a symbol this bridge lacks fails at import, and the failure disables every skill command, not just the new one. So: publish and roll out the bridge first, confirm robots picked it up, and only then publish skills. The auto-updater enforces the same order per cycle (_defer_skills_update), and skills carries a fallback for the coordination import specifically, but neither removes the need to ship in this order.
Raw TCP MQTT cannot be proxied by a CDN, so a broker that sits behind one is only reachable over wss on 443. Point the bridge at it like this — the robot then needs a single outbound 443, which most site firewalls already allow:
MQTT_BROKER=mqtt.example.com MQTT_PORT=443 MQTT_TRANSPORT=websockets MQTT_TLS=1 The default stays plain TCP on 1883, so bridges already in the field keep working until their env is changed.
Robot Cloud (ai-teammate.net) ┌──────────────────────┐ ┌─────────────────────┐ │ ai-teammate-bridge │ │ Device Gateway │ �� (CLI entry point) │ │ (port 8003) │ │ │ │ │ │ ���────────────────┐ │ WSS │ /ws/{device_id} │ │ │ ws_client.py │──┼────────▶│ commands ◀────── │──▶ Control Tower │ │ DeviceBridge │◀─┼────────│ responses │ │ └────────────────┘ │ │ │ │ │ MQTT │ Mosquitto (1883) │ │ ┌────────────────┐ │────────▶│ telemetry │ │ │ MQTT publisher │ │ │ position │ │ └────────────────┘ │ │ health │ │ │ └─────────────────────┘ │ ┌────────────────┐ │ │ │ ros2_node.py │ │ ROS2 DDS (no rosbridge) │ │ ├─ cmd_vel pub│ │ │ │ ├─ IMU sub │ │ │ │ ├─ odom sub │ │ │ │ ├─ scan sub │ │ │ │ ├─ camera sub │ │ on-demand (auto-stop 30s) │ │ └─ TF listener│ │ map→base_footprint (5Hz) │ └────────────────┘ │ │ │ │ ┌────────────────┐ │ │ │ Skills (opt) │ │ ai-teammate-ros2-skills │ │ 54+ commands │ │ (pre-built .so binary) │ └────────────────┘ │ └──────────────────────┘ Communication Channels Channel Data Direction Frequency WebSocket Commands, responses Bidirectional On-demand WebSocket Camera frames Robot → Cloud 2-5 FPS (on-demand) WebSocket SLAM map + trajectory Robot → Cloud Every 5s during mapping MQTT Telemetry (IMU, battery) Robot → Cloud 1 Hz MQTT Position (x, y, theta) Robot → Cloud 1 Hz (retained) MQTT Health alerts Robot → Cloud On-event (retained) Package Structure ai_teammate_ros2_bridge/ ├── cli.py # Entry point: ai-teammate-bridge command ├── config.py # Shared state (_ros2_cache), env loading, MQTT config ├── ws_client.py # DeviceBridge class, WS + MQTT event loop, health checks ├── device_bridge.py # Command handlers (SLAM, camera, nav, fingerprint, etc.) ├── ros2_node.py # rclpy spin thread, ROS2 subscriptions, TF listener ├── sensors.py # Sensor data aggregation, battery fallback ├── sensors_config.py # Hardware abstraction (sensors.yaml) ├── lan_server.py # LAN WebSocket server for local clients └── utils.py # Input sanitization helpers Systemd Service The install script creates a systemd service automatically. For user-level services, the unit uses After=basic.target (not network-online.target, which is unavailable in user scope).
# System-level (if sudo available) sudo systemctl status ai-teammate-bridge sudo systemctl restart ai-teammate-bridge sudo journalctl -u ai-teammate-bridge -f # User-level (no sudo, with loginctl enable-linger) systemctl --user status ai-teammate-bridge systemctl --user restart ai-teammate-bridge Command Dispatch Commands from the cloud are dispatched in two tiers:
During SLAM mapping, the bridge automatically:
MAP_INSTALL downloads the bundle from the signed https URL, verifies its SHA-256 against the installation target, unpacks it into ~/maps/installed/versions/ /, and atomically switches the current pointer. It refuses to run while Nav2 is active. Every attempt that starts ends with exactly one receipt, posted to the gateway with the device API key (the gateway signs it for map-api); undelivered receipts are journaled and retried across restarts. NAV2_START without a map parameter picks whichever map action happened last — the installed map (time of the current pointer) or the newest .yaml saved under ~/maps (e.g. by SLAM_SAVE); ties go to the installed map — and reports what it picked in map / map_source.
Re-issuing MAP_INSTALL for the installation that is already running answers state: running with the same attempt_id (the phone's retry does not start a second attempt); a different installation while one is running is refused with install_busy. A request is also refused before any attempt starts — so without a receipt — when the bundle is not mobio-ros-map-bundle-v1 (unsupported_format), when byte_length is above the 256 MiB cap (bundle_too_large), when the manifest checksum differs from the installation target (target_mismatch), when the signed URL is not an acceptable https address (url_rejected) or has already expired (url_expired), when the installation targets another robot (wrong_device), or while Nav2 is running (nav2_active).
The install only switches the pointer — relocalization is not measured, so receipts always carry relocalization_result: "not_attempted".
The bridge installs no SIGTERM handler, so a restart during an install — including one triggered by UPDATE_BRIDGE or the auto-updater — kills the attempt where it stands. The next boot closes it from the journal as interrupted (or as installed, if the current pointer had already been switched) and sends that receipt. Nothing is left half-installed, but the map is not installed either: re-issue the command.
Camera subscriptions are created on-demand and auto-stop after 30s of inactivity to save CPU (~10% reduction). Camera health is excluded from the all_ok flag and alert system — it only reports status when actively streaming.
Capture flow: start_camera() is always called first, then a 10s wait for a fresh frame before capturing.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




