mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 01:03:35 +08:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user