290 Commits

Author SHA1 Message Date
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
7b46efaa6b logger: record message gaps 2020-07-29 13:36:22 -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
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
BazookaJoe1900
5e343b104e
logger: using ModuleParams (#14316)
and some cleanups on main()
2020-03-13 11:31:43 +01: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
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
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
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
Daniel Agar
931a3f2684
logger: publish initial logger_status orb message 2020-01-29 17:29:30 -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
Beat Küng
e10a4c5002 refactor logger: move subscription initialization into separate class 2019-12-17 21:22:30 -08:00
Beat Küng
738ceab0ee Logger: dynamic number of subscriptions
Keep a fixed-size array of 250 requested topics on the stack, then allocate
an array with LoggerSubscription with the exact required size.
2019-12-17 21:22:30 -08:00
Beat Küng
2757647897 refactor logger: reduce required size of WrittenFormats
by keeping only recursive topics in there. The rest is checked by looking
at previous _subscriptions.

Reduces stack size requirements when increasing MAX_TOPICS_NUM.
2019-12-17 21:22:30 -08:00
JaeyoungLim
94e05362e1 Make cellular status logging default 2019-12-14 21:56:12 +11:00
kamilritz
b73c80428e ECL: Clean velPos logging, deprecate ekf2_innovations msg 2019-12-05 11:29:29 +01:00
Daniel Agar
1a395fb6d9 ST ISM330DLC IMU driver 2019-12-03 16:16:49 -05:00
JaeyoungLim
6bd4273b9c mavlink: handle cellular_status messages for logging 2019-11-13 09:19:02 -05:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Daniel Agar
a7f330075a clang-tidy: enable hicpp-braces-around-statements and fix 2019-10-28 10:50:31 -04:00
Jaeyoung-Lim
29987a4f80 Address comments 2019-10-27 11:47:10 +00:00
Jaeyoung-Lim
58d646e33d Log CPU loads 2019-10-27 11:47:10 +00:00
Daniel Agar
c8e59c4e39 parameter_update use uORB::Subscription consistently 2019-09-29 10:49:03 -04:00
kritz
7427768e70 ECL reference frame alignment fix (#12771)
* Fix EKF frame alignemen in ECL

* Remove empty lines

* Add initalization for ev_odom

* Only use yaw covariance for angErr

* Improve frame naming in comments

* Use copyTo

* Add aligned as suffix

* Add missing vehicle_visual_odometry_aligned
2019-09-23 14:24:52 -04:00
Silvan Fuhrer
ff6577ce5f EKF and AirspeedSelector: publish multiple wind estimate topic instances and log them all
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-09-01 14:05:06 -04:00
Beat Küng
7f6a9e587f logger: fix multiple format definitions for multi-instance topics
With https://github.com/PX4/Firmware/pull/12123 all multi-instance topics
lead to repeated format definitions in the ULog file.
2019-08-21 10:47:31 -04:00
Beat Küng
166639be3a logger: unconditionally call _writer.notify()
The file writer thread could get into a state where it blocked infinitely
on pthread_cond_wait() (or rather until the logging stops).

This is very rare and the following conditions must be met:
- the buffer is almost empty (<4KB filled), so that the writer thread does
  not write anything.
- an fsync call is scheduled (happens once every second)
- the fsync call takes a long time (several 100ms), during which time the
  complete log buffer fills up.

The main thread would then get into dropout state where it does not call
_writer.notify() anymore.

Notifying the writer thread on every loop update of the main thread fixes
that.

It does not increase resource usage.
2019-08-12 08:07:37 +02:00
Silvan Fuhrer
cedf14e2ba Airspeed Selector: repurpose wind estimator into an airspeed (selection, validation) module.
This new airspeed module does:
  -runns an airspeed validator for every airspeed sensor present, which checks measurement validity and estimates an airspeed scale
  -selects another airspeed sensor if for the current one a failure is detected
  -estimates airspeed with groundspeed-windspeed if no valid airspeed sensor is present
  -outputs airspeed_validated topic

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-08-09 10:55:05 +02:00
Daniel Agar
83e532d339
logger move to uORB::SubscriptionInterval (#12123) 2019-08-07 11:02:16 -04: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
6f2d1d55f6 logger use uORB::PublicationQueued for ulog_stream
- queue depth is now set by the msg
2019-08-06 11:07:59 -04:00
Daniel Agar
5b511eaa1a logger move non-logged subscriptions to uORB::Subscription 2019-08-06 11:07:59 -04:00
Daniel Agar
e69398c09f introduce uORB::PublicationQueued and transition most orb_advertise_queue usage 2019-08-04 10:08:09 -04:00
David Sidrane
e296297ab7 Revert "hotfix for logger: use '%i' instead of '%zu'"
This reverts commit e6aa03520993201c618de32197ab3ee92d4b0738.
  Root cause was fixe in Nuttx and backported
2019-07-25 05:28:46 -07:00
Beat Küng
e6aa035209 hotfix for logger: use '%i' instead of '%zu'
Work-around for https://github.com/PX4/Firmware/issues/12485.

This can be reverted after the root-cause is fixed.
2019-07-16 13:11:41 +02:00
Martina Rivizzigno
0ee770e853 logger: log obstacle_distance_fused instead of obstacle_distance 2019-07-15 10:58:00 +02:00
Beat Küng
a2471fb539 logger: handle 'char' type in messages
Fixes errors like:
ERROR [logger] No definition for topic char[10] key;uint8_t[2] _padding0; found
when the Debug logging profile is selected.
2019-07-03 10:43:59 +02:00
Bharat Tak
1ebf5d04d9 logger: add Ulog sync bytes at 1Hz and tagged log message definition (#12144) 2019-06-11 11:00:54 +02:00
Daniel Agar
97c2dba2fa logger move print_usage() to bottom of file and format 2019-06-08 03:23:50 -07:00
Beat Küng
0d71eeccbf console buffer: write to log as 'boot_console_output' message 2019-06-04 11:57:54 +02:00
Daniel Agar
2c63e335e9 uORB::Subscription subscribe directly to uORB device node object 2019-06-03 17:06:21 -04:00