diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index bc689396c9..b279d7fc20 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 @@ -149,6 +150,7 @@ public: const AP_Motors &motors, const AC_AttitudeControl &attitude_control, const AC_PosControl &pos_control); + void Log_Write_Rally(const AP_Rally &rally); void Log_Write(const char *name, const char *labels, const char *fmt, ...); diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index 9db1b786a0..78786d5916 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -1877,3 +1877,23 @@ void DataFlash_Class::Log_Write_Rate(const AP_AHRS &ahrs, }; WriteBlock(&pkt_rate, sizeof(pkt_rate)); } + +// Write rally points +void DataFlash_Class::Log_Write_Rally(const AP_Rally &rally) +{ + RallyLocation rally_point; + for (uint8_t i=0; i