17871 Commits

Author SHA1 Message Date
chfriedrich98
8eb873a245 ackermann: streamline flow of information 2025-04-08 12:27:11 +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
45d7f707d7 mc_att_control: remove useless subscription
added in 28fa04438616d16363306878e6bfee0473c77afc
#19633
2025-04-04 13:23:49 +02:00
GuillaumeLaine
648e730c4a ev_odom: always convert reference frame enum 2025-04-04 09:12:53 +02:00
Beat Küng
6fcfd5fac1 uxrce_dds_client: immediately create data writers on startup
There is some race condition where in rare cases the topic publication
right after creating the writer did not get received on the ROS side.
This happens even with reliable QoS & reliable transport.
2025-04-04 09:12:53 +02:00
bresch
e35c1f430c EKF-AGP: only reset lat/lon when starting 2025-04-01 16:42:26 +03:00
bresch
f73c7977dd ekf2-flow: limit minimum flow hagl 2025-03-31 11:34:25 +02:00
bresch
53bdceb895 ekf2-flow: check test ratio on Y axis separately 2025-03-31 11:34:25 +02:00
bresch
cdab0cb6e4 ekf2-flow: use same measurement prediction as in jacobian derivation
Also avoid double division in flow prediction
2025-03-31 11:34:25 +02:00
bresch
82ea544e8c ekf2-test: add flow unit test for negative distance 2025-03-31 11:34:25 +02: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
Roman Bapst
2c8ef05c2d
Add COM_DLL_EXCEPT to specifiy exceptions for data link loss failsafe 2025-03-28 17:41:24 +01:00
Alexander Lerach
72454c4fd2
dataman: clarify default storage backend (#24626) 2025-03-28 16:27:12 +01:00
Julian Oes
8acf273917
Add RTL_TYPE to continue or reverse (#24581)
This adds RTL_TYPE 4 which means continue the mission or reverse back to
the takeoff location, whichever is closer in terms of mission items
in-between.

This would be nicer to have on a distance rather than mission item count
basis but that would require access to the dataman and make it more
complex.
2025-03-28 06:29:42 +13:00
Daan Smienk
3870992bac
Fix spelling mistake (#24623) 2025-03-27 09:46:02 -06:00
Roman Bapst
550bbd9051
FW rate controller: Don't constrain airspeed for scaling to maximum airspeed (#24622)
* don't constrain airspeed for scaling to maximum airspeed

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* fix max function

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* remove hardcoded max

Signed-off-by: RomanBapst <bapstroman@gmail.com>

---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2025-03-27 14:22:40 +01:00
Balduin
19d3e6285b vtol_att_control: shorter elapsed time calculation 2025-03-27 09:29:54 +01:00
Balduin
898d631b24 dds_topics: add vtol_vehicle_status 2025-03-27 09:29:54 +01:00
bresch
82a482ec0b ekf2: reset heading when mag calibration changed 2025-03-26 22:32:51 -04:00
bresch
49624a6457 mag: synchronize calibration count with newly calibrated data
The data contained a mix between the old and new calibration. This
caused the EKF to reset to an incorrect (intermediate) heading.
2025-03-26 22:32:51 -04:00
chfriedrich98
c2706f5406 rover: auto mode stopping conditions 2025-03-25 10:38:30 +01:00
Bertug Dilman
735777862d
mavlink streams: LORA mode for low bandwidth radio links (#24328)
* Add LORA radiolink Mavlink message rates

* Do not forward ONBOARD_COMPUTER_STATUS when using low bandwidth radio links

* Update src/modules/mavlink/mavlink_main.cpp

* Update src/modules/mavlink/mavlink_main.cpp

* Update src/modules/mavlink/mavlink_main.cpp

* Update src/modules/mavlink/mavlink_main.h

* Update src/modules/mavlink/mavlink_main.h

* Update src/modules/mavlink/module.yaml

* Update src/modules/mavlink/mavlink_main.h

---------

Co-authored-by: Sebastien <sebastien.courroux@auterion.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-03-24 20:46:49 -08:00
Andy Wheatley
ca2ed655b8
Allow negative differential pressure if parameter enabled (#24434) 2025-03-24 09:42:36 +01:00
Balduin
fdebdc447d dds_topics: add home_position 2025-03-24 09:34:51 +01:00
Marco Hauswirth
283a69dedf enable terrain_hold when not moving vertically 2025-03-24 09:08:18 +01:00
Matthias Grob
a048a8e8a0 mavlink_receiver: refactor manual_control.throttle extraction to exactly match MAVLink output 2025-03-21 11:44:51 +01:00
Peter Breuer
80ea3a09bb fix: change MANUAL_CONTROL MAVLink message output throttle field range from [-1000, 1000] to [0, 1000] 2025-03-21 11:44:51 +01:00
Silvan
18b6a61788 Navigator: add NUM_MISSION_ITMES_SUPPORTED to kconfig
Signed-off-by: Silvan <silvan@auterion.com>

boards: increase max mission items for boards with >=1kb RAM to 1000

Signed-off-by: Silvan <silvan@auterion.com>

boards: increase NUM_MISSION_ITMES_SUPPORTED for SITL to 10000

Signed-off-by: Silvan <silvan@auterion.com>
2025-03-20 11:45:26 +01:00
Silvan
b91e1cd482 Navigator: remove MEMORY_CONSTRAINED_SYSTEM
Signed-off-by: Silvan <silvan@auterion.com>
2025-03-20 11:45:26 +01:00
Silvan
d1eff16ad7 Navigator: remove define for RAM_BASED_MISSIONS
Since we have SYS_DM_BACKEND, the user has to option on all boards
to store the mission on the RAM, thus thus define got obsolete.

Signed-off-by: Silvan <silvan@auterion.com>
2025-03-20 11:45:26 +01:00
Hamish Willee
440d76b839
commander_params.c - COM_QC_ACT is action not command (#24541) 2025-03-19 16:35:05 +01:00
Roman Bapst
480cb14c10
VTOL: abort front transition early if airspeed doesn't go above blending speed (#24521)
vtol_type: timeout transition earlier if we use airspeed and airspeed has
not increased above blend airspeed after openloop front transition time.

Signed-off-by: RomanBapst <bapstroman@gmail.com>

---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2025-03-18 13:17:53 +01: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
Silvan Fuhrer
e691db3cfe Takeoff: on completion estabilish loiter at current position for FW
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-03-17 02:52:12 -08:00
Silvan Fuhrer
9499b32be6 Revert "Takeoff: remove set loiter logic, as it is handled in loiter.cpp already (#24454)"
This reverts commit 8547ebb8638481b580e6741dc08f37dce1934c23.
2025-03-17 02:52:12 -08:00
bresch
fa0ba69083 ReplayEkf: correctly add all subscriptions
Logged data and subscription messages can be mixed, so don't stop adding
subscriptions after finding the first logged message
2025-03-17 10:01:48 +01:00
bresch
30a6a854c1 ReplayEKF: reduce effect of IMU time slip 2025-03-17 10:01:48 +01:00
bresch
9ac03f03eb ekf2: consider GNSS vel as horizontal velocity aiding 2025-03-14 18:22:00 +01:00
Julian Oes
42d6298dbf commander: fix accel sensor present flag
This must have been a copy paste mistake.
2025-03-13 07:13:08 +01:00
Jacob Dahl
543851db50
[Sponsored by ARK] Bidirectional DShot (#23863)
* Bidirectional DShot

Co-authored-by: Julian Oes <julian@oes.ch>

* f4/f1 support, not supported

* fix f1 build target

* sanity check timer_channel value, fix CCxNP ifdef, debug stuff

* removed debug code, added define for H7 HAVE_GTIM_CCXNP

* round robin sampling for less than 4 DMA

* unlimited esc_status logging

* dshot: fix formatting

* dshot: add define for number of DMA channels to use

This allows individual boards to override the number of DShot channels
and hence avoid round robin capture of the RPM feedback.

* ARK: enable 4 DMA channels for DShot on 6X

* dshot: publish when all channels are updated

This slows down the ESC_STATUS publication in the case of round robin
capture. E.g. for 800 Hz output with one DMA channel, the ESC_STATUS is
now published at 200 Hz.

* dshot: avoid duplicate publications for bidir and telem

Instead of publishing both bidirectional dshot updates as well as
telemetry updates, we now combine the data from both streams, and
publish whenever we get RPM updates, as the latter arrives with higher
rate, e.g. 200 Hz with round robin, or faster otherwise.

When combining the data, we take RPM from bidirectional dshot, and the
rest from telemetry.

When we have only one of the two, either telemetry or bidirectional
dshot, we just publish that one.

* boards: add ark fpv and pi6x BOARD_DMA_NUM_DSHOT_CHANNELS

* dshot: turn off debug build

---------

Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: alexklimaj <alex@arkelectron.com>
2025-03-12 12:55:15 -06:00
Beat Küng
a3c387fa85
fix commander: separate state tracking for battery_unhealthy failsafe (#24493)
There is already another check for battery_unhealthy, so a separate state
and ID are required.

Fixes the error:
ERROR [failsafe] BUG: duplicate check for caller_id 74
2025-03-12 16:46:02 +01:00
bresch
b5e2395982 GPS2_RAW: fill extension fields 2025-03-12 13:12:38 +01:00
Silvan Fuhrer
8547ebb863
Takeoff: remove set loiter logic, as it is handled in loiter.cpp already (#24454)
Signed-off-by: Silvan <silvan@auterion.com>
2025-03-12 13:05:47 +01:00
Silvan Fuhrer
c4ade17b38
Commander: Never clear link loss failsafe automatically, also not when failsafe is Hold (#24317)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-03-12 12:46:42 +01:00
Silvan Fuhrer
5319b82e4d
MissionBase: replay change speed on resume immediately if not going to previous (#24484)
* MissionBase: replay change speed on resume immediately if not going to previous

This fixes an issue where the speed was not correctly set at the beginning of a
survey (with first wp having a DO_CHANGE_SPEED attached) when the user paused
and resumed the mission prior to reaching the first waypoint.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* Update src/modules/navigator/mission_base.cpp

Co-authored-by: Stefano Colli <45536733+StefanoColli@users.noreply.github.com>

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Stefano Colli <45536733+StefanoColli@users.noreply.github.com>
2025-03-12 09:17:57 +01:00