28047 Commits

Author SHA1 Message Date
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
Julian Oes
d72c2cc378
uavcan: ignore 0 UTC timestamps (#24529)
We need to wait for a valid UTC timestamp, otherwise we end up in 1970
with Here 4 which sends 0 for a bit even if there is already a fix.
2025-03-17 23:19:54 -06: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
Alexander Lerach
9fc9fb56d1
GPS Dump timeout increase + GPS overflow fix 2025-03-17 17:03:45 +01: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
Niklas Hauser
2280e94a47 [IST8310] Respect address CLI argument 2025-03-12 13:48:49 -04: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
Niklas Hauser
a1f363aa00 [IST8310] Reset all I2C addresses on startup
Reading the WAI register is unreliable as the chip sometimes returns
wrong values or boots with the wrong I2C address. This can be fixed by
sending the software reset command to all four possible I2C addresses.
2025-03-12 13:05:18 +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
Marco Hauswirth
c6c0f2228b clean up 2025-03-12 08:52:39 +01:00
Marco Hauswirth
6112d59e58 do relative calibration of baros with 1s delay 2025-03-12 08:52:39 +01:00
bresch
2aaa54037c ekf2: split gnss pos/vel flags
They can be selected independently in the control parameter, so there is
no reason why they should share the same flag.
2025-03-11 14:14:40 +01:00
bresch
da3a0656d4 ekf replay: set timestamps in us 2025-03-11 14:14:00 +01:00
bresch
cae4f94476 ekf2-replay: best effort replay when no ekf2_timestamps
Run at sensor_combined speed and publish all other sensors occuring
between 2 sonsor_combined samples.
This allows a crude replay in case ekf2 replay was not enabled during
the flight.
2025-03-11 14:14:00 +01:00
Jukka Laitinen
f583406558 src/lib/parameters/parameters.cpp: Remove conversion of unaligned pointers
Parameter "void *val" passed to the functions in parameters.cpp are not always
4-byte aligned, so on some platforms direct casting to "int32_t *" or "float *"
leads to an unaligned exception. An example of such user is Logger, which directly packs
parameter values to character buffer.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-03-11 07:50:47 +01:00
Eric Katzfey
5a05444bad
QuRT logging improvements (#24462)
- Made general improvements to the QURT platform message logging so that module name is printed both in mini-dm and on apps side terminal
2025-03-10 18:59:52 -04:00
bresch
7e0d04e446 ekf2: fix flow derivation for negative hagl
The partial derivative of the flow observation with respect
to the terrain and height states involve calculating the derivative
of 1/x, which is -1/x^2. This function is even, making the estimate
diverge in case x (the height above ground) is negative.
The solution is to take the derivative of 1/|x|,
which is -x/|x|^3 and is an odd function; preserving the sign of x.
Note that for positive values of x, the expression reduces to -1/x^2
2025-03-10 17:11:53 -04:00
chfriedrich98
0671e40f8e pure_pursuit: migrate params from .yaml to .c 2025-03-10 11:14:00 +01:00
chfriedrich98
d1b0be18b2 pure_pursuit: update library 2025-03-10 11:14:00 +01:00
Jukka Laitinen
fec240efba src/lib/airspeed/CMakeLists.txt: Link to "atmosphere" library
Fix a linking error of not finding "atmosphere::getDensityFromPressureAndTemp(float, float)"

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-03-10 09:16:48 +01:00
Jukka Laitinen
dba2f4ff51 src/drivers/px4io/px4io.cpp: Fix compilation errors from printf modifiers
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-03-10 09:13:17 +01:00
Jacob Dahl
7c2aa72690
gz: add gstreamer plugin (#24475) 2025-03-09 10:11:52 +01:00
Konrad
c83fd11924 RTL: Always publish available approaches from home and rally points irrespective of rtly type 2025-03-07 09:01:19 +01:00
Eric Katzfey
139f3792f5 bmp388: Fixed compiler warning (error) for clang
voxl2-slpi: Added more barometers to the build
2025-03-06 14:02:15 +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
Mathieu Bresciani
0ab3e45c13
MC auto: improve behavior of RC help during landing
Letting the autopilot set the heading during landing while the pilot is
nudging the vehile leads to a weird UX as the vehicle would make a turn
instead of translating.
With this modification, the initial land heading is immediately overridden when the pilot
begins to adjust the drone's position, providing the sensation of full control.
2025-03-05 16:37:26 +01:00
Niklas Hauser
2aecdfe116
[adc] Refactor ADS1115 driver (#24428) 2025-03-05 00:36:39 -09: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
chfriedrich98
d1e4198864
rover_control: migrate params from .yaml to .c file (#24445)
* rover_control: migrate params from .yaml to .c file

* Update src/lib/rover_control/rovercontrol_params.c

---------

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2025-03-04 17:28:09 +01:00
Silvan Fuhrer
d857a278ff Commander: use is_ground_vehicle() consistently instead of checking vehicle_type
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-03-04 12:15:01 +00:00
Silvan Fuhrer
7cb6464cfb VehicleStatus.msg: remove VEHICLE_TYPE_UNKNOWN
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-03-04 12:15:01 +00:00
Alex Klimaj
5c7143a33b
uavcannode rangefinder: add tolerance to reading too close check (#24415) 2025-03-04 01:05:54 -09:00
bresch
71d514d359 replay: avoid recursion when adding subscriptions
readAndAddSubscription uses nextDataMessage to find the first
corresponding data and nextDataMessage calls readAndAddSubscription
when it finds a new message definition.
2025-03-03 22:32:55 -05:00
Beniamino Pozzan
9198125ec5
Remove reboot_required from IMU_GYRO_* parameters (#24435)
* fix: IMU_GYRO_* parameters do not requires reboot

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

* restore IMU_GYRO_RATEMAX reboot_required to true

---------

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2025-03-03 12:33:02 -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
bresch
2d1652f499 Commander: fix parachute trigger
Setting "lockdown" disables the actuators. In this mode,
"force_failsafe" has no effect as the actuators are disabled, so the
parachute is not getting released as it requires the output to change to
its failsafe value.
2025-03-03 15:41:39 +01:00