Balduin c0bb482126
Gazebo: Moving platform (#24471)
* 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>
2025-04-06 10:57:44 -08:00
2025-02-24 16:02:46 +01:00
2025-04-06 10:57:44 -08:00
2025-04-06 10:57:44 -08:00
2022-07-20 01:14:04 -04:00
2017-07-30 19:18:49 +02:00
2017-01-02 10:14:41 +01:00
2023-01-21 12:57:27 -05:00
2025-02-25 21:16:54 -05:00
2023-11-06 09:32:16 +01:00

PX4 Drone Autopilot

Releases DOI

Build Targets SITL Tests

Discord Shield

This repository holds the PX4 flight control solution for drones, with the main applications located in the src/modules directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.

PX4 is highly portable, OS-independent and supports Linux, NuttX and MacOS out of the box.

Releases

Release notes and supporting information for PX4 releases can be found on the Developer Guide.

Building a PX4 based drone, rover, boat or robot

The PX4 User Guide explains how to assemble supported vehicles and fly drones with PX4. See the forum and chat if you need help!

Changing Code and Contributing

This Developer Guide is for software developers who want to modify the flight stack and middleware (e.g. to add new flight modes), hardware integrators who want to support new flight controller boards and peripherals, and anyone who wants to get PX4 working on a new (unsupported) airframe/vehicle.

Developers should read the Guide for Contributions. See the forum and chat if you need help!

Weekly Dev Call

The PX4 Dev Team syncs up on a weekly dev call.

Note

The dev call is open to all interested developers (not just the core dev team). This is a great opportunity to meet the team and contribute to the ongoing development of the platform. It includes a QA session for newcomers. All regular calls are listed in the Dronecode calendar.

Maintenance Team

See the latest list of maintainers on MAINTAINERS file at the root of the project.

For the latest stats on contributors please see the latest stats for the Dronecode ecosystem in our project dashboard under LFX Insights. For information on how to update your profile and affiliations please see the following support link on how to Complete Your LFX Profile. Dronecode publishes a yearly snapshot of contributions and achievements on its website under the Reports section.

Supported Hardware

For the most up to date information, please visit PX4 User Guide > Autopilot Hardware.

Project Governance

The PX4 Autopilot project including all of its trademarks is hosted under Dronecode, part of the Linux Foundation.

Dronecode Logo

 
Description
a mirror of official PX4-Autopilot
Readme BSD-3-Clause 587 MiB
Languages
C++ 51.2%
C 38.5%
CMake 4.7%
Python 3.9%
Shell 1.3%
Other 0.1%