mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-26 17:02:20 +08:00
* gz_plugins: add MovingPlatformController
This plugin moves the entity to which it is attached to simulate moving
platforms (boats, trucks, ...) to takeoff and land on. Updates
Tools/simulation/gz submodule with corresponding dependency. Use with:
PX4_GZ_MODEL_POSE=0,0,2.2,0,0,0 PX4_GZ_WORLD=moving_platform make px4_sitl gz_standard_vtol
more in README.md
* MovingPlatformController: Wrench implementation
Now it works by applying appropriate forces & torques to make the
platform move as desired. Compared to the previous velocity-based
version it introduces no kinematic constraints, keeping it realistic.
Other updates:
- Also make heading configurable by env var in addition to velocity
- Cleaner error handling (runtime error, gzerr, gzwarn)
- Read parameters (gravity, platform mass & height) from model rather than hardcoding
- Update README with new env vars, usage in sdf, etc.
* MovingPlatformController: fix warning message
* MovingPlatformController: fix build
https://github.com/PX4/PX4-Autopilot/pull/24518 changed some variable
names in CMakeLists. This adapts ours to use the new ones.
* MovingPlatformController: format
* MovingPlatformController: address code review
From feedback on PR
- Parameterise low pass filters with cutoff frequency (rather than
filter coefficient directly).
- Add comment with units of feedback gains.
- Scale attitude gains with platform inertia (rather than mass).
Additionally
- Wait 5 seconds before moving the platform so the model has time to
spawn (was quicker before rebasing...)
- Refactor: separate noise generation and force/torque calculation into
two separate functions
- rename updatePlatformState -> getPlatformState to emphasise
difference from other update* functions that update internal state only
- remove unused gz transport node
- README grammar
* MovingPlatformController: format
* MovingPlatformController: remove redundant call
* MovingPlatformController: clarify explanation
* MovingPlatformController: clarify & comment units
* MovingPlatformController: wait for model to spawn
Rather than waiting a fixed 5s, we now only move the platform once the
model is spawned.
For that we construct the model name from the relevant environment
variables, in the same way as done in px4-rc.gzsim.
If attaching to an existing model, do not wait.
* MovingPlatformController: correct substring extraction
---------
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>