GPS simulation: Manage delays correctly

The GPS simulation now mimicks the real driver more closely and should provide even GPS delays. The delays themselves are set by the simulator, and default to 120 ms for Gazebo
This commit is contained in:
Lorenz Meier
2017-08-02 13:06:59 +02:00
parent 7d46858ae4
commit 9d49690f17
4 changed files with 33 additions and 18 deletions
+1
View File
@@ -111,6 +111,7 @@ struct RawAirspeedData {
#pragma pack(push, 1)
struct RawGPSData {
int64_t timestamp;
int32_t lat;
int32_t lon;
int32_t alt;
@@ -261,6 +261,7 @@ void Simulator::update_sensors(mavlink_hil_sensor_t *imu)
void Simulator::update_gps(mavlink_hil_gps_t *gps_sim)
{
RawGPSData gps = {};
gps.timestamp = gps_sim->time_usec;
gps.lat = gps_sim->lat;
gps.lon = gps_sim->lon;
gps.alt = gps_sim->alt;