Skip to content

Commit

Permalink
AP_ExternalAHRS: AdNav Fixed ordering of Lat/Long, Changed GNSS Packe…
Browse files Browse the repository at this point in the history
…t Request to 5Hz
  • Loading branch information
AN-DanielCook committed Nov 10, 2023
1 parent c408e09 commit f613a2f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#define AN_PACKET_ID_ACKNOWLEDGE 0
#define AN_TIMEOUT 5000 //ms
#define AN_MAXIMUM_PACKET_PERIODS 50
#define AN_GNSS_PACKET_RATE 5

#define an_packet_pointer(packet) packet->header
#define an_packet_size(packet) (packet->length + AN_PACKET_HEADER_SIZE)*sizeof(uint8_t)
Expand Down Expand Up @@ -503,7 +504,7 @@ bool AP_ExternalAHRS_AdvancedNavigation::sendPacketRequest()
},
AN_PERIOD{
id: AN_PACKET_ID_RAW_GNSS,
packet_period: (uint32_t) 1.0e3 / _current_rate
packet_period: (uint32_t) 1.0e3 / AN_GNSS_PACKET_RATE
},
AN_PERIOD{
id: AN_PACKET_ID_SATELLITES,
Expand Down Expand Up @@ -733,8 +734,8 @@ void AP_ExternalAHRS_AdvancedNavigation::handle_packet()
gps.hdop = _last_satellites->hdop;
gps.vdop = _last_satellites->vdop;

gps.longitude = (int32_t) (degrees(_msg.packet.payload.raw_gnss.llh[0]) * 1.0e7);
gps.latitude = (int32_t) (degrees(_msg.packet.payload.raw_gnss.llh[1]) * 1.0e7);
gps.latitude = (int32_t) (degrees(_msg.packet.payload.raw_gnss.llh[0]) * 1.0e7);
gps.longitude = (int32_t) (degrees(_msg.packet.payload.raw_gnss.llh[1]) * 1.0e7);
gps.msl_altitude = (int32_t) (_msg.packet.payload.raw_gnss.llh[2] * 1.0e2);

gps.ned_vel_north = _msg.packet.payload.raw_gnss.velocity_ned[0];
Expand Down

0 comments on commit f613a2f

Please sign in to comment.