Skip to content

Commit

Permalink
AP_ExternalAHRS: fixed origin and latlon scale for AdNav driver
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Mar 11, 2024
1 parent 69eba0d commit e4e29e5
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,17 @@ void AP_ExternalAHRS_AdvancedNavigation::handle_packet()

if (get_gnss_capability()) {
state.have_location = true;
const double latlon_scale = degrees(1) * 1.0e7;
state.location = Location{
(int32_t) (degrees(_msg.packet.payload.system_state.llh[0]) * 1.0e7),
(int32_t) (degrees(_msg.packet.payload.system_state.llh[1]) * 1.0e7),
(int32_t) (_msg.packet.payload.system_state.llh[0] * latlon_scale),
(int32_t) (_msg.packet.payload.system_state.llh[1] * latlon_scale),
(int32_t) (_msg.packet.payload.system_state.llh[2] *1.0e2),
Location::AltFrame::ABSOLUTE
};
if (!state.have_origin) {
state.origin = state.location;
state.have_origin = true;
}
state.last_location_update_us = AP_HAL::micros();
}

Expand Down

0 comments on commit e4e29e5

Please sign in to comment.