279 Commits

Author SHA1 Message Date
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
Beat Küng
ed9d25a75a logger: add arming/disarming via AUX1 RC channel logging mode 2019-05-29 11:41:22 +02:00
Daniel Agar
0206375de6 logger reduce default topics 2019-04-09 10:14:49 -04:00
Daniel Agar
6648937789 logger increase stack 3600 -> 3700 bytes 2019-04-03 14:32:45 -04:00
DanielePettenuzzo
15abb159a8 camera_capture: change topic namings to make logging, mavlink streaming and geotagging easier 2019-02-10 18:07:44 -05:00
Daniel Agar
2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Beat Küng
dc49e259b3 logger: add separate profile for vision/avoidance
Keeps things more modular.
2018-12-07 11:51:59 +01:00
Beat Küng
fced1ce33b logger: remove some unused logged topics in SITL 2018-12-07 11:51:59 +01:00
Daniel Agar
3e0a3559a9 cmake use standard mechanisms for settings flags 2018-11-26 14:40:14 -08:00
baumanta
db514fe441 Add a collision avoidance library which uses range data 2018-11-20 14:11:33 +01:00
Daniel Agar
bba475aca1 logger limit trajectory_setpoint rate 2018-11-19 09:59:22 -05:00
TSC21
05d9932f6c logger: limit vehicle_*_odometry topics to 30hz on default logging 2018-11-16 09:44:32 +01:00