mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_GPS_SBF: add init string and increase union size
This commit is contained in:
parent
a057a8a009
commit
993904f01c
@ -215,6 +215,14 @@ AP_GPS::detect_instance(uint8_t instance)
|
||||
state[instance].status = NO_GPS;
|
||||
state[instance].hdop = 9999;
|
||||
|
||||
#if GPS_RTK_AVAILABLE
|
||||
// by default the sbf gps outputs no data on its port, until configured.
|
||||
if (_type[instance] == GPS_TYPE_SBF) {
|
||||
hal.console->print_P(PSTR(" SBF "));
|
||||
new_gps = new AP_GPS_SBF(*this, state[instance], _port[instance]);
|
||||
}
|
||||
#endif // GPS_RTK_AVAILABLE
|
||||
|
||||
// record the time when we started detection. This is used to try
|
||||
// to avoid initialising a uBlox as a NMEA GPS
|
||||
if (dstate->detect_started_ms == 0) {
|
||||
@ -273,10 +281,6 @@ AP_GPS::detect_instance(uint8_t instance)
|
||||
hal.console->print_P(PSTR(" SBP "));
|
||||
new_gps = new AP_GPS_SBP(*this, state[instance], _port[instance]);
|
||||
}
|
||||
else if (_type[instance] == GPS_TYPE_SBF) {
|
||||
hal.console->print_P(PSTR(" SBF "));
|
||||
new_gps = new AP_GPS_SBF(*this, state[instance], _port[instance]);
|
||||
}
|
||||
#endif // HAL_CPU_CLASS
|
||||
#if !defined(GPS_SKIP_SIRF_NMEA)
|
||||
// save a bit of code space on a 1280
|
||||
|
@ -46,6 +46,8 @@ AP_GPS_SBF::AP_GPS_SBF(AP_GPS &_gps, AP_GPS::GPS_State &_state,
|
||||
AP_GPS_Backend(_gps, _state, _port)
|
||||
{
|
||||
sbf_msg.sbf_state = sbf_msg_parser_t::PREAMBLE1;
|
||||
|
||||
port->write((const uint8_t*)_initialisation_blob[0], strlen(_initialisation_blob[0]));
|
||||
}
|
||||
|
||||
// Process all bytes available from the stream
|
||||
@ -220,8 +222,8 @@ AP_GPS_SBF::process_message(void)
|
||||
|
||||
// Update position state (dont use −2·10^10)
|
||||
if (temp.Latitude > -200000) {
|
||||
state.location.lat = (int32_t)(temp.Latitude * 57.295779513 * 1e7);
|
||||
state.location.lng = (int32_t)(temp.Longitude * 57.295779513 * 1e7);
|
||||
state.location.lat = (int32_t)(temp.Latitude * RAD_TO_DEG_DOUBLE * 1e7);
|
||||
state.location.lng = (int32_t)(temp.Longitude * RAD_TO_DEG_DOUBLE * 1e7);
|
||||
state.location.alt = (int32_t)((float)temp.Height * 1e2f);
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ private:
|
||||
union PACKED msgbuffer {
|
||||
msg4007 msg4007u;
|
||||
msg4001 msg4001u;
|
||||
uint8_t bytes[];
|
||||
uint8_t bytes[128];
|
||||
};
|
||||
|
||||
struct sbf_msg_parser_t
|
||||
|
Loading…
Reference in New Issue
Block a user