Skip to content

Commit

Permalink
SITL: added SIM_GPS_LOG_NUM
Browse files Browse the repository at this point in the history
for replaying GPS logs recorded with --enable-gps-logging
  • Loading branch information
tridge committed Dec 18, 2022
1 parent bec4a7f commit a43709c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ void GPS::update_file()
{
static int fd[2] = {-1,-1};
static uint32_t base_time[2];
const uint16_t lognum = 9;
const uint16_t lognum = uint16_t(_sitl->gps_log_num.get());
if (instance > 1) {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions libraries/SITL/SITL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ const AP_Param::GroupInfo SIM::var_gps[] = {
AP_GROUPINFO("INIT_LON_OFS", 46, SIM, gps_init_lon_ofs, 0),
AP_GROUPINFO("INIT_ALT_OFS", 47, SIM, gps_init_alt_ofs, 0),

AP_GROUPINFO("GPS_LOG_NUM", 48, SIM, gps_log_num, 0),

AP_GROUPEND
};
#endif // HAL_SIM_GPS_ENABLED
Expand Down
3 changes: 3 additions & 0 deletions libraries/SITL/SITL.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ class SIM {
AP_Float gps_init_lon_ofs;
AP_Float gps_init_alt_ofs;

// log number for GPS::update_file()
AP_Int16 gps_log_num;

AP_Float batt_voltage; // battery voltage base
AP_Float batt_capacity_ah; // battery capacity in Ah
AP_Int8 rc_fail; // fail RC input
Expand Down

0 comments on commit a43709c

Please sign in to comment.