183 Commits

Author SHA1 Message Date
Jacob Dahl
d5ddc9135d
clang-tidy: fix issues (#26498) 2026-02-17 14:09:43 -09:00
Yannick Poffet
3e1b7d4d0a clean-up(SIH): remove confusing runtime uorb sub change 2026-02-11 12:14:54 +01:00
Pernilla
8c5c4a0504 gimbal: update gz gimbal 2026-01-16 11:33:45 +01:00
Baardrw
fe30ef7f16
GZ: Update GZMixingInterfaceESC to support more than 8 ESCs (#25081)
* Changed GZMixingInterfaceESC to GZMixingInterfaceMotor
- GZMixingInterfaceMotor checks if there are more than 8 motors configured if its less than 8 it behaves exactly the same as GZMixingInterfaceESC, else it behaves as a PWM motor interface
- This change allows drones with more than 8 motors to be simulated by Gazebo

Fixes #25080

* code quality fix

* Changed GZMixingInterfacMotor back to GZMixingInterfaceESC and changed variable names to match ESC terminology

* formatting issue resolved

* updated interface to support 16 ESCs, allowing the first 8 to report telemetry

* rebased
2026-01-15 10:37:35 -09:00
Jacob Dahl
f46fd89057
gz_bridge: GZGimbal: fix frame flags (#26172) 2025-12-24 12:42:30 -08:00
Pedro Roque
cb682006fe
fix: esc status sizing fix for gz simulation
* init: working towards dual-action ATMOS

* fix: update gz sim to latest

* fix: add motor number max fitting Actuator

* fix: revert non-necessary changes

* fix: ensure esc count does not exceed maximum number of ESCs

* fix: remove extra modules

* fix: sync submodules with remote

* fix: sync with main
2025-12-16 15:46:51 -08:00
Farhang
a7de5d176f
Permission error gz build fix (#25921) 2025-12-04 07:52:02 -05:00
Jaeyoung Lim
5df20b8e9b
Add custom gz airspeed plugin and add wind effects (#26018)
* Add px4 custom airspeed sensor

* Format fix
2025-12-01 08:56:40 -08:00
Julian Oes
2ef2580388 Gazebo-classic: add define for development.xml
And update submodule.
2025-11-20 23:23:40 -09:00
Matthias Grob
05c79e23d5 SensorBaroSim: correcct comment, nothing in hPa
This comment was forgotten in #20057
2025-11-13 15:52:00 -08:00
Kimminkyu
517f04259c
Add Gazebo MotorFailure Plugin (#25776)
* Add Gazebo MotorFailure Plugin

* switch from ROS2 to Gazebo Transport

* Clean up old/dead comments, Refactor variable

* gz: submodule update
2025-11-06 01:06:42 -08:00
Jacob Dahl
05c5293596 gz: init submodule before configuring build 2025-10-29 13:50:50 -04:00
Alexander Sherikov
6e8f61c551
various cmake fixes (#25748)
- enable building in a cmake subdirectory:
    - use consistent path to "etc" in build directory
    - add a quick fix for mavlink inclusion with
      `mavlink/<version>/mavlink.h`, presumably the problem does not
      appear normally since somewhere the build root directory is added
      to include paths.
- install gazebo config and plugins, the goal is to enable packaging of
  PX4 sitl binaries.
- fix dependency on dds_topics.h generation in uxrce_dds_client:
  *** No rule to make target 'PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.h', needed by 'PX4-Autopilot/events/px4.json'.  Stop.
  https://github.com/PX4/PX4-Autopilot/issues/21788

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-10-17 11:11:00 -08:00
Jacob Dahl
54866b886e
gz: fix gimbal message type (#25770) 2025-10-15 13:28:14 -08:00
Erkki Eilonen
f32c3024b8 gazebo: fix unused variables warning ([-Wunused-private-field]) 2025-10-15 11:32:16 -04:00
Erkki Eilonen
2297e66a9d gazebo: fix implicit conversion errors ([-Wdouble-promotion]) 2025-10-15 11:32:16 -04:00
Jacob Dahl
a64536802b
gz: fix gimbal yaw, add dds publisher (#25754)
* gz: correct gimbal yaw

* uxrce_dds: add publisher /fmu/out/gimbal_device_attitude_status

* chore: use explicit ENU_to_NED rotation

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>

* format

---------

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2025-10-14 11:45:43 -08:00
jmackay2
8669947bcb
Support Gazebo Jetty (#25521)
* Support Gazebo Jetty

* Gazebo jetty cmake spelling fix

---------

Co-authored-by: jmackay2 <jmackay2@gmail.com>
2025-09-11 19:30:27 -08:00
Samuel Toledano
b2672910da
sbgecom: Implement sbgECom INS driver (#24137)
* Add new INS driver sbgECom

Implement sbgECom messages handling to provide IMU sensors, GNSS and EKF data to the autopilot
Be able to parametrize the serial port, baudrate and the communicating mode
Clone sbgECom library only if sbgecom support is enabled and apply a patch
Be able to send SBG Systems INS settings in several ways when starting sbgecom driver

* Fix sensor airspeed simulator units

* Fix HIGHRES_IMU pressure unit

* Allow HIGHRES_IMU to support 4 IMUs

* sbgECom: Add documentation

* Use submodule instead of fetching sbgECom using CMake

* Remove patch strategy

* Fix dates

* Remove patch file

* Update SBG dev type ID

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

---------

Co-authored-by: Samuel Toledano <samuel.toledano@sbg-systems.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-09-11 00:37:41 -08:00
Davide Iafrate
ec436d3be3
Enable selectively disabling sensors in the Gazebo bridge. (#25484)
* Initial plan

* Add configurable sensor subscription parameters

Co-authored-by: Tuxliri <3532595+Tuxliri@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Tuxliri <3532595+Tuxliri@users.noreply.github.com>
2025-08-26 10:00:47 -08:00
Marco Hauswirth
c9206d6bd1
EKF2: gnss reset improvements (#25297)
* ekf2: allow manual position reset when horizontal aiding is active

This allows the pilot to override position esitmates manually

* mavlink sim: add support of failure gps struck

* mavlink sim: add GNSS failure "wrong" type

* ekf2-gnss: add reset mode

This allows the user to choose whether the position should immediately
be reset to GNSS on fusion timeout or if the EKF can continue with
velocity dead-reckoning.

* ekf2: fix unit test changes due to GNSS start logic

Especially because the EKF doesn't need to reset the states if the test
ratio is already passing

* rename mode enum

* reset to gps lat lon on init

* remove obsolete reset-condition (handled in #25223)

* WIP try to upgrade compiler externally

---------

Co-authored-by: bresch <brescianimathieu@gmail.com>
Co-authored-by: Niklas Hauser <niklas@auterion.com>
2025-07-30 11:39:56 +02:00
Pedro Roque
5f797fa210
fix: removes buoyancy from all default worlds from server config (#25285) 2025-07-24 09:36:49 -08:00
Pedro Roque
e14eea5615
feat: BlueROV2 Heavy updated control (attitude and position) and model (#25052)
* rft: clean merge to PX4

* fix: formatting

* fix: extra line

* fix: moved submarine out of "is_ground_vehicle", added proper check for center-throttle

* feat: updated gazebo models to include bluerov update

* fix: use 'is_uuv_vehicle', remove FW_MM/LLC from uuv build

* fix: added saturation to thrust and torque messages via param

* doc: updated parameters documentation for uuv

* fix: formatting

* feat: matching hardware reference

* fix: thrusters kg

* rft: removed commented lines

* fix: update gz reference given hw setup

* fix: hardware references

* fix: recommendations

* fix: updated settings to match hardware

* rft: check only for fixed and rotary wing for high throttle

Co-authored-by: Daniel Agar <daniel@agar.ca>

* fix: commit oupsie

* fix: format

* rft: remove is_uuv

* fix: hw parameters, uuv build target for v6x

* feat: added support for D-pad attitude changes in stabilized position control

* fix: position setpoint update and parametrized trajectory age and att change

* fix: format

* fix: removed duplicated call to check_validity_setpoint

* fix: setpoint update on arming logic

* fix: setpoint initialization for stabilized mode

---------

Co-authored-by: Daniel Agar <daniel@agar.ca>
2025-07-23 10:29:22 -07:00
Pedro Roque
2f55dff8b9
feat: spacecraft support (#24734)
* rft: initial merging of controllers for spacecraft vehicles

* feat: rate controller nominal

* feat: spacecraft tooling for commander and VehicleStatus

* feat: spacecraft tooling for commander and VehicleStatus

* fix: format

* fix: format

* fix: remove iostream

* fix: remove iostream

* feat: spacecraft attitude control and minor refactoring of params

* feat: add position controller

* fix: format

* fix: moved trajectories to new message, removed derivative filters

* fix: format

* fix: removed extra newline

* fix: spacecraft allocation builds

* feat: add thrusters to effectivenes, add spacecraft build to cmake, clean comments

* feat: required changes for allocation

* feat: thruster simulation interface

* fix: update maximum and minimums

* fix: format

* fix: added newline at the end of spacecraft actuator effectiveness

* feat: configurable board pwm freq from Kconfig

* feat: mavlink compliant spacecraft definition

* feat: add orbiter to define

* boards: Increase TELEM2 rx buffer size for DDS over serial use-case (ARK Jetson)

feat: spacecraft tooling for commander and VehicleStatus

fix: format

fix: remove iostream

feat: mavlink compliant spacecraft definition

* feat: add orbiter to define

* feat: add orbiter to define

* fix: change mav_type to new spacecraft orbiter enum value

* fix: build issue

* feat: update mavlink

* feat: update mavlink to latest master with spacecraft

* feat: update mavlink

* feat: update mavlink to latest

* feat: cleanup and synchronization with new mavlink vehicle definition

* fix: get away without specifying spacecraft vehicle

* fix: removed unnecessary definition

* fix: format

* feat: cmake variant for spacecraft

* feat: proper mav_type and rc init

* fix: removed dart from build system

* add: thrusters to actuator type

* rft: reordering actuator type

* rft: initial merging of controllers for spacecraft vehicles

* feat: rate controller nominal

* fix: format

* feat: spacecraft attitude control and minor refactoring of params

* feat: add position controller

* fix: format

* fix: moved trajectories to new message, removed derivative filters

* fix: format

* fix: removed extra newline

* fix: spacecraft allocation builds

* feat: add thrusters to effectivenes, add spacecraft build to cmake, clean comments

* feat: required changes for allocation

* feat: thruster simulation interface

* fix: update maximum and minimums

* fix: format

* fix: added newline at the end of spacecraft actuator effectiveness

* feat: configurable board pwm freq from Kconfig

* feat: add orbiter to define

* feat: cleanup and synchronization with new mavlink vehicle definition

* fix: get away without specifying spacecraft vehicle

* fix: conflicts

* fix: format

* fix: remove duplicate entry

* rft: remove Kconfig changes

* rft: revert main Kconfig

* rft: revert main kcoonfig on platforms

* rft: remove changes to board PWm (go on another PR)

* rft: revert changes to commander (main is correct)

* fix: extra char on commander_helper

* rft: removed extra spaces

* rft: moved effectiveness to spacecraft

* fix: spacecraft effectiveness

* fix: extra space

* feat: preliminary version, still using thrusters

* rft: initial pipeline on PX4 side with rotors instead of thrusters

* feat: add atmos model

* feat: spacecraft with rotor pipeline tested, working

* feat: update gz

* rft: removed thruster interfaces

* fix: format

* fix: remove control allocation

* fix: thruster normalization

* fix: format

* fix: nuttx version

* fix: clang tidy error

* feat: updated gz to add atmos model

* fix: update gz

* fix: update mavlink

* fix: remove friend class from allocation lib

* fix: remove actuator_outputs/motors

---------

Co-authored-by: Alexander Lerach <alexander@auterion.com>
2025-07-23 08:26:27 -07:00
William Freidank
13122c29c0
Fix simulated gimbal behavior with zero velocity (#25217)
* fix simulated gimbal behavior with zero velocity

* check for PX4_ISFINITE before checking for magnitude
2025-07-21 12:59:55 -08:00
chfriedrich98
b4bfbbb5e0
ackermann: add SIH (#25194) 2025-07-15 09:58:41 +02:00
Jacob Dahl
ce4dfaf39a fix missing function update 2025-07-11 08:53:52 -06:00
Jacob Dahl
09ebd21e55 mixer: remove used flag stop_outputs
dshot: fix motor test on CANnode

Also includes fixes for the DShot driver since stop_outputs is removed. The esc info command has been removed because it doesn't work with AM32, can only be used via command line, and complicates the driver
2025-07-11 08:53:52 -06:00
chfriedrich98
e266d1f22f rover: remove deprecated module 2025-07-10 10:11:58 +02:00
Matthias Grob
0b3fc0a62d SIH: add Hexacopter X
to enable easy simulation of a motor failure.
2025-05-20 13:23:08 +02:00
Jacob Dahl
2fece23c64
gz small improvements (#24761)
* gz: print version number in init, remove gst plugin spam, rename function

* fix 0 timestamp issue by waiting for clock callback before subscribing to other topics. Refactor to cleanup topic subscriptions

* format

* change gzerr to gzwarn
2025-05-04 14:41:19 -08:00
Matthias Grob
fa3f255301
SIH: write out vehicle types for clarity (#24731) 2025-04-16 14:03:34 +02:00
Jacob Dahl
ff7c636065
gz: better error message when installation is missing (#24661) 2025-04-16 09:36:25 +02:00
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
jmackay2
561937f35a
Reduce dependency of gstreamer for gz simulation (#24676)
Co-authored-by: jmackay2 <jmackay2@gmail.com>
2025-04-04 20:22:25 -08:00
Matthias Grob
ddb9a5d0b9
gz_plugins: do not look for gz-transport12 (Gazebo garden) (#24633)
this tries to build the plugins and breaks the SITL build if you have
Gazebo garden isntalled even if you're not trying to simulate with
Gazebo.
2025-03-28 10:11:56 -08:00
Matthias Grob
faf4114a09 gz_bridge: add a localhost GZ_IP to avoid multicasting all messages to all networks 2025-03-18 10:52:34 +01:00
Jacob Dahl
b6597f2984
gz: set realtime clock at startup (#24530) 2025-03-17 23:19:10 -06:00
Jacob Dahl
85ef444f95
gz: fix depends regression (#24527) 2025-03-17 16:17:38 -06:00
jmackay2
fced29da59
Gz cmake cleanup (#24518)
* clean up cmakelists

* cleanup

---------

Co-authored-by: jmackay2 <jmackay2@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-03-17 10:02:10 -08:00
jmackay2
d2c049ec93
Remove OpenCV dependency from gz plugin gstreamer (#24519)
Co-authored-by: jmackay2 <jmackay2@gmail.com>
2025-03-17 10:00:40 -08:00
Jacob Dahl
7c2aa72690
gz: add gstreamer plugin (#24475) 2025-03-09 10:11:52 +01:00
Jacob Dahl
ea8bcd9cef
gz: use server config file for loading world plugins (#24441)
* gz: use server config file for loading world plugins

* submodule

* use server.config in tree

* newlines

* format

* gzbridge: rename function

* format

* gzbridge: add magnetometer callback

* change gz_find_package to find_package

* fix up directory structure and cmake to allow multiple plugins

* newlines

* add comment block explaining gz_env.sh

* remove dupe readme

* remove SENS_EN_MAGSIM from all gz airframe files except spacecraft

* update gz submodule
2025-03-05 17:37:16 -07:00
jmackay2
0ee592f67c
cleanup gz_msgs CMakeLists (#24450)
* cleanup gz_sim CMakeLists

* Check if protobuf is found

* ignore old protobuf float warning

---------

Co-authored-by: jmackay2 <jmackay2@gmail.com>
2025-03-04 18:58:33 -09:00
Jacob Dahl
6dc39d9deb
[wip] gz plugins (#24153)
* added optical flow to gz bridge

* log high rate sensor data

* it builds

* it builds and publishes, need to figure out build system now

* single library

* rename files

* add gz_msg for proto, fix build, test basic flow impl

* update rate, no blur

* PX4-OpticalFlow impl

* rename OpticalFlowSensor

* rename plugins

* disable gps, add plugin path

* cleanup

* fix plugin path export

* properly add OpticalFlowSystem dependency to gz

* move everything under gz_bridge

* cleanup

* add GZ_VEBOSE

* cleanup model/world build target cmake

* added GZ_DISTRO env, harmonic or ionic

* fix gz transport, unstage ark fpv bootloader

* unstage logged_topics.cpp

* cleanup

* make format

* ci fixes

* fix cmake

* remove required for gz-transport

* use model/world namespace for multi vehicle sim. Make format

* make format

* license

* remove needless member var

* made separate Kconfig for gz_msgs, gz_plugins, and gz_bridge

* move OpticalFlow build to it's own cmake

* fix clang

* cleanup comments

* fix rebase
2025-03-03 12:21:28 -09:00
Jacob Dahl
3b2d74b017
gz: Refactor GZBridge and px4-rc.simulator (#24421)
* disable SENS_EN_GPSSIM for all gz airframes

* add GPS + noise to GZBridge

* remove mutex from gz callbacks. Callbacks run synchronously after sim update step and run() loop does not share resources.

* remove hrt check in callbacks

* format

* remove param set-default for already default params

* update submodule

* remove unnecessary comments

* overhaul of the GZBridge and px4-rc.simulator script

* remove arg

* shellcheck disable

* add bus/address

* start gz_bridge before adjusting sim speed or camera follow
2025-03-03 11:29:21 -09:00
Sebastian Domoszlai
b5f37c9fa6
Simplify Battery-related Enum Naming (#24265)
* Simplify battery-related enum naming

* Fix mistakenly removed string in enum names

* Fix missing renamings

* Update outdated file

* msg: Increase battery_status version since the enum naming was changed

* Revert message version increase

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2025-02-28 11:42:40 -09:00
Andrew Brahim
75c0089c26
Faster than Real -Time support in GZ (#23783)
* add rtf service to gzbridge

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* physics before model spawn

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

---------

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-02-26 18:52:07 +01:00
Matthias Grob
ed9111ec49 Remove obstacle avoidance test with Gazebo classic and ROS 1 2025-02-18 14:33:16 +01:00
Marco Hauswirth
d2cbe10243
Clean up temperature msg fields (#24272)
* remove temp field from airspeed.msg, adjust temp selection

* temp-sensor hirarchy: airspeed, ext. baro, default value

* directly use diff-press or baro temp in true-airspeed  calc

* improve clarity

* add enum for temperature source in VehicleAirData.msg
2025-02-18 13:23:10 +01:00