3244 Commits

Author SHA1 Message Date
bresch
5e986f6997 wind_est: correctly include sideslip in initialization model 2023-10-09 21:03:38 -04:00
Beat Küng
2e1d5687f9 fix events: use px4_add_library instead of add_library
Fixes `make uorb_graphs`
2023-10-06 10:24:23 -04:00
Konrad
007ed11bbe Mission+RTL: Refactoring mission and RTL to keep them separate. RTL does all its mission related computation in its own class.
Dataman: Add write function to dataman cache.

RTL and mission have a new common base class mission_base. Both inherit from them and mission, RTL mission, and rtl reverse mission inherit from them and implement their desired functionalities. This simplifies the logic in mission as well as make the logic in rtl mission reverse and mission more readable.
Rtl mission reverse now functional again for VTOL flying back the mission and transitioning to MC at the home position.
Dataman cache has new write functionality to write to dataman while updating write item in its cache if necessary.
Dataman cache is now only updated when the respective module is active. Leads to a higher computation time once on activation, but decreases unnecessary cache updates when inactive.
2023-09-29 14:25:03 +02:00
Silvan Fuhrer
1a7e438099 Param translation: remove all param translations up to 1.14 release
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-09-29 11:07:46 +02:00
Matthias Grob
a03af59c5c battery: show unknown cell count
Unkown cell count is the default and
should be possible to select again from the drop down.
2023-09-28 07:32:06 +02:00
Ville Juven
6cb2c176d5 events: Move implementation of events::send() to lib/events
Events have a global, system-wide sequence number, which must be handled
atomically, (fetching and incrementing the sequence AND sending the event
to uORB must be atomic). Currently in FLAT mode, only one instance of this
sequence number exists, so it is OK to have it in px4_platform.

However, in PROTECTED mode px4_platform is instantiated both in kernel-
and user spaces, which makes two instances of this sequence number, which
causes problems in the mavlink event handling logic.

When mavlink receives and handles events, it expects that:
- The sequence numbers arrive in order (seq n is followed by n+1 etc)
- It increments by 1
- There is only one instance of the sequence number

In PROTECTED mode this is violated, as the kernel and user sequence
numbers run freely on their own. This patch fixes the issue by moving
the event backend to the kernel and by providing user access to it via
ioctl.
2023-09-25 09:54:11 +02:00
Matthias Grob
24111df176 mc_att_control_main: zero minimal thrust when landed
but this time compared to
2fbb70d9ca94f442de1345221be18ba738cda952
the minimum thrust is ramping to not produce a thrust jump.

The better long term solution will be to always have airmode but
with the effect limited to a magnitude of MPC_MANTHR_MIN.
2023-09-21 17:25:53 +02:00
bresch
9c41c06325 square matrix: add function to uncorrelate part of the matrix 2023-09-19 09:37:50 -04:00
bresch
b612467593 square matrix: add partial trace computation
This is useful when we need the sum of some variances in a large
covariance matrix
2023-09-19 09:37:50 -04:00
Thomas Stastny
def4ce6ba8 FixedwingPositionControl: slightly simplify manual position control (use navigateLine() to be sure no turnaround)
make notes on odd things that are likely still wrong
2023-09-08 16:08:38 +02:00
Thomas Stastny
413f66549d npfg: update signed track error state 2023-09-08 16:08:38 +02:00
Matthias Grob
38b0de94c1 system_params: improve distance sensor check description 2023-09-05 13:11:20 -04:00
Matthias Grob
d2819ca754 FunctionsMotors: include motors instead of servos topic 2023-08-31 16:56:08 -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
Beat Küng
8e1dd710a6 parameters: remove indentation from json output
Reduces parameters.json.xz by ~3KB on v5x.
2023-08-21 20:55:09 -04:00
PX4 BuildBot
28a34ef56c Update world_magnetic_model to latest Fri Aug 11 11:14:05 UTC 2023 2023-08-11 08:58:57 -04:00
Jukka Laitinen
c0084ab24d Fix maximum rotation value in GetBoardRotation()
Fix a memory overflow in case SENS_BOARD_ROT is set to Rotation::ROTATION_MAX (41) which is not a valid value

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-10 07:54:53 +02:00
bresch
01fc4c3cf1 SquareMatrix: add functions to copy upper and lower triangle 2023-08-08 12:09:56 -04:00
Daniel Agar
95b3005679
lib/world_magnetic_model: add constants for min/max/mean/median field strength
- add geo_magnetic_tables.hpp comments for blackout zone warnings
 - reduce unnecessary precision in generated tests (should reduce future update noise)
 - update copyright year
2023-07-28 17:14:25 -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
Igor Mišić
c40a38bd88 dataman: remove locking mechanism 2023-07-24 13:10:31 +02:00
Igor Mišić
d5ecfe0efe dataman_client: increase px4_poll timeout to 100_ms 2023-07-24 13:10:31 +02:00
Igor Mišić
e14216c6c7 dataman_client: prevent loading duplicates in the cache 2023-07-24 13:10:31 +02:00
Igor Mišić
6453a1c311 datamanClient: add Doxygen documentation for the API. 2023-07-24 13:10:31 +02:00
Igor Mišić
1e49eb419d datamanClient: add DatamanCache class 2023-07-24 13:10:31 +02:00
Igor Mišić
e6cc3d0118 datamanClient: add async functions 2023-07-24 13:10:31 +02:00
Igor Mišić
208552fdab dataman: add DatamanClient with sync functions
Rework of dataman
2023-07-24 13:10:31 +02:00
Daniel Agar
ec9dce2e89
Update world_magnetic_model to latest Tue Jul 18 11:14:09 UTC 2023
* Update world_magnetic_model to latest Tue Jul 18 11:14:09 UTC 2023
* [AUTO COMMIT] update change indication


Co-authored-by: PX4 BuildBot <bot@px4.io>
2023-07-18 14:29:08 -04:00
bresch
15bb8c0f2e AlphaFilter: add unit tests for Rot3 filtering 2023-07-17 13:43:18 +02:00
bresch
c6aa82441f AlphaFilter: add quaternion specialization
Filtering 3D rotations require special care as they live on a curved space.
2023-07-17 13:43:18 +02:00
Matthias Grob
618724b409 Functional gtests: remove unnecessary subscription updates
A new subscription is updated on instanciation and no additional
update needs to be called for processing the first sample.
2023-07-13 12:00:35 +02:00
bresch
2f52926972 mag_cal: fix mag bias estimate to mag cal
- since last_us is set to 0 every time the bias is not observable, the
  total time was also reset -> needed 30 consecutive seconds in mag 3D
  to be declared "stable"
- after landing, the mag_aligned_in_flight flag is reset. Using this for
  bias validity makes it invalid before we have a chance to save it to
  the calibration.
2023-07-11 11:33:53 -04:00
Matthias Grob
a8bf47e606 Set default minimum and maximum PWM for motors
This allows to consistently define:
Motor stopped - disarmed PWM
Motor idling - minimum PWM
Motor at full thrust - maximum PWM

Any allocation can then distinctly decide if
a motor should be running or not depending
on the context and also explicitly command that.
2023-07-10 18:58:37 +02:00
Patrick José Pereira
39e04d9712 lib: matrix: SquareMatrix: Deal with the special case of M=1
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2023-07-06 08:24:33 +02:00
bresch
c99f56f010 wind_estimator: update generated code to Symforce 0.9.0 2023-06-26 14:10:54 -04:00
bresch
73e5ff109c wind_estimator: update derivation to use SymForce 0.9.0 2023-06-26 14:10:54 -04:00
Thomas Debrunner
fd267fb9a5 param save: Add a blocking API for param saves to be used from shell. 2023-06-21 08:19:52 +02:00
Matthias Grob
53b9e66c66 RateControl: allow setting individual saturation flags
This helps for more complicated cases where certain axes are controlled
through and get feedback from a different allocator.
2023-06-19 10:59:20 +02:00
Matthias Grob
a28ad8e845 mixer_module: consistent PWM/oneshot calibration range 2023-06-16 12:05:47 +02:00
Matthias Grob
1ceca8f2cf actuator_test: condition order refactoring 2023-06-16 12:05:47 +02:00
Matthias Grob
94d2140a4f mixer_module: remove unnecessary init state
That state only delayed the first arming by 50 miliseconds.
Was presumably a workaround for some issue very very early on.
See cc452834c0dabd2689f5f102ce1cbbe714f056dd
2023-06-09 21:15:08 -04:00
Matthias Grob
0f256718d3 mixer_module: correct pwm ramp
Before:
When the mixed throttle for the motor was exactly zero the ramp went
from the disarmed PWM value to the minimum PWM value.

When the throttle was even just slightly different from zero the ramp
made a jump up to the commanded throttle scaled between
disarmed PWM and maximum PWM, then ramped between
disarmed PWM and minimum PWM and at the end jumped up again to
the commanded throttle scaled between minimum PWM and maximum PWM.

After:
The ramp goes from disarmed PWM value to the the
commanded throttle scaled between minimum PWM and maximum PWM.
If the commanded throttle changes during the ramp then the scale and
hence also end value of the ramp changes.
2023-06-09 21:15:08 -04:00
Beat Küng
7230a6dd8e commander: add option to exclude mag to param SYS_FAC_CAL_MODE 2023-06-09 21:05:40 -04:00
mcsauder
b8ad9bdbe5 Add magnetometer thermal compensation. 2023-06-07 12:07:29 -04:00
oneWayOut
6ee2d796ea delete unused ECL_LIB_GIT_VERSION
Since 'ecl' is nomore a git submodule, code lines related to
'ECL_LIB_GIT_VERSION' could be deleted
2023-06-06 11:24:49 -04:00
bresch
d03f242c04 DCM: use simplified conversion from unit quaternion
This is exactly equivalent for a unit quaternion (and only unit
quaternions should be used to encode a rotation)
2023-06-05 11:58:42 -04:00
Eric Katzfey
d2011e99b2
commander: add Open Drone ID arming check (#21652) 2023-06-01 07:52:52 +02:00
Beat Küng
db18a94382 refactor param: reduce flash usage
Reduces usage by ~1.5KB
2023-05-31 07:45:20 +02:00
Beat Küng
1bfca24fa9 refactor param: move autosave to px4::wq_configurations::lp_default work queue
Changes initialization order as param_init now depends on wq manager
2023-05-31 07:45:20 +02:00
Thomas Debrunner
f0dd9fa445 param: Add contained-params-bitset export interface to the param layers
Allows for efficient looping over the contained data
2023-05-31 07:45:20 +02:00