gz_bridge: project local position instead of using navsat global pos

The issue is that the global position produced by gz is inconsistent
with the velocity, leading to navigation issues when moving away from
the origin.
This commit is contained in:
bresch
2025-11-21 09:35:23 +01:00
parent 5eab16c17c
commit 8ef2d1ab85
@@ -721,9 +721,10 @@ void GZBridge::navSatCallback(const gz::msgs::NavSat &msg)
return;
}
double latitude = msg.latitude_deg();
double longitude = msg.longitude_deg();
double altitude = msg.altitude();
double latitude;
double longitude;
_pos_ref.reproject(_position_prev(0), _position_prev(1), latitude, longitude);
double altitude = _alt_ref + (-_position_prev(2));
float vel_north = msg.velocity_north();
float vel_east = msg.velocity_east();
float vel_down = -msg.velocity_up();