SITL: add parameters to control reading and writing IMU data to a file

add exit on stop to reading IMU data from a file
This commit is contained in:
Andy Piper 2022-10-14 14:04:56 +02:00 committed by Andrew Tridgell
parent 5ea3415a41
commit ec7be5c417
2 changed files with 16 additions and 1 deletions

View File

@ -525,7 +525,11 @@ const AP_Param::GroupInfo SIM::var_ins[] = {
// @DisplayName: SIM-on_hardware Output Enable Mask // @DisplayName: SIM-on_hardware Output Enable Mask
// @Description: channels which are passed through to actual hardware when running on actual hardware // @Description: channels which are passed through to actual hardware when running on actual hardware
AP_GROUPINFO("OH_MASK", 28, SIM, on_hardware_output_enable_mask, 0), AP_GROUPINFO("OH_MASK", 28, SIM, on_hardware_output_enable_mask, 0),
#if AP_SIM_INS_FILE_ENABLED
// read and write IMU data to/from files
AP_GROUPINFO("GYR_FILE_RW", 29, SIM, gyro_file_rw, INSFileMode::INS_FILE_NONE),
AP_GROUPINFO("ACC_FILE_RW", 30, SIM, accel_file_rw, INSFileMode::INS_FILE_NONE),
#endif
// the IMUT parameters must be last due to the enable parameters // the IMUT parameters must be last due to the enable parameters
#if HAL_INS_TEMPERATURE_CAL_ENABLE #if HAL_INS_TEMPERATURE_CAL_ENABLE
AP_SUBGROUPINFO(imu_tcal[0], "IMUT1_", 61, SIM, AP_InertialSensor::TCal), AP_SUBGROUPINFO(imu_tcal[0], "IMUT1_", 61, SIM, AP_InertialSensor::TCal),

View File

@ -506,6 +506,17 @@ public:
// Master instance to use servos from with slave instances // Master instance to use servos from with slave instances
AP_Int8 ride_along_master; AP_Int8 ride_along_master;
#if AP_SIM_INS_FILE_ENABLED
enum INSFileMode {
INS_FILE_NONE = 0,
INS_FILE_READ = 1,
INS_FILE_WRITE = 2,
INS_FILE_READ_STOP_ON_EOF = 3,
};
AP_Int8 gyro_file_rw;
AP_Int8 accel_file_rw;
#endif
}; };
} // namespace SITL } // namespace SITL