Skip to content

feat(sim): drivable Perseverance + auto-run + cmd_vel helpers - #12

Merged
bkearns merged 1 commit into
mainfrom
feat/sim-rover-drive
May 5, 2026
Merged

feat(sim): drivable Perseverance + auto-run + cmd_vel helpers#12
bkearns merged 1 commit into
mainfrom
feat/sim-rover-drive

Conversation

@bkearns

@bkearns bkearns commented May 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #11 — that PR landed the static Perseverance + moon world; this one makes the rover actually drive.

What was wrong

  • Perseverance was <static>true</static> — visible but couldn't move.
  • Ignition Fortress opens paused by default; ign gazebo without -r requires a Play click before any commands have effect. Even with a drivable model, nothing would move on a fresh make sim-up.
  • No /cmd_vel plumbing for the moon world (the existing ros_gz_bridge case-statement only handled the diff_drive demo).

What this PR does

docker/sim/models/perseverance/model.sdf — drop <static>, restructure:

  • Body link with mass 700 kg + inertia carries deck, RTG, mast, arm, rocker rails as visuals.
  • Six wheel links (fl/ml/rl/fr/mr/rr) with collisions, inertials (m=30 kg, r=0.26 m, w=0.20 m), inner-pose-rotated cylinders so the link frame stays upright.
  • Six revolute joints (axis 0 1 0 in child frame) connect each wheel to body.
  • DiffDrive plugin (ignition-gazebo-diff-drive-system) with all three left + three right joints, wheel_separation 2.40, wheel_radius 0.26, topic /model/perseverance/cmd_vel.

docker/sim/entrypoint.sh:

  • ign gazebo -r -v 4 — auto-run, no Play click required.
  • ros_gz_bridge case for moon.sdf wires /cmd_vel/model/perseverance/cmd_vel and the matching odometry topics.

Makefile — host-side helpers, no ROS install required:

make sim-drive-fwd LX=0.5    # default 0.5 m/s
make sim-drive-back
make sim-drive-left          # spin in place
make sim-drive-right
make sim-drive-stop

Verified locally

  • Build green
  • Sim Up; DiffDrive subscribing to twist messages on /model/perseverance/cmd_vel in logs
  • ros_gz_bridge created bidirectional bridges for cmd_vel + odometry
  • Live-unpaused the previously-paused sim and observed the rover translate in the noVNC view

Test plan

  • make sim-up local; rover visible
  • make sim-drive-fwd; rover moves forward
  • CI green on go-cloud, go-agent, bridge-lint, installer-smoke

User reported nothing was moving. Two real causes plus a usability
gap:

1. Perseverance was <static>true</static> — visible but unable to
   move. Restructure the model:
   - Body link with mass/inertia carries deck, RTG, mast, arm,
     and rocker rails as visuals.
   - Six wheel links (fl/ml/rl/fr/mr/rr) with collisions, inertials,
     and inner-pose-rotated cylinders so the link frame stays
     upright and the joint axis is clean.
   - Six revolute joints (axis 0 1 0 in the child frame) connect
     each wheel to body.
   - DiffDrive plugin (ignition-gazebo-diff-drive-system) lists all
     three left + three right joints, wheel_separation 2.40,
     wheel_radius 0.26, listens on /model/perseverance/cmd_vel.

2. Ignition Fortress opens paused by default. `ign gazebo` without
   `-r` requires the user to click Play before commands take
   effect. Add `-r` to the entrypoint so the world auto-runs.

3. ros_gz_bridge now wires /cmd_vel ↔ /model/perseverance/cmd_vel
   (and the matching odometry topics) for the moon.sdf world, so
   ROS-side controllers can drive the rover too.

4. New Make helpers — no ROS install needed on the host:
     make sim-drive-fwd     LX=0.5 (default) m/s
     make sim-drive-back
     make sim-drive-left    spin
     make sim-drive-right
     make sim-drive-stop
   Each shells `ign topic` inside the sim container.

Verified locally: DiffDrive subscribed to
/model/perseverance/cmd_vel; ros_gz_bridge created bidirectional
bridges; world unpause via /world/moon/control returns data: true;
cmd_vel publish accepted.
@bkearns
bkearns merged commit db1b3ea into main May 5, 2026
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