389 Commits

Author SHA1 Message Date
Jacob Dahl
a24488328f
Move GPS blending from ekf2 to sensors module
- new sensors work item that subscribes to N x sensor_gps and publishes vehicle_gps_position
 - blending is now configurable with SENS_GPS_MASK and SENS_GPS_TAU

Co-authored-by: Jacob Crabill <jacob@volans-i.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2020-09-25 23:28:31 -04:00
Daniel Agar
861e06dfd7
mavlink: handle receiving GENERATOR_STATUS
- only published (ORB_ID(generator_status)) and logged for now
2020-09-25 11:36:58 -04:00
Daniel Agar
0dc8bb9c86
uORB: increase ORB_MULTI_MAX_INSTANCES 4 -> 10
- put more realistic bounds on maximum number of battery instances, gps, etc
2020-09-24 11:01:28 -04:00
Daniel Agar
d676e65294
logger: log_writer_file increase stack 1170 -> 1472 bytes (#15765) 2020-09-21 22:17:31 -04:00
Daniel Agar
60d613ea04
sensors: sensor_preflight_imu -> sensors_status_imu and run continuously
- inconsistency checks now run continuously instead of only preflight
 - keep inconsistencies for all sensors
 - add per sensor data validator state as overall health flag
2020-09-06 22:06:13 -04:00
Daniel Agar
023f6d3983
NuttX cpuload monitoring optimization
- Nuttx only process all suspend & resume scheduling notes when top is running, otherwise only track IDLE
 - convert cpuload and print load to c++
 - delete unused fields from print_load struct
 - update hrt_store_absolute_time (previous unused)
2020-09-05 14:35:50 -04:00
Daniel Agar
9ccc1db649 estimator_status split out estimator_states 2020-09-04 10:48:26 -04:00
Daniel Agar
978e35478f
logger: add_topic_multi optional specify max multi-instance (#15647) 2020-09-01 09:36:32 +02:00
Daniel Agar
1d0188fc07 logger: add vehicle_acceleration to default topics 2020-08-23 17:38:27 -04:00
Daniel Agar
971b1e4b4d sensors: move mag aggregation to new VehicleMagnetometer WorkItem
- purge all reminaing magnetometer IOCTL usage
 - mag calibration add off diagonal (soft iron) scale factors
2020-08-21 10:12:13 -04:00
TSC21
56a105e322 logger: by default, log the onboard_computer_status topic 2020-08-17 13:24:12 +02:00
Daniel Agar
e4fa7597f4
logger: SDLOG_PROFILE remove estimator replay from default to minimize log rate
- log full sensor_combined by default for now
 - small decrease to input_rc rate (manual_control_setpoint is no longer filtered)
 - sensor_correction can be logged at full rate (low publication rate)
2020-07-29 15:07:42 -04:00
Daniel Agar
1b30bd328e logger: decrease try subsribe interval 1000 ms -> 20 ms 2020-07-29 13:36:22 -04:00
Daniel Agar
7b46efaa6b logger: record message gaps 2020-07-29 13:36:22 -04:00
Daniel Agar
81f57bccb6 px4io: servorail_status -> px4io_status and log all flags 2020-07-21 09:56:13 -04:00
Daniel Agar
42493b3d59 logger: add full commander and safety logging by default
- increase battery_status rate to be useful
2020-07-17 17:27:15 -04:00
Beat Küng
d22bbde7c5 logger: fix hardfault for invalid SDLOG_PROFILE setting
If some bits are set but no topic was added, _subscriptions was null but
later accessed.

During normal use this only happens when switching between different
firmware versions with different SDLOG_PROFILE definition (with custom
config).
2020-06-29 09:49:56 -04:00
Beat Küng
fe9a971f0e logger: use subscription interval also in polling mode
Now that replay uses lockstep scheduling we don't need that work-around
anymore.
2020-06-23 11:53:55 -04:00
Beat Küng
a3d1c94aa4 logger: reduce poll timeout to 20ms
Just to ensure even if the topic is not updated, logger will still update
regularly.
2020-06-23 11:53:55 -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
Matthias Grob
e9eae1bd76 Refactor: Name manual_control_setpoint the same way everywhere 2020-06-22 12:06:27 -04:00
Beat Küng
0fcb873636 logger: add raw FIFO high-rate IMU logging profiles
Minimum requirement to use: set IMU_GYRO_RATEMAX to 400.

Logging rate of a single topic: ~85 KB/s. If multiple should be logged,
a really good SD card has to be used.
2020-06-09 09:58:15 -04:00
Daniel Agar
e34bdb4be9
move IMU integration out of drivers to sensors hub to handle accel/gyro sync
- IMU integration move from drivers (PX4Accelerometer/PX4Gyroscope) to sensors/vehicle_imu 
 - sensors: voted_sensors_update now consumes vehicle_imu
 - delete sensor_accel_integrated, sensor_gyro_integrated
 - merge sensor_accel_status/sensor_gyro_status into vehicle_imu_status
 - sensors status output minor improvements (ordering, whitespace, show selected sensor device id and instance)
2020-05-30 11:07:54 -04:00
Daniel Agar
2a2d9e9eba logger: keep typical log path within a single mavlink message 2020-05-06 08:31:40 +02:00
Daniel Agar
466b5db36f
uORB::Publication improvements and cleanup (#14784)
- create common uORB::PublicationBase
 - uORB::PublicationQueued types are now type aliases
 - ORB_PRIO use enum type everywhere to avoid accidental misuse
 - PX4Accelerometer/PX4Gyroscope/etc driver libs explicitly advertise on construction, unadvertise on destruction. This is a workaround for any potential issues that might appear when accel/gyro cdev and uORB indexing doesn't align.
2020-05-04 11:09:30 -04:00
Beat Küng
4e0441ab0b logger: add data format version tag 2020-04-07 09:59:12 -04:00
Beat Küng
40af5b0fbe logger: fix initial subscribing to topics
write_all_add_logged_msg() requires at least some subscriptions to be added
initially, as this message is used to separate ULog header from data.
2020-03-20 11:21:32 +01:00
Paul Riseborough
ab92b46e69
Update ecl to add ability to recover from bad magnetic yaw
* msg: Add EKF-GSF yaw estimator logging data
* ecl: update to version with EKF-GSF yaw estimator
* ekf2: Add param control and logging for EKF-GSF yaw estimator
* logger: Add logging for EKF-GSF yaw esimtator
2020-03-15 12:57:25 -04:00
BazookaJoe1900
5e343b104e
logger: using ModuleParams (#14316)
and some cleanups on main()
2020-03-13 11:31:43 +01:00
Daniel Agar
093e9ba1ce
mc_rate_control: use vehicle_angular_acceleration topic instead of differentiating
* mc_rate_control: use vehicle_angular_acceleration topic
* IMU_DGYRO_CUTOFF change default to 30 Hz
* improve IMU_DGYRO_CUTOFF param documentation (updated from MC_DTERM_CUTOFF)
2020-03-12 15:07:03 -04:00
Daniel Agar
9585055e9e
uORB: add bitset for faster orb_exists check and remove uORB::Subscription lazy subscribe hack/optimization
- add PX4 bitset and atomic_bitset with testing
 - add uORB::Subscription constructor to take ORB_ID enum
 - move orb test messages into msg/
2020-03-11 09:06:33 -04:00
Roman Dvořák
e43aa4e287
logger: add RPM sensor messages 2020-03-09 18:34:06 -04:00
bazooka joe
887d846f7a remove one space from string sent with the logger filename
now the full file name is sent, and not missing the last seconds digit
2020-03-08 12:07:51 +01:00
Dusan Zivkovic
d7a9b123e6 logger: fix thread deadlock 2020-03-06 13:37:34 +01:00
Julian Oes
3be8b3d177 logger: style fix 2020-02-26 14:52:39 +01:00
Paul Riseborough
d9ae242760 logger: fix unused variable build error 2020-02-26 18:44:20 +11:00
Daniel Agar
2a0fe169e6 logger: disable logger_status publiation in replay builds
- this is disabled in replay builds to ensure all data in ekf2 replay logs only contains the same time range, otherwise the plots can be unreadable using common tools
 - fixes #14230
2020-02-26 18:44:20 +11:00
Beat Küng
d386591d0c logger: reduce rate_ctrl_status rate to 50 Hz for high-rate logging
The integral does not need to be logged at full rate
2020-02-25 09:59:52 +01:00
Daniel Agar
2015cc2b39 logger: restore buffer statistics update
- this was accidentally dropped during a rebase of #14050
2020-02-10 00:17:28 -05:00
bresch
0f1c7590e9 HoverThrustEstimator: add a new single state estimator
with measurement noise auto-tuning

The purpose of this estimator is to improve land detection and vertical
velocity feedforward

Recovery strategy:
This is required when the setpoint suddenly changes in air or that the
EKF is diverging. A lowpassed test ratio is used as a trigger for the recovery logic
Also, a lowpassed residual is used to estimate the steady-state value
and remove it when estimating the accel noise to avoid increasing the
accel noise when the redisual is caused by an offset.
2020-02-07 11:52:52 +01:00
Nicolas Martin
cfa74b9106 logger: choose logged instances by logger_topics file
new versions of logger does not allow to log multiple instances of a topic when using 'logger_topics.txt'

This commit restores the default behavior (log all instances of a topic) and ad the option to specify an instance to log
2020-01-31 09:43:29 +01:00
Daniel Agar
931a3f2684
logger: publish initial logger_status orb message 2020-01-29 17:29:30 -05:00
Daniel Agar
10410fc868 msg: rename sensor_bias -> estimator_sensor_bias 2020-01-27 09:03:27 +01:00
Daniel Agar
d1260aa28c logger: add safety (switch) at minimal rate 2020-01-20 14:30:24 -05:00
Daniel Agar
bb465ca5b7
sensor accel/gyro message cleanup
- split out integrated data into new standalone messages (sensor_accel_integrated and sensor_gyro_integrated)
 - publish sensor_gyro at full rate and remove sensor_gyro_control
 - limit sensor status publications to 10 Hz
 - remove unused accel/gyro raw ADC fields
 - add device IDs to sensor_bias and sensor_correction
    - vehicle_angular_velocity/vehicle_acceleration: check device ids before using bias and corrections
2020-01-18 01:15:00 -05:00
tzai
fb0bf26787 logger: refactor start_stop_logging
Cleans up function by reducing duplicate code and local variable count

Signed-off-by: Tal Zaitsev <tal@corvus-robotics.com>
2020-01-13 13:19:47 +05:30
tzai
b9d85c7176 logger: Refactor new boot_bat logic into separate function
Implements suggested fixes.

Signed-off-by: Tal Zaitsev <tal@corvus-robotics.com>
2020-01-11 22:27:00 +05:30
tzai
1c2f95697c logger: Add support for logging only on bat power
Will not start logging from boot if battery is not connected

Signed-off-by: Tal Zaitsev <tal@corvus-robotics.com>
2020-01-11 22:27:00 +05:30
Daniel Agar
156cf16265
logger: log all raw sensor data at a minimal rate 2020-01-02 13:15:02 -05:00
Beat Küng
e10a4c5002 refactor logger: move subscription initialization into separate class 2019-12-17 21:22:30 -08:00