feat(sim): drivable Perseverance + auto-run + cmd_vel helpers - #12
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #11 — that PR landed the static Perseverance + moon world; this one makes the rover actually drive.
What was wrong
<static>true</static>— visible but couldn't move.ign gazebowithout-rrequires a Play click before any commands have effect. Even with a drivable model, nothing would move on a freshmake sim-up./cmd_velplumbing for the moon world (the existingros_gz_bridgecase-statement only handled the diff_drive demo).What this PR does
docker/sim/models/perseverance/model.sdf— drop<static>, restructure: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_bridgecase formoon.sdfwires/cmd_vel↔/model/perseverance/cmd_veland the matching odometry topics.Makefile— host-side helpers, no ROS install required:Verified locally
DiffDrive subscribing to twist messages on /model/perseverance/cmd_velin logsros_gz_bridgecreated bidirectional bridges for cmd_vel + odometryTest plan