16556 Commits

Author SHA1 Message Date
Julian Oes
74b4902e50 mavlink: fix BATTERY_STATUS extension
The extension fields need to be 0 by default according to the MAVLink
spec. This is because extensions are 0 by default and need to be 0 when
unknown/unused for backwards compatibility.

The patch also simplifies the flow slightly in that it doesn't create a
temporary array but just fills in the cell voltages directly.

Signed-off-by: Julian Oes <julian@oes.ch>
2023-08-29 13:23:55 +02:00
Daniel Agar
0f260fc26c ekf2: gravity fusion don't use any accel samples that are clipping 2023-08-28 14:35:13 -04:00
Daniel Agar
2c76109a94 ekf2: drag fusion don't use any accel samples that are clipping 2023-08-28 14:35:13 -04:00
Mathieu Bresciani
6a58f6c7dc
Enable arbitrary euler angle for Mag rotation CAL_MAGx_{ROLL,PITCH,YAW}
- Enable arbitrary euler angle for Mag rotation
  - new CUSTOM rotation enum out of the normal enum range
 - mag_rot: automatically change to custom if euler rot is set
 - sensor_calibration: Magnetometer save custom rotation parameters
 - mag_cal: cross mention rotation parameters
  - This allows the user to see the RPY options when searching for the rotation parameter

---------

Co-authored-by: Junwoo Hwang <junwoo@auterion.com>
Co-authored-by: bresch <[brescianimathieu@gmail.com](mailto:brescianimathieu@gmail.com)>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2023-08-26 14:52:39 -04:00
bresch
9551c1b614 ekf2: send global position if origin is set manually
Even if the aiding is local only, a valid global estimate can be sent as
long as we know the EKF's origin.
2023-08-26 14:48:49 -04:00
Silvan Fuhrer
f1b5b4f524
TiltrotorEffectiveness: limit thrust axis tilt to z effectiveness scaling (#21990)
During transition to FF, only allow update thrust axis up to 45° as with a high tilt angle
the effectiveness of the thrust axis in z is apporaching 0, and by that is increasing
the motor output to max.
Transition to HF: disable thrust axis tilting, and assume motors are vertical. This is to avoid
a thrust spike when the transition is initiated (as then the tilt is fully forward).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-25 14:45:14 +02:00
Silvan Fuhrer
410206aa5d
Control Allocation: fixes in yaw saturation detection for vehicles with tilt-for-yaw (#21994)
* ActuatorEffectiveness: base yaw saturation on tilt actuator limits (VTOL Tiltrotor)

* ActuatorEffectiveness: add custom yaw saturation for MC Tilt


---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-24 13:58:58 +02:00
Silvan Fuhrer
0eb276f273
Tiltrotor: move spin up tilt to control allocation (#21991)
EffectivenessTiltrotor: link time when to tilt motors to MC position to COM_SPOOLUP_TIME
- remove VT_TILT_SPINUP and special spin up tilt handling form the VTOL module
- now handle the spoolup in the allocation, directly linked to COM_SPOOLUP_TIME
- leave tilts at disarmed value during spoolup

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-24 13:57:24 +02:00
Daniel Mesham
86822171b9 Add SITL targets for Iris models with depth cameras 2023-08-22 11:50:29 -04:00
Beat Küng
d4c7ea74ef refactor uxrce_dds_client: reduce amount of generated code for SendTopicsSubs
Reduces flash usage by ~4KB for current set of topics.
2023-08-21 20:56:08 -04:00
Beat Küng
03365658d5 VehicleControlMode: add flag_control_allocation_enabled
Allows (external) modes to directly publish actuator_{motors,servos}.
2023-08-21 20:53:51 -04:00
Matthias Grob
22e613a24a commander_params: more precise COM_FAIL_ACT_T description
regarding RC stick override
2023-08-21 16:39:10 +02:00
bresch
dbebe7d168 fw-atune: use same attitude P rule as for multirotors
The current rule was producing too high gains. Also constrain the value
using the prameter's limits.
2023-08-18 11:48:08 -04:00
bresch
759f91ba52 fw-atune: limit max test signal
Whe the P gain is high, the test signal is large too. However, it should
not exceed what is allowed from the max rate parameter.
2023-08-18 11:48:08 -04:00
Mathieu Bresciani
74a54b3b12
EKF2: improve resilience against incorrect mag data
- when GNSS is used require low mag heading innovations during
  horizontal acceleration (yaw observable) to validate the mag
- only fuse mag heading just enough to constrain the yaw estimate
  variance to a sane value. Leave enough uncertainty to allow for a
  correction when the yaw is observable through GNSS fusion
2023-08-17 09:55:15 -04:00
Silvan Fuhrer
eaad11bb74 ActuatorEffectiveness: add comment for 2% magic number to stop motors
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-17 13:28:09 +02:00
Ludovic Vanasse
3a166247c1 Add condition for Iridium mode to not send params change after a time
In the mavlink_receiver code, after a while it will try to resend some
parameter update through the MAVLink instance. But for Iridium links
those are not a good idea. So this adds a condition that prevent the
sending if the MAVLink instance is in Iridium mode.

Related to issue #21496
2023-08-16 11:28:36 -04:00
Sverre Velten Rothmund
b21ad6af14 multiple: Fix abs(int) usage on float values 2023-08-15 10:18:32 +02:00
PX4 BuildBot
4fce159a2a Update submodule mavlink to latest Fri Aug 11 12:38:42 UTC 2023
- mavlink in PX4/Firmware (594d7743bab98001866a2f34e1cc835d5795fb3a): e04677782a
    - mavlink current upstream: 58435f6a83
    - Changes: e04677782a...58435f6a83

    58435f6a 2023-08-09 Hamish Willee - development.xml - remove mission_checksum (#2010)
048237b4 2023-08-02 Hamish Willee - Update Pymavlink - for Ava etc (#2025)
2023-08-11 09:48:45 -04:00
Beat Küng
ae70f9c640 attitude_estimator_q: disable ATT_ACC_COMP by default
Improves tracking in the CI test, and I always disabled it on my vehicles
as well.
2023-08-08 12:28:52 -04:00
bresch
1f02d55103 ekf2: update change indicator
change caused by fixing the yaw variance increase calculation
2023-08-08 12:09:56 -04:00
bresch
39a83ab138 ekf2_test: test yaw variance after reset 2023-08-08 12:09:56 -04:00
bresch
b6fb95247b ekf2_derivation: fix typo 2023-08-08 12:09:56 -04:00
bresch
de702a2e63 ekf2: fix function to increase yaw variance 2023-08-08 12:09:56 -04:00
Silvan Fuhrer
56dd1dc930
Navigator: Resume mission with last flight speed (#21714)
* Navigator: DO_CHANGE_SPEED: only store sinlge cruising_speed_current_mode

This stored cruising speed setpoint is reset on mode change and
after a VTOL transition.

* Navigator Mission: replay DO_CHANGE_SPEED items when resuming mission

* Navigator: remove cruising_speed_sp_update()

Speed changes in a mission are handled directly in the position controllers,
and no longer in Navigator.

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

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-08-08 13:22:05 +02:00
Beat Küng
02a6640000 fix uxrce_dds_client: apparently we cannot use the upper 4 bits for ID's 2023-08-08 10:59:34 +02:00
hskrieg
64c21ad428 uorb: allow for more than 255 uORB messages
Increased size for ORB_ID from uint8_t to uint16_t

Created a type: orb_id_size_t = uint16_t.
There are still a couple of places where the size
of the ORB_ID is assumed to be less than 16-bits.
The places that I have found are commented regarding
this and can be found with a search on orb_id_size_t.
2023-08-08 10:59:34 +02:00
bresch
cd77d52dc1 ekf2: calcRotVecVariances using SymForce 2023-08-07 14:28:06 -04:00
Daniel Agar
d75bb62a65
ekf2: separate mag and mag heading control logic (#21212)
- split mag_3d into new standalone mag fusion and mag fusion allowed to update all states (full mag_3d)
 - new dedicated control logic for mag/mag_3d fusion and standalone mag heading fusion
 - if WMM available use for mag_I and mag_B init
 - mag states reset if external yaw reset (yaw estimator, GPS yaw, etc)
 - mag reset if declination changed (eliminate _mag_yaw_reset_req)
 - mag fusion (but not mag_hdg or mag_3d) can be active during gps_yaw or ev_yaw (if yaw aligned north)

Co-authored-by: bresch <brescianimathieu@gmail.com>
2023-08-04 10:39:16 -04:00
Daniel Agar
88e7452492
commander: collapse ArmStateMachine and simplify
- simplify vehicle_status.arming_state down to just armed and disarmed
    - ARMING_STATE_INIT doesn't matter
    - ARMING_STATE_STANDBY is effectively pre_flight_checks_pass
    - ARMING_STATE_STANDBY_ERROR not needed
    - ARMING_STATE_SHUTDOWN effectively not used (all the poweroff/shutdown calls loop forever in place)
    - ARMING_STATE_IN_AIR_RESTORE doesn't exist anymore
 - collapse ArmStateMachine into commander
     - all requests already go through Commander::arm() and Commander::dismarm()
 - other minor changes
     - VEHICLE_CMD_DO_FLIGHTTERMINATION undocumented (unused?) test command (param1 > 1.5f) removed
     - switching to NAVIGATION_STATE_TERMINATION triggers parachute command centrally (only if armed)

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2023-07-28 17:12:01 -04:00
Daniel Agar
84b6b472b4
ekf2: change delta angle and delta velocity bias states to accel and gyro bias (#21901)
* ekf2-test: remove outdated codegen comparison

The definition of states changed so the comparison with the old
derivation cannot work anymore.

---------

Co-authored-by: bresch <brescianimathieu@gmail.com>
2023-07-28 09:31:44 -04:00
Silvan Fuhrer
c0d9e2ac7a
commander: add warning for imminent navigation failure
Some system are able to dead-reckon for a while after losing GPS or
other sources providing positional feedback. If the estimated position
error grows above the failsafe threshold, the system enters a failsafe
mode. As the position error estimate is growing linerly over time, and
it is recommended to take action before entering the failsafe, we here
warn the user about the imminent failsafe and propose to take manual
control.

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-27 14:12:04 -04:00
Daniel Agar
e468798e91
Update world_magnetic_model to latest Thu Jul 27 11:14:06 UTC 2023
Co-authored-by: PX4 BuildBot <bot@px4.io>
2023-07-27 10:34:11 -04:00
PX4 BuildBot
37a6ac5c93 Update submodule mavlink to latest Thu Jul 27 12:39:22 UTC 2023
- mavlink in PX4/Firmware (3476e500bf5baa837314e09ff29deeabb719071b): e47dfbb4b7
    - mavlink current upstream: e04677782a
    - Changes: e47dfbb4b7...e04677782a

    e0467778 2023-07-27 JaeyoungLim - Clarify SET_ATTITUDE_TARGET quaternion field (#2020)
2023-07-27 10:32:27 -04:00
Beat Küng
351a9050c3 commander: update param description for COM_MOT_TEST_EN 2023-07-27 09:39:24 -04:00
Konrad
e4111a03bf mavlink-mission: Initialize the safepoint and mission counter from the dataman state.
If at the last powercycle one mission was uploaded, the counter in dataman was 1. On the next powercycle the mavlink mission counter was reset to zero and on first mission upload updated to 1 again. Other modules check, if the mission was changed based on the counter, like the mission.cpp loaded the mission counter from the dataman. On a new mission, the comparison of the counters failed, because both were the same value even if the mission was completely different.
2023-07-27 07:21:29 +02:00
Konrad
aa2c47a56b mission: On an updated mission, don't assume per default that the mission is not valid, use the state from the last mission validation. 2023-07-27 07:21:29 +02:00
Daniel Agar
82962acd5c sensors/vehicle_magnetometer: add mag calibration PX4_DEBUG output 2023-07-26 12:42:51 -04:00
Daniel Agar
d65ddbf810
simulation/sensor_gps_sim: lower GPS velocity variance
- for a multicopter EKF2 default required GPS speed accuracy is 0.5 m/s
2023-07-26 12:42:18 -04:00
Beniamino Pozzan
b9667e955d
[uxrce-dds-client]: add parameter to disable time synchronization between Agent and Client
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2023-07-26 09:16:29 -04:00
bresch
30d8df7001 mag_check: fix param type 2023-07-25 11:21:05 -04:00
bresch
99309625e8 preflt-chk: report strength and inclination failure values 2023-07-25 11:21:05 -04:00
Daniel Agar
19d6e69b0b
ekf2: allow yaw estimator to perform yaw alignment
This can be useful if using a full EV + GNSS setup and you start indoors, then fly outside. Once GPS is good and the only missing requirement is yaw alignment the yaw estimator reset is performed and EV yaw will automatically stop itself.
2023-07-25 10:58:45 -04:00
bresch
beb5fc5eb6 ekf-checks: set min and max values for required/failsafe eph 2023-07-24 15:10:07 -04:00
bresch
30bfe0d379 ekf2: remove artificial constraint on position uncertainty growth
There is no reason to contrsain the position uncertainty, estpecially
when flying with velocitiy aiding only.

Note that all the variances are already contrained to sane values at the
end of the covariance prediction
2023-07-24 15:10:07 -04:00
Daniel Agar
1ef9ee7622
ekf2: simplify fuseYaw() signature and use consistently
- make it safe to call for other aid sources, no EKF state is changed unless fusion_enabled
2023-07-24 10:34:00 -04:00
Daniel Agar
01bcc47fb1
ekf2: apply yaw reset to vision attitude error filter
- set vision attitude error filter uninitialized if vision data stops
 - ev error filter is only compiled when ev config is selected

Co-authored-by: bresch <brescianimathieu@gmail.com>
2023-07-24 10:32:33 -04:00
Junwoo Hwang
e626f8666c Geofence: Disable pre-emptive geofence predictor by default (#21657)
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2023-07-24 10:25:31 -04:00
bresch
a95c11d48a ekf2-test: add test for inclination of mag earth field 2023-07-24 10:16:37 -04:00
bresch
72be724b86 ekf2: log mag inclination and strength for tuning 2023-07-24 10:16:37 -04:00