Skip to content

feat(sim): split sim container into gazebo + robot - #14

Merged
bkearns merged 1 commit into
mainfrom
feat/split-gazebo-robot
May 5, 2026
Merged

feat(sim): split sim container into gazebo + robot#14
bkearns merged 1 commit into
mainfrom
feat/split-gazebo-robot

Conversation

@bkearns

@bkearns bkearns commented May 5, 2026

Copy link
Copy Markdown
Contributor

Pulls the simulator into its own service. The robot's always-on ROS infrastructure (bridge_node + sim_battery) moves into a sibling robot service. The OTA-swappable robot software (sim/controllers/* from PR #7) is unchanged.

Three services

gazebo  - ign gazebo + ros_gz_bridge + Xvfb/x11vnc/noVNC GUI stack.
          Subscribes to /cmd_vel on ROS DDS and forwards to the gz
          diff_drive plugin. Now also bridges /perseverance/contacts
          (groundwork for the Temporal collision-response workflow).
robot   - bridge_node (rclpy → gRPC on TCP 50051) + sim_battery.
agent   - unchanged. BRIDGE_ADDR moves from unix:///run/bridge/...
          to TCP robot:50051 over the lab network.
          BROKER_URL stays on tcp://mqtt:1883.

Other changes

  • bridge_node/server.py: new --listen flag accepting either bare host:port (TCP) or unix://path. --socket retained for back-compat.
  • moon.sdf: a 0.9 m boulder at x=8 directly in the rover's forward path.
  • perseverance/model.sdf: the body deck has a bumper contact sensor tied to the gz-sim contact system. Emits ignition.msgs.Contacts on /perseverance/contacts when it touches anything.
  • docker/sim/ removed; replaced by docker/gazebo/ + docker/robot/. Worlds + models live under docker/gazebo/.

Verified locally

robot:  bridge listening on 0.0.0.0:50051
agent:  bridge connected addr=robot:50051
        mqtt connected broker=tcp://mqtt:1883
        ota executor subscribed cmd/sim-robot-01/ota
gazebo: ros_gz_bridge: 6 bidirectional bridges including
        /perseverance/contacts ↔ ignition.msgs.Contacts

Pre-push hook ran the full CI smoke; all checks passed.

Follow-up (separate PR)

  • Robot container collision_publisher → MQTT /events/{robot_id}/collision
  • Robot container twist_subscriber: MQTT /cmd/{robot_id}/twist → ROS /cmd_vel
  • Cloud Temporal CollisionResponse workflow
  • MQTT-to-Temporal-signal bridge for collision events

Pulls the simulator out of the bundled "sim" container into its own
service. The robot's always-on ROS infrastructure (bridge_node +
sim_battery) moves into a sibling "robot" service. The OTA-swappable
robot software (sim/controllers/*) is unchanged — those images still
run as agent-managed containers on the lab network.

Three services, all on the same lab network and ROS DDS domain
(ROS_DOMAIN_ID=42, RMW=cyclonedds):

  gazebo  - ign gazebo + ros_gz_bridge + Xvfb/x11vnc/noVNC GUI
            stack. Subscribes to /cmd_vel on ROS DDS and forwards
            to the gz diff_drive plugin. Now also bridges
            /perseverance/contacts so collision events are visible
            ROS-side (groundwork for the Temporal collision-response
            workflow).
  robot   - bridge_node (rclpy → gRPC) + sim_battery. The agent's
            persistent peer.
  agent   - unchanged otherwise. BRIDGE_ADDR moves from a Unix
            socket on a shared volume to TCP `robot:50051` over
            the lab network. BROKER_URL stays on tcp://mqtt:1883
            (lab broker, port 14883 host-side).

bridge_node/server.py: new --listen flag accepting either bare
host:port (TCP) or unix://path. --socket retained for back-compat.

moon.sdf: a 0.9 m boulder at x=8 directly in the rover's forward
path. Rover deck has a contact sensor (`bumper`) tied to the
gz-sim contact system; it emits Contacts messages on
/perseverance/contacts whenever the deck collides.

docker/sim/ removed; replaced by docker/gazebo/ + docker/robot/.
Worlds + models live under docker/gazebo/ now.

Verified locally on Apple Silicon + podman:
- gazebo, robot, agent all Up
- robot: "bridge listening on 0.0.0.0:50051"
- agent: "bridge connected addr=robot:50051"
- ros_gz_bridge: 6 bidirectional bridges including
  /perseverance/contacts ↔ ignition.msgs.Contacts
- Lab MQTT, Postgres, Temporal, Registry all healthy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant