Commit Graph

459 Commits

Author SHA1 Message Date
Paul Riseborough 61d556afb1 DataFlash: Fix shorthand variable names for EKF position reset delta 2015-10-30 12:24:18 +09:00
Peter Barker e481497574 DataFlash: delete oldest file rather than the lowest-numbered file
Also reference log numbers by their list index to accomodate log number
wrapping in DataFlash_File
2015-10-21 10:50:32 +11:00
Lucas De Marchi 19b31ccff1 DataFlash: remove check for max compass instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:18 +11:00
Lucas De Marchi d83609b24c DataFlash: remove check for max BARO instances
For all supported boards we allow more than 1 baro instance.
2015-10-21 10:05:18 +11:00
Lucas De Marchi 121eeb4b58 DataFlash: remove check for vibe check
For all supported boards we have vibration check.
2015-10-21 10:05:17 +11:00
Lucas De Marchi f99d64e621 DataFlash: remove check for max INS instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:17 +11:00
Caio Marcelo de Oliveira Filho b028219c94 DataFlash: remove unnecessary includes from example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Andrew Tridgell b0aa7cb990 DataFlash: use new perf API 2015-10-20 18:16:16 +11:00
Paul Riseborough 2d44441d6b DataFlash: Make EKF2 PosDownDerivative interface follow coding conventions
Updates arising from peer review.
2015-10-20 15:21:37 +11:00
Paul Riseborough 1323db10e8 DataFlash: Make EKF2 PosDownDerivative interface follow coding conventions
Updates arising from peer review.
2015-10-20 15:21:37 +11:00
Paul Riseborough 9e3d9d15fc DataFlash: Log vertical position derivative output 2015-10-20 15:21:35 +11:00
Gustavo Jose de Sousa 363f9cf82a DataFlash: use compass get_{field,offsets}() functions
Both functions are equivalent, so we're going to simply use
get_{field,offsets}() instead of get_{field,offsets}_milligauss().
2015-10-15 19:56:07 +09:00
Paul Riseborough a82c8b241f DataFlash: Update NKF4 data logging
Add roll/pitch error metric
Reduce normalised magnetometer vector with a vector length
2015-10-10 21:22:57 +09:00
Paul Riseborough ba6387f206 DataFlash: Add logging of EKF GPS check status 2015-10-10 14:49:03 +09:00
Randy Mackay e9254ca1a9 DataFlash: log compass as milligauss 2015-10-07 21:35:19 +09:00
Peter Barker af4ad01f23 DataFlash: make CAM a critical message 2015-10-06 15:20:08 +11:00
Paul Riseborough 73686dfa89 DataFlash: fix error in NKF descriptor 2015-09-25 19:20:52 +10:00
Michael du Breuil cf6e6b7e82 DataFlash: Remove stale UBX3 message 2015-09-23 20:42:42 -07:00
Andy Piper 5adb6d2b89 AP_GPS: Support UBX messages for dual UBLOX GPS setups.
Add extra DOP information to UBX precision messages.
2015-09-23 20:41:50 -07:00
Paul Riseborough 80e182f827 AP_NavEKF2: Update EKF2 data logging 2015-09-24 12:58:44 +10:00
Paul Riseborough 86ad1e6e66 DataFlash: Update EKF2 data logging 2015-09-24 12:58:44 +10:00
Andrew Tridgell ba8e63d8e7 DataFlash: handle unitialised EKF2 in logging 2015-09-23 18:54:46 +10:00
Andrew Tridgell ce9fa45b3a DataFlash: added logging of EKF2 2015-09-23 12:09:48 +10:00
Andrew Tridgell eabdee2b3c DataFlash: only log two rangefinders
this prevents a array index build error on PX4
2015-09-22 09:24:55 +10:00
Peter Barker 8f1471c137 DataFlash: leave room in buffer for non-startup messages 2015-09-18 09:13:45 +10:00
Peter Barker 63a45000b4 DataFlash: take log messages after putting FMTs out 2015-09-18 09:13:45 +10:00
Stewart Loving-Gibbard 4dcf6b8dc3 DataFlash: Adding Logging of RSSI data. 2015-09-16 16:41:31 +09:00
Andrew Tridgell eea54c9e09 DataFlash: fixed flymaple build 2015-09-14 16:44:45 +10:00
Andrew Tridgell 43ac3f86c5 DataFlash: added RNFD logging and 3 baros 2015-09-13 11:29:59 +10:00
Andrew Tridgell c5cd310818 DataFlash: added GPA and GPA2 messages for GPS accuracy
this reverts the GPS format to the old format, thus fixing log
analysers
2015-09-09 14:53:11 +10:00
Buzz 684dfaf26f DataFlash: fix OSX build 2015-09-09 13:09:01 +09:00
Peter Barker 60010e794e DataFlash: ensure 10% free space when initialising logging 2015-09-09 12:22:35 +10:00
Michael du Breuil a88e10d3a0 DataFlash: Log vDOP with GPS messages.
Due to the description string getting to long HDop was renamed as EPH with VDop as EPV (Which is the same terimnology  used to describe the MAVLink side). Status was shortened to stat as well.
2015-09-09 11:38:12 +10:00
Peter Barker f9a1102e96 DataFlash: correct compilation for new DataFlash signature 2015-09-09 10:58:27 +10:00
Peter Barker a2f1bf581a DataFlash: fix test for SITL and linux 2015-09-09 10:58:27 +10:00
unknown b1ce6136c4 DataFlash_test:make it works with pixhawk2 2015-09-09 10:58:26 +10:00
Andrew Tridgell 5710697847 DataFlash: fixed some build warnings 2015-09-03 20:25:14 +10:00
Michael Oborne 52577e4105 DataFlash: add sbf event message 2015-09-03 19:43:31 +10:00
Peter Barker 2b02911546 DataFlash: make mode and messages critical 2015-09-03 15:20:20 +10:00
Peter Barker 8f8493225c DataFlash: DFMessageWriter; ability to trickle messages out to DF 2015-09-03 09:54:55 +10:00
Lucas De Marchi 327a3a4298 DataFlash: standardize inclusion of libaries headers
Do the missing header changes due to changing the code before the pr
getting accepted.
2015-08-18 17:12:52 +10:00
Andrew Tridgell ab7e400a89 DataFlash: added RPM logging 2015-08-12 15:03:50 +10:00
Gustavo Jose de Sousa 709204c01d DataFlash: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:38:24 +10:00
Randy Mackay 5776620062 DataFlash: consolidate GPS, GPS2 messages
Remove unused dgps_numch, dgps_age from GPS2
Add U field (for use) to both GPS and GPS2
2015-08-05 15:46:46 +09:00
Grant Morphett 08f5305519 DataFlash: fix coverity warnings - add param init in constructor 2015-07-30 12:37:09 +10:00
Peter Barker 1ee330ebb2 DataFlash: CLI log dumping - don't truncate lines that contain doubles
We currently print doubles out as if they were floats.  The ftoa_engine isn't something to replicate for doubles lightly!
2015-07-24 08:08:51 +10:00
Lucas De Marchi 3136b8916c DataFlash: use ARRAY_SIZE macro 2015-07-21 14:25:15 +09:00
Peter Barker 65813f308e DataFlash: fix incorrect comment 2015-07-21 13:11:00 +09:00
Randy Mackay ad1f9c4829 DataFlash: add ORGN message 2015-07-06 12:11:49 +09:00
Peter Barker 844f050cf3 DataFlash: correct zero-byte-file handling in CLI
-rw-rw-r-- 1 pbarker pbarker   2105344 Jul  1 16:10 1.BIN
-rw-rw-r-- 1 pbarker pbarker         0 Jul  1 19:35 2.BIN
-rw-rw-r-- 1 pbarker pbarker   2494464 Jul  1 16:58 3.BIN
-rw-rw-r-- 1 pbarker pbarker 128503808 Jul  1 20:22 4.BIN
-rw-rw-r-- 1 pbarker pbarker         3 Jul  1 19:46 LASTLOG.TXT

Before fix:

2 logs
Log 3 in logs/3.BIN of size 2494464 2015/7/1 6:58
Log 4 in logs/4.BIN of size 128503808 2015/7/1 10:22

After Fix:

4 logs
Log 1 in logs/1.BIN of size 2105344 2015/7/1 6:10
Log 2 in logs/2.BIN of size 0 2015/7/1 9:35
Log 3 in logs/3.BIN of size 2494464 2015/7/1 6:58
Log 4 in logs/4.BIN of size 128503808 2015/7/1 10:22

If the last file was zero bytes, no files would be shown.
2015-07-02 08:53:18 +10:00
Peter Barker cabea266e7 DataFlash: pull out common mission logging code 2015-06-30 16:23:35 +10:00
Peter Barker d85b247706 DataFlash: Log_Write_SysInfo - pull out common logging startup messages 2015-06-30 16:23:34 +10:00
Peter Barker c5c39a77a3 DataFlash: method to flush ringbuffer to fd 2015-06-30 16:19:22 +10:00
Víctor Mayoral Vilches c06abeb02e DataFlash_File: Support custom_log_directory 2015-06-30 14:36:42 +10:00
Michael du Breuil d665c85c20 DataFlash: Add RXM-RAWX logging messages 2015-06-30 09:05:48 +10:00
Peter Barker 723c37bcf7 DataFlash: backend/frontend split 2015-06-26 16:02:50 +10:00
Michael du Breuil 225c946af0 DataFlash: Add PIDS for steering logging 2015-06-22 15:41:44 +10:00
Andrew Tridgell a424686d2f DataFlash: reduce future merge conflicts
an enum makes it easier to merge new messages
2015-06-20 16:18:50 +10:00
Andrew Tridgell feb928dcd3 DataFlash: fixed build warnings 2015-06-17 13:10:26 +10:00
Randy Mackay 384755e271 Dataflash: add IMT messages 2015-06-17 12:46:54 +10:00
Randy Mackay 0d239d2746 DataFlash: disable vibration logging on APM2
Also remove unnecessary include
2015-06-12 21:36:59 +09:00
Randy Mackay f0f262eb04 DataFlash: add Log_Write_Vibration 2015-06-12 21:36:28 +09:00
Grant Morphett 7d1bf75aa8 DataFlash: Moving parameter logging to be after all systems have started
Moved Log_Write_Parameters to be public so we can call it from the
vehcile code at the end of the startup sequence.
We needed to do this because parameters like COMPASS_EXTERNAL are
modified by the startup code and if we log the parameters too early we
will be recording the wrong value.
2015-06-01 20:22:43 +09:00
Andrew Tridgell e734f24cc1 DataFlash: convert example from .pde to .cpp 2015-06-01 17:07:07 +10:00
Andrew Tridgell 9379e79489 DataFlash: all vehicles now use functors 2015-06-01 15:18:32 +10:00
Andrew Tridgell 73445fdae9 DataFlash: added error checking and fixed a warning 2015-05-30 22:16:22 +10:00
Andrew Tridgell f39063e023 DataFlash: don't do PID logging on APM2 2015-05-29 16:32:05 +10:00
Andrew Tridgell b6eba0842a DataFlash: fixed CAM message format 2015-05-27 22:10:39 +10:00
Andrew Tridgell 95ff71940c DataFlash: fixed rebase errors 2015-05-27 14:28:50 +10:00
Andrew Tridgell 8f34ed5b76 DataFlash: added PIDA message
for logging Z accel PID in copter
2015-05-27 14:28:50 +10:00
Andrew Tridgell b45ab52015 DataFlash: added desired rate to PID logging 2015-05-27 14:28:48 +10:00
Robert Lefebvre 7ab628521e DataFlash: Add Acceleration Feedforward to PID_Info. 2015-05-27 14:28:47 +10:00
Andrew Tridgell d148c38f68 DataFlash: added desired rate to PID_Info 2015-05-27 14:28:45 +10:00
Robert Lefebvre 753be18c17 DataFlash: Add PID Logging Method 2015-05-27 14:28:44 +10:00
Andrew Tridgell 2a22ae5404 DataFlash: support 64 bit TimeUS log dumping 2015-05-27 11:54:18 +10:00
Peter Barker 988f3277de DataFlash: 64-bit timestamps for ACCx and GYRx messages 2015-05-27 11:54:17 +10:00
Peter Barker 617043f468 DataFlash: convert GPS and CAM dataflash messages to 64-bit timestamps
GPS structures remove 32-bit apm_time and replace with standard time_us
Significant change to GPS and GPS2 messages:
	    Add TimeUS as first field
	    Remove T field
	    Due to length restrictions on labels:
	    	Renamed TimeMS to GMS (Gps MilliSeconds)
		Renamed Week to GWk (Gps WeeK)
		Renamed RelAlt to RAlt
Significant change to CAM messages:
	    Removed GPSTime (uin32_t), added TimeUS (uint64_t)
2015-05-27 11:54:15 +10:00
Peter Barker 769982b8f2 DataFlash: use 64-bit timestamps for dataflash logs 2015-05-27 11:54:14 +10:00
Andrew Tridgell 8624a262e7 DataFlash: removed BUILD_DELEGATES code
no longer needed
2015-05-26 14:35:04 +10:00
Lucas De Marchi c894a1349e DataFlash: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:54 +10:00
Lucas De Marchi cd308b5e2f DataFlash: allow to use functor 2015-05-26 13:46:50 +10:00
Andrew Tridgell 4486ddc53e DataFlash: changed TimeUS to SampleUS for raw IMU logging
this prevents a problem with an upcoming patch from Peter
2015-05-22 17:58:18 +10:00
Andrew Tridgell f8aef57ec3 DataFlash: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell b5d930be61 DataFlash: support member functions for rover 2015-05-21 07:48:47 +10:00
Andy Piper c600c1a746 DataFlash: log Gyro and Accel Health for IMUs.
Log the health of the various IMUs under GyHlt and AcHlt.
(Names are shortened to get inside the string array limit).
2015-05-19 13:13:35 +09:00
Andrew Tridgell 80c20b5cf2 DataFlash: use L for latitude/longitude in DF messages 2015-05-16 14:04:31 +10:00
Andrew Tridgell ab687ab0f5 DataFlash: added double to list of format strings
thanks to Dario <proyectoire@gmail.com> for noticing this
2015-05-15 21:14:49 +10:00
Andrew Tridgell d7e4310df0 DataFlash: Lat can be negative in POS 2015-05-15 17:55:50 +10:00
Andrew Tridgell b0a90df135 DataFlash: fixed double Init of DF object
thanks to Michael De Breuil
2015-05-15 16:33:10 +10:00
Andrew Tridgell 74485c5754 DataFlash: added Log_Write_POS() call
write AHRS position to DF log
2015-05-15 14:28:08 +10:00
Andrew Tridgell 11f70da8b4 DataFlash: fixed incorrect change to GPS message 2015-05-15 14:25:43 +10:00
Andrew Tridgell 3991e0c476 DataFlash: fixed sign of sv in GRAW message 2015-05-10 12:15:04 +10:00
Andrew Tridgell 21d805422d DataFlash: added defines for raw accel and gyro logging 2015-05-07 12:08:04 +10:00
Tom Pittenger 98ca790cb9 AP_DataFlash: compiler warnings: float to double 2015-05-05 13:26:54 +10:00
Andrew Tridgell f8e09da50e DataFlash: added GRAW raw GPS message
for saving RXM_RAW for post flight RTK
2015-05-05 13:25:34 +10:00
Andrew Tridgell 438f954379 DataFlash: fixed some build warnings 2015-05-05 09:45:58 +10:00
Andrew Tridgell 69f9d25cd0 DataFlash: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Tom Pittenger f700f76923 DataFlash: fix compile warnings re float constants 2015-04-24 14:04:12 +09:00
Andrew Tridgell 2dfe3cb844 DataFlash: added a perf counter for microSD overruns
this allows us to tell if a microSD can handle a high logging rate
2015-04-21 20:45:30 +10:00
Andy Piper b0937154f5 DataFlash: log compass health
This patch simply logs the health of each compass for easy diagnosis.
2015-04-21 13:18:24 +09:00
Andrew Tridgell c153d31dd2 DataFlash: speed up DataFlash in Replay 2015-04-21 10:14:41 +10:00
Andrew Tridgell 10ec1b8290 DataFlash: example no longer builds with APM2 2015-03-26 06:32:00 -07:00
Andrew Tridgell ecd2a6f515 DataFlash: log temperature of IMUs
this is the first step towards supporting temperature calibration of
IMUs
2015-03-17 13:33:26 +11:00
Andrew Tridgell 73782c41a9 DataFlash: disable CLI on APM2 2015-03-13 22:52:55 +11:00
Andrew Tridgell af5f84f4e4 DataFlash: fixed example builds 2015-02-09 13:09:16 +11:00
Emile Castelnuovo ebc3dcd142 DataFlash: Clean up, VRBRAIN deleted unused boards. 2015-02-02 08:44:01 +11:00
Emile Castelnuovo ffd26e59cd DataFlash: added new VRBRAIN boards 2015-02-02 08:43:59 +11:00
Holger Steinhaus 8911dfd791 DataFlash: fix out-of-bounds read when logging
Checked in my rmackay9
2015-01-31 13:24:34 +09:00
Randy Mackay 0480828350 Dataflash: fix example sketch 2015-01-28 16:31:50 +09:00
Randy Mackay 842efe71be DataFlash: move COMPASS2,3 formats to extra structures 2015-01-21 14:38:13 +09:00
Randy Mackay e7471c5fe5 DataFlash: fix message id and CURR formatting 2015-01-21 14:38:03 +09:00
Randy Mackay 09e3dcd821 DataFlash: pass ahrs, batt, targets by reference 2015-01-21 14:38:01 +09:00
Randy Mackay f23959b5fa DataFlash: fix missing slash lost in merge 2015-01-21 14:37:59 +09:00
Robert Lefebvre 80929c389e DataFlash: Handle multiple compass instances natively inside the Library. 2015-01-21 14:37:50 +09:00
Robert Lefebvre 5b70550b73 DataFlash: Fix potentially uninitialized variable compiler warning. 2015-01-21 14:37:27 +09:00
Robert Lefebvre be803f4f39 DataFlash: Minor whitespace changes/cleanup. No effect. 2015-01-21 14:37:25 +09:00
Robert Lefebvre 2657610373 DataFlash: Add common-vehicle Mode logging method.
Conflicts:
	libraries/DataFlash/DataFlash.h
2015-01-21 14:37:18 +09:00
Robert Lefebvre 12c3593bc3 DataFlash: Add common-vehicle Compass logging method. 2015-01-21 14:37:14 +09:00
Robert Lefebvre 2fdcd99db2 Arducopter: Move Attitude Message structure definition to the Base Structures section.
Conflicts:
	libraries/DataFlash/DataFlash.h
2015-01-21 14:37:12 +09:00
Robert Lefebvre d2adf2cdd7 DataFlash.h: Move format characters string to a more convenient location. 2015-01-21 14:37:10 +09:00
Robert Lefebvre 392e5257cc DataFlash: Add voltage2 data to Current log, to be used by plane. 2015-01-21 14:37:07 +09:00
Robert Lefebvre 50b5376945 DataFlash: Add common-vehicle Current logging message. 2015-01-21 14:37:01 +09:00
Robert Lefebvre db1a066f43 DataFlash: Add common-vehicle Attitude logging message. 2015-01-21 14:36:56 +09:00
Andrew Tridgell 5d83124675 DataFlash: moved airspeed msg to DataFlash
so it can be used by Replay
2015-01-20 09:10:33 +11:00
Andrew Tridgell e8b1fc72e0 DataFlash: fixed build warning 2015-01-09 12:43:15 +11:00
Andrew Tridgell b85001bf4a DataFlash: added logging of 2nd baro 2015-01-09 11:51:51 +11:00
Randy Mackay 3e583e3650 DataFlash: fix EKF4 logging 2015-01-09 10:51:24 +11:00
Randy Mackay 3896dadc77 DataFlash: EKF logs filter status as uint16 2015-01-09 10:51:23 +11:00
Randy Mackay 54cff29fc2 DataFlash: EKF logging uses nav_filter_status 2015-01-09 10:51:23 +11:00
priseborough 873860e810 DataFlash: Allow negative HAGL values in the EKF optical flow debug log 2015-01-09 10:51:22 +11:00
priseborough d470d55234 DataFlash: Update EKF optical flow debug logging 2015-01-09 10:51:21 +11:00
Andrew Tridgell 2ddf3e728a DataFlash: use common RingBuffer.h 2015-01-07 08:41:14 +11:00
priseborough a9eec29e45 DataFlash: Update EKF optical flow data logging 2015-01-03 14:09:15 +11:00
priseborough b99b3c7b9d DataFlash: Don't log EKF optical flow data if not required 2014-12-31 13:16:09 +09:00
priseborough 685fa383e4 DataFlash: Log EKF solution status message
This message is a bitmasked integer that will be used by control software to determine what data is available from the EKF and decide what control modes are available.
Duplicate static mode message removed. Static mode is now contained in the bitmasked solution status message
2014-12-31 13:13:33 +09:00
Andrew Tridgell e0943851d6 DataFlash: log gyro and accel error counts 2014-12-30 12:16:02 +11:00
Andrew Tridgell c93ae67541 DataFlash: don't try and open logfile on failure more than once
this prevents a corrupted microSD card from causing a continuous
attempt to open a log file while in flight, which can cause large
scheduler delays

Pair-Programmed-With: Grant Morphett <grant@gmorph.com>
2014-12-21 14:50:42 +11:00
Andrew Tridgell abd1ece6e3 DataFlash: don't write out parameters if log open fails 2014-12-21 14:50:42 +11:00
priseborough 7d27a22f77 DataFlash : Fix EKF optical flow logging bug 2014-12-06 18:16:48 +11:00
priseborough 2baa1e56ed Dataflash : Fix bug in EKF opt flow logging 2014-12-06 18:16:48 +11:00
priseborough cc8e6dbfad DataFlash : Add EKF additional fault and timeout logging 2014-12-06 18:16:47 +11:00
priseborough 4616721b0d DataFlash : Update EKF debug logging 2014-12-06 18:16:47 +11:00
priseborough f358d5e20f DataFlash : Add range measurement to EKF debug message 2014-12-06 18:16:45 +11:00
priseborough a07e402ebf DataFlash : Update names in EKF optical flow logging 2014-12-06 18:16:45 +11:00
priseborough bc74abcd00 DataFlash : EKF optical flow fusion support preliminary changes 2014-12-06 18:16:44 +11:00
Andrew Tridgell 940966f3e3 DataFlash: fixed example sketch build 2014-12-03 08:39:36 +11:00
Andrew Tridgell d0087c91e9 DataFlash: prevent build errors on non-PX4 targets 2014-11-26 11:14:44 +11:00
Andrew Tridgell 1d0122e6c2 DataFlash: log each ESC separately
this saves log space for ESCs that are not initialised (eg. only 3rd
ESC on fixed wing) and is a bit easier to deal with as a user
2014-11-26 11:14:44 +11:00