fix(isaac-sim): pegasus drone retains PX4 state across Stop/Play#363
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Isaac Sim Pegasus integration to prevent PX4 and rotor-state from persisting across Isaac Sim Stop/Play cycles by bumping the PegasusSimulator submodule, and increments the AirStack release version to reflect the fix.
Changes:
- Bump
simulation/isaac-sim/extensions/PegasusSimulatorsubmodule to include Stop/Play reset fixes (PX4 process-group teardown, rotor speed state reset, and callback lifecycle adjustments). - Bump
.envVERSIONfrom0.19.0-alpha.1to0.19.0-alpha.2.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.env |
Increments the project version to 0.19.0-alpha.2 to reflect the Isaac Sim Stop/Play bug fix release. |
simulation/isaac-sim/extensions/PegasusSimulator (submodule) |
Advances the PegasusSimulator integration to a commit that resets PX4/rotor/callback state cleanly across Stop/Play. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What features did you add and/or bugs did you address?
Bumps the
PegasusSimulatorsubmodule tofe8b5a10, which fixes a bug where pressing Stop and then Play in Isaac Sim caused the drone's props to spin and veer off toward its previous PX4 setpoint instead of resetting cleanly.No AirStack-side code changes — just a submodule pointer update and a version bump.
How did you implement it?
All fixes live in the submodule commit. Summary of what changed there:
PX4 was not actually killed on Stop.
Popen.kill()only targeted the parent and neverwait()ed, so helper threads/children survived and kept talking to the simulator on the next Play. PX4 is now launched withstart_new_session=Trueand the whole process group is killed viaSIGTERM -> wait -> SIGKILL -> waitinkill_px4().Leaked physics callbacks reapplied stale rotor speeds. After Stop, callbacks could still read the backend's last commanded rotor speeds and apply them as thrust.
_rotor_datais now zeroed onbackend.stop(), andbackend.update()early-returns when not running / no connection, so any stale callback applies zero thrust.Tearing down and rebuilding the multirotor caused
[simulator_mavlink] poll timeouton the second Play. Isaac'sadd_physics_callbackdoes not reliably overwrite an existing key, so the new multirotor's sensor callbacks failed to register and PX4 never received HIL_SENSOR. The multirotor and its physics callbacks are now kept alive across Stop/Play cycles; the per-vehiclesim_start_stopcallback drivesbackend.start()/stop()(which relaunches a clean PX4 process each Play).See the submodule commit message for the full rationale.
How do you run and use it?
Then in the Isaac Sim UI:
Before this fix: props spin immediately and the drone drifts toward the previous setpoint; PX4 logs may show
[simulator_mavlink] poll timeout.After this fix: drone sits idle with zero thrust, PX4 reconnects cleanly, and behavior is identical to the first Play.
Testing with PyTest
No new pytests added — this is a submodule pointer bump for a UI-driven Stop/Play interaction that the current
tests/harness does not exercise (the takeoff/hover/land test runs a single Play cycle).Existing relevant suites should continue to pass:
Expected: same pass/fail status as develop.
Documentation
Versioning
Bumped
.envVERSIONfrom0.19.0-alpha.1to0.19.0-alpha.2(bug fix on the current alpha line per the template).