116 Commits

Author SHA1 Message Date
Marco Hauswirth
4a5aa1e947
Fix max-hagl restriction to position/altitude control (#23667)
* fix max-hagl restriction to position/altitude control

* max hagl vel restriction in ManAcc position mode

* use interpolate func, change naming

* simplyfied vertical vel limitation

* move velocity-constraint adjustment to StickAccelXY
2025-01-20 15:50:21 +01:00
Daniel Agar
78bbb66568 delete SYS_MC_EST_GROUP
- introduce per module parameters (EKF2_EN, LPE_EN, ATT_EN)
 - add basic checks to prevent EKF2 + LPE running simultaneously
2024-04-15 16:06:08 -04:00
Mathieu Bresciani
0d6c2c8ce9
EKF2: Error-State Kalman Filter (#22262)
* ekf derivation: change to error state formulation
* ekf2: update auto-generated code for error-state
* ekf2: adjust ekf2 code for error state formulation
* ekf2_tests: adjust unit tests for error-state EKF
* update change indicator for error-state EKF
* ekf2_derivation: allow disabling mag and wind states

---------

Co-authored-by: bresch <[brescianimathieu@gmail.com](mailto:brescianimathieu@gmail.com)>
2023-10-31 10:02:18 -04:00
bresch
23b31cc5fd manual_yaw: compensate for yaw estimate convergence
When the yaw estimate is converging, the controller makes the drone yaw
in order to follow the current setpoint. This is unintuitive for the
pilot and it is preferable if the drone continues to fly towards the
same physical direction.
2023-08-30 09:56:19 +02:00
Matthias Grob
5ca28dd6dc Use isAllFinite() in all places that check finiteness on entire vectors or matrices 2022-10-19 19:09:20 +02:00
Daniel Agar
dfdfbbfa9c
msg/vehicle_odometry.msg: simplify covariance handling and update all usage (#19966)
- replace float32[21] URT covariances with smaller dedicated position/velocity/orientation variances (the crossterms are unused, awkward, and relatively costly)
 - these are easier to casually inspect and more representative of what's actually being used currently and reduces the size of vehicle_odometry_s quite a bit
 - ekf2: add new helper to get roll/pitch/yaw covariances
 - mavlink: receiver ODOMETRY handle more frame types for both pose (MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_ENU, MAV_FRAME_LOCAL_FRD, MAV_FRAME_LOCAL_FLU) and velocity (MAV_FRAME_LOCAL_NED, MAV_FRAME_LOCAL_ENU, MAV_FRAME_LOCAL_FRD, MAV_FRAME_LOCAL_FLU, MAV_FRAME_BODY_FRD)
 - mavlink: delete unused ATT_POS_MOCAP stream (this is just a passthrough)

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2022-08-04 12:55:21 -04:00
Daniel Agar
6135bb384b cleanup module callback registration failed errors 2022-03-23 20:44:50 -04:00
Daniel Agar
133fe0cfb1 local_position_estimator: move to INS0 work queue (for significantly more stack) 2022-02-08 11:16:49 -05:00
Thomas Debrunner
8db7a6225b geo: Moved the map_projection_* functions and state into a self-contained C++ class 2021-12-06 14:30:14 +01:00
Daniel Agar
263b00b65f
ekf2 support SET_GPS_GLOBAL_ORIGIN and remove globallocalconverter usage
- vehicle_command cmd extended from uint16 to support PX4 internal commands that don't map to mavlink
2021-03-05 18:25:14 -05:00
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
Daniel Agar
98cff94702 px4_work_queue: directly support SITL lockstep
- the purpose is to ensure that every WorkItem (and WorkItems scheduled
by WorkItems) is allowed to run to completion every step
 - per workqueue register a lockstep component whenever a work item is
added (if not already registered)
 - once the work queue is empty unregister component
2021-01-04 09:38:05 +01:00
Daniel Agar
20c2fe6d28 estimator messages add explicit timestamp_sample
- timestamp is uORB publication metadata
 - this allows us to see what the system saw at publication time plus the latency in estimation
2020-09-04 10:48:26 -04:00
Daniel Agar
9ccc1db649 estimator_status split out estimator_states 2020-09-04 10:48:26 -04:00
Daniel Agar
97fc1db768 vehicle_local_position: rename yaw -> heading and add reset logic
- vehicle_global_position yaw removed (redundant)
2020-08-10 11:42:03 +02:00
Daniel Agar
fa44cd5cd5 px4_work_queue: rename navigation_and_controllers -> nav_and_controllers
- keep the thread within the current NuttX max length
2020-07-14 09:48:47 -04:00
Beat Küng
71dcf8d619 sitl: use lockstep components API
- avoids the need for ekf2_timestamp publications by q and lpe
- adds logger to the lockstep cycle and makes it poll on ekf2_timestamps
  or vehicle_attitude. This avoids dropped samples (required for replay).
2020-06-23 11:53:55 -04:00
kritz
3897030c6f
Support odometry velocity in body and local frame (#14703)
* Update submodule ECL

* increase lower bound on EVV param
2020-05-13 12:43:02 +02:00
Daniel Agar
05886e053f mavlink_log_info: always print to console and merge with mavlink_and_console_log_info 2020-05-12 08:53:51 +02:00
Mohammed Kabir
5ffe88672e vehicle_odometry: add timestamp_sample field for latency monitoring 2020-04-28 13:58:43 -04:00
Daniel Agar
326d8efc16 move attitude controllers to new wq:attitude_ctrl 2020-04-27 21:34:35 -04:00
Daniel Agar
a89b69b0ea
vehicle_global_position: remove velocity fields (duplicates of local vx, vy, vz)
* attitude_estimator_q: get velocity from local position (if available)
2020-03-11 23:57:43 -04:00
Julian Oes
b53bd2b77f LPE: make compatible with lockstep simulation
This fixes SITL with lockstep when using LPE and q estimator.

The required changes are:
- Publish ekf2_timestamps because simulator_mavlink expects them.
- Run LPE at 250 Hz instead of 80 Hz in order to keep everything in
  lockstep running at 250 Hz.
2020-02-26 15:46:58 +01:00
Daniel Agar
c270e75156
vehicle_local_position: delete unused and redundant dist_bottom_rate 2020-01-18 12:50:57 -05:00
kamilritz
b73c80428e ECL: Clean velPos logging, deprecate ekf2_innovations msg 2019-12-05 11:29:29 +01:00
Daniel Agar
f271efaf62 local_position_estimator: move to WQ and delete unused SubscriptionPollable 2019-11-22 16:02:54 -05:00
Daniel Agar
2ad12d7977
sensors: create vehicle_angular_velocity module (#12596)
* split out filtered sensor_gyro aggregation from mc_att_control and move to wq:rate_ctrl
2019-08-06 12:55:25 -04:00
Daniel Agar
79d4c09d59
uORB::Publication simplify and cleanup
- base class is now template
 - drop linked list
 - virtualization no longer required
2019-06-12 08:48:19 -04:00
Daniel Agar
2c63e335e9 uORB::Subscription subscribe directly to uORB device node object 2019-06-03 17:06:21 -04:00
bresch
f08c00f324 Parameter update - Rename variables in modules/fw_pos_control
using parameter_update.py script
2019-04-03 15:38:50 +02:00
Nuno Marques
cfd1be584e Feature: VIO: add ODOMETRY stream (#11084)
* mavlink_messages: remove LOCAL_POSITION_NED_COV stream

* mavlink_messages.cpp: add ODOMETRY stream

* add MAV_ODOM_LP parameter to activate odometry loopback

* EKF2: add vehicle_odometry publisher

* Replace VISION_POSITION_ESTIMATE loopback with ODOMETRY

* LPE: add vehicle_odometry publisher

* set vehicle_odometry local_frame field

* mavlink_messages.cpp: ODOMETRY frame_id depends on MAV_ODOM_LP
2018-12-21 12:54:04 -05:00
Mara Bos
10c20b38ad Fix many format strings.
Fixes these invalid format strings:
- A `%d` for a pointer (replaced it by `%p`)
- A 0x%08x (and a 0x%0x8!) for a pointer (replaced by %p)
- 2 cases of `%d` for a `ssize_t` (replaced it by `%zi`)
- 1 case of a %u for an `int` (replaced by %i)
- 3 cases of %d for a `long` (replaced by %ld)
- 19 cases of `%d`, `%i`, `%u` or `%lu` for a `size_t` (replaced it by `%zu`)
- An unused formatting argument (removed it)
- A missing `%d` (added it)
- A missing `%s` (added it)
- 2 cases of `%llu` for a `uint64_t` (replaced it by `"%" PRIu64`)
- 6 cases of giving a string directly as format string (replaced it by `("%s", string)`)
- 2 cases of %*-s, which should probably have been %-*s.
  (Looks like NuttX accepts (the invalid) %*-s, but other platforms don't.)
- A %04x for a `uint32_t` (replaced by "%04" PRIx32)
2018-10-27 12:44:51 +02:00
TSC21
8325724079 general fixes on VIO data access 2018-09-18 09:52:33 +02:00
TSC21
efe312d4a6 style and format clean 2018-09-18 09:52:33 +02:00
TSC21
048ff56890 lpe: add vehicle_odometry and data validation handlers; improve inout interface 2018-09-18 09:52:33 +02:00
Daniel Agar
da68ea0d11 estimator_status delete unused nan_flags 2018-08-03 17:42:48 -04:00
Daniel Agar
9ce83f2208 fix all sign-compare warnings 2018-07-01 09:36:55 +00:00
Daniel Agar
cf74166801 double promotion warning fix or ignore per module 2018-07-01 09:36:55 +00:00
Mohammed Kabir
9483885ed9 lpe : update for compatibility with new navigation limits architechture 2018-06-09 13:38:04 +02:00
Daniel Agar
d75fd72c02 stop manually defining physical constants 2018-04-19 07:24:58 +02:00
Daniel Agar
3b5b12e1d1 move baro and magnetometer data out of sensor_combined 2018-04-11 23:26:58 -04:00
Beat Küng
7ee464c264 LPE: refactor to use ModuleParams 2018-03-13 17:35:15 +01:00
Beat Küng
9fb9b2916a LPE: use default & delete keywords for constructors & destructors 2018-03-13 17:35:15 +01:00
Daniel Agar
458db2e508 vehicle_global_position remove redundant evh and evv
- vehicle_status_flags condition_global_velocity_valid is also unnecessary
2018-03-05 13:20:28 -05:00
Daniel Agar
b9081fb0ab vehicle_global_position delete unused pos_d_deriv 2018-03-05 01:41:18 -05:00
Paul Riseborough
c294393377 local_position_estimator: update local_position publication
Ensure all data is set.
2018-01-29 22:30:34 +01:00
Nicolas de Palezieux
dd1d0adfef LPE : add support for precision landing measurement fusion 2018-01-15 10:27:23 +01:00
TSC21
ec1c37e1af modules: lpe: push sensor status update to object; prioritize lidar readings over sonar 2018-01-14 22:52:41 +01:00
TSC21
b512759336 modules: lpe: refactor fusion bitmask 2018-01-14 22:52:41 +01:00
stmoon
8b3ea27bb3 correct coding style 2018-01-14 12:55:47 +01:00