Skip to content

Commit

Permalink
SITL: populate speed accuracy uBlox messages from SITL parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed May 1, 2024
1 parent 6ddc237 commit c08d982
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/SITL/SIM_GPS_UBLOX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void GPS_UBlox::publish(const GPS_Data *d)
if (velned.heading_2d < 0.0f) {
velned.heading_2d += 360.0f * 100000.0f;
}
velned.speed_accuracy = 40;
velned.speed_accuracy = _sitl->gps_vel_err[instance].get().xy().length() * 100; // m/s -> cm/s
velned.heading_accuracy = 4;

memset(&sol, 0, sizeof(sol));
Expand Down Expand Up @@ -260,7 +260,7 @@ void GPS_UBlox::publish(const GPS_Data *d)
pvt.velD = 1000.0f * d->speedD;
pvt.gspeed = norm(d->speedN, d->speedE) * 1000;
pvt.head_mot = ToDeg(atan2f(d->speedE, d->speedN)) * 1.0e5;
pvt.s_acc = 40;
pvt.s_acc = velned.speed_accuracy;
pvt.head_acc = 38 * 1.0e5;
pvt.p_dop = 65535;
memset(pvt.reserved1, '\0', ARRAY_SIZE(pvt.reserved1));
Expand Down

0 comments on commit c08d982

Please sign in to comment.