mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
DataFlash: correct nanf log output
This commit is contained in:
parent
c8b6be6736
commit
466d6e619e
@ -210,6 +210,9 @@ public:
|
||||
void handle_log_send(class GCS_MAVLINK &);
|
||||
bool in_log_download() const { return _in_log_download; }
|
||||
|
||||
float quiet_nanf() const { return nanf("0x4152"); } // "AR"
|
||||
double quiet_nan() const { return nan("0x4152445550490a"); } // "ARDUPI"
|
||||
|
||||
protected:
|
||||
|
||||
const struct LogStructure *_structures;
|
||||
|
@ -594,7 +594,7 @@ void DataFlash_Class::Log_Write_POS(AP_AHRS &ahrs)
|
||||
lng : loc.lng,
|
||||
alt : loc.alt*1.0e-2f,
|
||||
rel_home_alt : -home,
|
||||
rel_origin_alt : ahrs.get_relative_position_D_origin(origin) ? -origin : nanf("ARDUPILOT")
|
||||
rel_origin_alt : ahrs.get_relative_position_D_origin(origin) ? -origin : quiet_nanf(),
|
||||
};
|
||||
WriteBlock(&pkt, sizeof(pkt));
|
||||
}
|
||||
|
@ -175,6 +175,9 @@ void DataFlashTest_AllTypes::Log_Write_TypeMessages_Log_Write()
|
||||
3432345232233432 // uint64_t
|
||||
);
|
||||
|
||||
// emit a message which contains NaNs:
|
||||
dataflash.Log_Write("NANS", "f,d,bf,bd", "fdfd", dataflash.quiet_nanf(), dataflash.quiet_nan(), NAN, NAN);
|
||||
|
||||
flush_dataflash(dataflash);
|
||||
|
||||
dataflash.StopLogging();
|
||||
|
Loading…
Reference in New Issue
Block a user