Commit Graph

294 Commits

Author SHA1 Message Date
Andrew Tridgell 71e4d72fe3 AP_Logger: removed 64k limitation on log buffer
the reason for the limit is gone with AP_FileSystem
2020-11-10 16:15:45 +11:00
Andrew Tridgell 2945de4796 AP_Logger: use WITH_SEMAPHORE in _WritePrioritisedBlock
this prevents a 1ms delay when waiting for the semaphore
2020-11-10 16:15:45 +11:00
Andrew Tridgell 851cb30e0d AP_Logger: speed up startup with replay if LOG_DISARMED=0 2020-11-10 16:15:45 +11:00
Andrew Tridgell b7d60b1d97 AP_Logger: added C field to EKF msgs 2020-11-10 16:15:45 +11:00
Andrew Tridgell 09aff03edc AP_Logger: support new replay system
added allow_start_ekf and block write method for replay

Co-authored-by: Peter Barker <pbarker@barker.dropbear.id.au>
2020-11-10 16:15:45 +11:00
Andrew Tridgell daa0abeb13 AP_Logger: make structure check errors clearer
add message name to more error messages
2020-11-10 16:15:45 +11:00
Andrew Tridgell bd7ed003c2 AP_Logger: split out EKF messages and prepare for new replay
adds core to more EKF message structures

Co-authored-by: Peter Barker <pbarker@barker.dropbear.id.au>
2020-11-10 16:15:45 +11:00
Michael du Breuil 25ca2a0828 AP_Logger: Reserve space in PM for last internal error line 2020-11-03 11:04:13 +11:00
Andrew Tridgell 66596dcf25 AP_Logger: allow for retry of log open with LOG_DISARMED=1
if booting without a microSD and with LOG_DISARMED=1 then this allows
for a retry of opening the log every 5s
2020-10-27 20:35:56 +11:00
Patrick José Pereira 258083a6f2 AP_Logger: AP_Logger_File: Set custom log directory in init
`_log_directory` was used before `ensure_log_directory_exists`,
to fetch the log path

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-10-20 09:31:49 +11:00
Michael du Breuil b04844ca13 AP_Logger: Log all vibration instances 2020-10-06 14:20:49 +11:00
Randy Mackay d9b90bf19f AP_Logger: VISP and VISV get ignored field 2020-10-06 09:18:04 +09:00
Peter Barker 8e6cde25dc AP_Logger: keep pointer to link rather than using its ->chan 2020-09-25 09:01:00 +10:00
Andy Piper dc0084a2b2 AP_Logger: only write final log out a page at a time to avoid lock contention
remove health check timing hack
2020-09-21 20:44:34 +10:00
Mark Whitehorn f25a1e7a0d AP_Logger: fix description of BAT.Res 2020-09-21 08:50:49 +10:00
Andy Piper d036b57de3 AP_Logger: stop logs safely in the block logger and asynchronously where possible 2020-09-17 10:45:57 +10:00
Andrew Tridgell 930726ca9a AP_Logger: fixed string warnings 2020-09-15 09:40:03 +10:00
Andy Piper 3bbac765f0 AP_Logger: correct units on raw accel data 2020-09-13 12:15:33 +10:00
Randy Mackay 36dee8791a AP_Logger: revert adding PSCP log structure 2020-09-12 08:10:33 +09:00
Iampete1 9753a20404 AP_Logger: add PSCP log structure 2020-09-11 10:12:08 +10:00
Iampete1 02c225ee93 AP_Logger: add structure for PSC message 2020-09-11 10:12:08 +10:00
Andrew Tridgell bea9769b82 AP_Logger: log unhealthy barometers 2020-09-09 06:35:50 +10:00
Andy Piper 5c554221c7 AP_Logger: address review commenst from #14299 2020-09-06 09:12:59 +10:00
Andy Piper ccb583d092 AP_Logger: make block logger conform to mavlink expectations of numbering
add support for log time to block logger
refactor rotation into backed. Don't start logs when erasing
correct log start logic
separate read and write points so that requesting log information does not corrupt the current log
when starting a new log stop logging first
clear the write buffer when starting a new log
insert utc time when requesting info for the current log
stop logging and request formats again when starting a new log
cope with erase happening while we are logging
keep pushing out startup messages even when format messages are done
don't log to the gcs in the io thread
don't start new logs in the io thread
don't validate logs while erasing
flush logs when stopping logging
account for page header when calculating logs sizes
don't return data when asked for more data than in the log
optimize locking and use separate semaphore to mediate ring buffer access
stop logging when the chip is full and send a notification
calculate logs sizes correctly even when they wrap
read log data correctly even when it wraps
add stats support to block logger
reset dropped when starting a new log
fail logging when the chip is full
refactor critical bufferspace checks
increase messagewriter budget to 250us and to 300us for FMT
2020-09-05 10:20:39 +10:00
Harshit Kumar Sankhla 9588a68e1b AP_Logger: added logging of baro, gps, airspeed to XKFS
new XKFS message for "XKF Sensor"
2020-08-27 20:20:51 +10:00
Harshit Kumar Sankhla 775a40e4cc AP_Logger: Add RErr and ErSc fields to NKF3 log
RErr (Core Relative Errors) and ErSc (Core Error Scores)
2020-08-27 20:20:51 +10:00
Peter Barker 716e7622be AP_Logger: log RCIN channels 14 and 15 in RCI2 2020-08-25 10:27:00 +10:00
Rishabh ad3a7e4d49 AP_Logger: Update logs based on new BendyRuler type 2020-08-24 08:53:20 +09:00
Randy Mackay f7ec08ff18 AP_Logger: add Write_Winch 2020-08-07 21:55:07 +09:00
Randy Mackay 5d99ce9a84 AP_Logger: remove winch events 2020-08-07 21:55:07 +09:00
Rishabh 251ebf9286 AP_Logger: Log Simple Avoidance 2020-08-05 15:37:04 +09:00
Peter Barker c539698528 AP_Logger: add documentation for GRAW, GRXH and GRXS messages 2020-07-22 12:29:19 +10:00
Mark Whitehorn 2b96b7915b AP_Logger: align PID(RPYAS) description to message names 2020-07-22 09:19:43 +09:00
Peter Barker 721d94a23b AP_Logger: log accumulated power status flags; all flags ever set 2020-07-21 09:12:14 +10:00
Paul Riseborough 0cf70fe961 AP_Logger: Log D gain limit cycle gain scaler
Used by Plane roll and pitch loops in APM_Control
2020-07-13 13:47:50 +10:00
Andrew Tridgell f80ca85428 AP_Logger: use strncpy_noterm 2020-07-10 13:32:24 +10:00
Randy Mackay 30bcf4d13b AP_Logger: VISP and VISV reset counter becomes uint8 2020-06-25 15:31:43 +10:00
Rishabh 4fa2c3f5ba AP_Logger: Log if BendyRuler has avoided changing directions 2020-06-24 11:42:20 +09:00
Randy Mackay 912e089c18 AP_Logger: fix BCL voltage scaling
voltages are in millivolts
2020-06-24 10:19:15 +09:00
Randy Mackay 82423384bf AP_Logger: BCL msg logs up to 12 battery cell voltages 2020-06-24 10:19:15 +09:00
Peter Barker 0c5d31f40f AP_Logger: ensure log directory exists before opening log
This will help with starting logs when inserting a fresh SD card which
doesn't have the ardupilot log directory on it
2020-06-16 12:03:21 +10:00
Peter Barker 66f8359c6b AP_Logger: factor out an ensure_log_directory_exists method 2020-06-16 12:03:21 +10:00
Peter Barker 0e964a4654 AP_Logger: use config error loop rather than abort
Also add a specific check for the length of the labels field
2020-06-10 09:02:35 +10:00
chobitsfan 255c685a8a AP_Logger: fix missing unit description in VISP 2020-06-09 13:31:21 +09:00
Randy Mackay 6714aa4e83 AP_Logger: shorten VISP and VISV log field names 2020-06-09 13:31:21 +09:00
chobits 5e5a0d2111 AP_Logger: log ext nav pos err and ang err 2020-06-09 13:31:21 +09:00
Iampete1 fee5b998bf AP_Logger: add min MB free param 2020-06-09 09:23:25 +10:00
Randy Mackay 08f6b2128e AP_Logger: add VISV field descriptions 2020-06-02 08:33:42 +09:00
Randy Mackay 714975662d AP_Logger: VISP message gets velocity error field 2020-06-02 08:33:42 +09:00
chobits 9b480ca755 AP_Logger: support VISION_SPEED_ESTIMATE 2020-06-01 17:51:24 +09:00
MisterMower 41245acf14 AP_Logger: Added units to CurrTot message
Units are not associated with the CurrTot message. AP_BattMonitor.h indicates the total current consumed is reported in mAh. This change sets the units for CurrTot to Ampere seconds and applies a multiplier of 3.6 to convert the reported mAh value to Ampere seconds.
2020-05-26 16:19:14 +10:00
Peter Barker 1d9c2b1726 AP_Logger: add documentation for SBPH and SBRH 2020-05-26 14:13:06 +10:00
Peter Barker 49918d070e AP_Logger: add documentation for ESC LoggerMessage 2020-05-24 13:07:35 +10:00
Peter Barker cc60faa58e AP_Logger: use single message number for all ESCs by using instance # 2020-05-24 13:07:35 +10:00
Andrew Tridgell 97f335396b AP_Scripting: fixed memory leak 2020-05-19 09:09:48 +10:00
Peter Hall 19ba9abc89 AP_Logger: add function and make public for scripting use 2020-05-19 09:09:48 +10:00
Peter Barker 115751833b AP_Logger: process pending rotate on arming
If the user arms the vehicle during the logging-persist-timeout we
should rotate the log immediately.
2020-05-15 16:02:09 +10:00
Peter Barker ca4af94833 AP_Logger: prevent potential infinite recursion in log-open codepath
If anything in start_new_log did logging (for example, by sending a
statustext), we end up infinitely recursing.

With the patch:

diff --git a/libraries/AP_Logger/AP_Logger_File.cpp b/libraries/AP_Logger/AP_Logger_File.cpp
index 69b8ef0431..eb422d10f8 100644
--- a/libraries/AP_Logger/AP_Logger_File.cpp
+++ b/libraries/AP_Logger/AP_Logger_File.cpp
@@ -778,6 +778,7 @@ void AP_Logger_File::PrepForArming()
  */
 void AP_Logger_File::start_new_log(void)
 {
+    gcs().send_text(MAV_SEVERITY_WARNING, "Starting new log");
     stop_logging();

     start_new_log_reset_variables();
pbarker@bluebottle:~/rc/ardupilot(master)$

We see:

    at ../../libraries/AP_Logger/AP_Logger_File.cpp:781
    this=0x555555ad9d30, pBuffer=0x7fffff8209d0, size=75, is_critical=true)
    at ../../libraries/AP_Logger/AP_Logger_Backend.cpp:372
    this=0x555555ad9d30, pBuffer=0x7fffff8209d0, size=75)
    at ../../libraries/AP_Logger/AP_Logger_Backend.h:32
    this=0x555555ad9d30, message=0x7fffff820b10 "Starting new log")
    at ../../libraries/AP_Logger/LogFile.cpp:466
    this=0x555555a6d758 <copter+11384>,
    message=0x7fffff820b10 "Starting new log")
    at ../../libraries/AP_Logger/AP_Logger.cpp:752
    this=0x555555a6e708 <copter+15400>, severity=MAV_SEVERITY_WARNING,
    fmt=0x5555557d64d0 "Starting new log", arg_list=0x7fffff820be0,
    dest_bitmask=1 '\001') at ../../libraries/GCS_MAVLink/GCS_Common.cpp:1847
    this=0x555555a6e708 <copter+15400>, severity=MAV_SEVERITY_WARNING,
    fmt=0x5555557d64d0 "Starting new log", arg_list=0x7fffff820be0)
    at ../../libraries/GCS_MAVLink/GCS.cpp:53
    this=0x555555a6e708 <copter+15400>, severity=MAV_SEVERITY_WARNING,
    fmt=0x5555557d64d0 "Starting new log")
    at ../../libraries/GCS_MAVLink/GCS.cpp:60
    at ../../libraries/AP_Logger/AP_Logger_File.cpp:781
    this=0x555555ad9d30, pBuffer=0x7fffff820dc0, size=75, is_critical=true)
    at ../../libraries/AP_Logger/AP_Logger_Backend.cpp:372

I'm not aware of any instances in the code where this will actually
happen - but it could easily sneak in.
2020-05-11 15:12:36 +10:00
Peter Barker 7befe84f0c AP_Logger: create and use INTERNAL_ERROR macro so we get line numbers 2020-04-30 13:21:36 +10:00
Peter Barker ad9493caca AP_Logger: use logger Write method for logging Solo gimbal
Also document the messages
2020-04-28 09:56:09 +10:00
Peter Barker 830176f2f4 AP_Logger: remove unused SBFE 2020-04-27 16:16:50 +10:00
Peter Barker f882bd0c3e AP_Logger: remove unused UBY1/UBY2 messages
These appear to have been replaced with instance fields on the UBX1 and
UBX2 messages.

Also mark the Instance field on UBX1, UBX2 as an instance field.
2020-04-26 11:35:04 +10:00
Peter Barker 7e3c9c209e AP_Logger: document GPSB and GPAB 2020-04-26 09:02:39 +10:00
Peter Barker eee0f028ba AP_Logger: fix examples
Having a valid AP_Scheduler is now a requirement
2020-04-23 11:33:41 +09:00
Peter Barker a83c25cfa7 AP_Logger: add documentation for EKF messages
NKF0, NKF1, NKF2, NKF3, NKF4, NKF5, NKQ

XKF0, XKF1, XKF2, XKF3, XKF4, XKF5, XKFD, XKQ, XKV1, XKV2
2020-04-21 09:48:43 +10:00
Mark Whitehorn 874c293911 AP_Logger: expand description of GPS.spd 2020-04-18 15:33:43 +10:00
Peter Barker 870159c14f AP_Logger: add times-full to MAV log structure 2020-04-17 22:21:14 +10:00
Peter Barker 908dfa58f3 AP_Logger: remove unused FORMATS stage in DFLogStart messagewriter 2020-04-17 21:42:15 +10:00
Peter Barker 678d6f43c5 AP_Logger: use existing LoggerMessageWriter to log uploaded missions
Instead of creating a MessageWriter explicitly to log uploaded missions
we fiddle the state of the one stored in the startup message writer.

This has the advantage of being much more likely to log the entire
mission (as the buffer constraint is removed), and with the addition of
a time-remaining check much less likely to cause a timing glitch.
2020-04-15 16:24:40 +10:00
Peter Barker d8582d864a AP_Logger: convert Solo gimbal messages to TimeUS from TimeMS
Also remove unused gimbal3 message entirely
2020-04-15 16:11:04 +10:00
Peter Barker acba2a78f6 AP_Logger: add message validation check against duplicate labels 2020-04-14 12:30:58 +10:00
Randy Mackay 4f639481c1 AP_Logger: VISP msg adds reset_counter 2020-04-14 10:28:03 +10:00
Peter Barker 767c010332 AP_Logger: add documentation for WENC, CESC, PRX, ADSB, BCN, BCL, OABR, OADF 2020-04-14 07:34:59 +10:00
Peter Barker c3b8db95b8 AP_Logger: add DSTL log message documentation 2020-04-12 08:36:48 +10:00
Randy Mackay c0187fe05f AP_Logger: add log message description for VISO 2020-04-09 19:41:08 +09:00
Randy Mackay f18be824ea AP_Logger: add VISP message 2020-04-09 19:41:08 +09:00
chobits 63320f140a AP_Logger: constraints time spend in header writing, more complete 2020-04-09 19:17:17 +10:00
chobits b829384fdf AP_Logger: constraints time spended in header writing 2020-04-09 19:17:17 +10:00
murata f83f6c71e4 AP_Logger: const extern hal reference 2020-04-07 20:45:51 +09:00
murata 264a90bb45 AP_Logger: Change to coding style (NFC)
AP_Logger: Change to coding style (NFC)
2020-04-07 20:37:33 +09:00
Rishabh 76b4e42bca AP_Logger: Logger documentation TimeUS and typo fix 2020-04-07 18:57:01 +10:00
Peter Barker 2ed550966d AP_Logger: correct units for velocity on OF log message 2020-04-06 10:46:45 +10:00
Peter Barker 33f17d7739 AP_Logger: document ARSP,ASP2,CAM,TRIG,POWR,TERR,CSV,CMD,OF,AHR2 2020-04-06 10:46:45 +10:00
Peter Barker 3fb61c4cf0 AP_Logger: add documentation for more log messages
ERR,DSF,EV,SIM,ORGN,POS,LGR,MON,TSYN,IMU,IMUT
2020-04-05 12:49:19 +10:00
Peter Barker 09152cd254 AP_Logger: correct time field name on DMS 2020-04-05 12:49:19 +10:00
Peter Barker 50c60aa8f2 AP_Logger: add documentation for ACC1,ACC2,ACC3,DMS,GPA,GPA2,GPS2,GYR1,GYR2,GYR3,MAVC,PM 2020-04-05 10:12:03 +10:00
Peter Barker a92206d090 AP_Logger: log dataflash-over-mavlink timestamp in micros rather than millis
... like the vast majority of our dataflash messages
2020-04-05 10:10:49 +10:00
Peter Barker e41ea5a273 AP_Logger: add docco for BAR2,BAR3,MSG,RAD,RALY,RFND,RPM,RSSI 2020-04-04 10:05:15 +11:00
Peter Barker 1770199c41 AP_Logger: add documentation for MAV and PARM 2020-04-01 10:13:03 +11:00
Peter Barker be6ed0be9f AP_Logger: add stream_slowdown to MAV message 2020-03-31 11:13:11 +11:00
Peter Barker 8a28fa2244 AP_Logger: rename struct log_NKF2a to log_XKF2 2020-03-31 10:25:59 +11:00
Peter Barker aeb45bf146 AP_Logger: fix extremely unlikely nullptr dereference in SITL sanity checks 2020-03-29 08:07:29 +11:00
Andrew Tridgell b5cc1f236a AP_Logger: use new DirHandle for directory listings 2020-03-28 15:28:03 +11:00
Peter Barker 7f0e722a33 AP_Logger: add onboard LogMessage documentation 2020-03-27 08:05:53 +11:00
Henry Wurzburg c34c857123 AP_Logger: update logger meta-data, add to gitignore 2020-03-25 14:20:53 +11:00
Peter Barker 35ad582440 AP_Logger: correct various onboard log message documentation 2020-03-22 18:35:14 +11:00
Henry Wurzburg 7bb5d92dcc AP_Logger: fix typos in logger message meta-data 2020-03-22 10:04:53 +11:00
Peter Barker fa50b5f76d AP_Logger: add more metadata for logged messages
LogStructure: add MAG log information

LogStructure: add MODE log information

LogStructure: add PID log information

AP_Logger: add ATT information

AP_Logger: add documentation for BAT log message

LogStructure: add RCIN and RCOU messages

AP_Logger: add VIBE message information
2020-03-21 09:34:43 +11:00
Peter Barker de36b6a16a AP_Logger: add LoggerMessage metadata for GPS message 2020-03-20 13:05:46 +11:00
Peter Barker 55ee3362b9 AP_Logger: add example of documentation for a log structure 2020-03-20 13:05:46 +11:00