54 #define ERB_SYNC_1 0x45 // E 55 #define ERB_SYNC_2 0x52 // R 57 #define ERB_ID_VERSION 0x01 58 #define ERB_ID_GEODIC_POSITION 0x02 59 #define ERB_ID_NAV_STATUS 0x03 60 #define ERB_ID_DOPS 0x04 61 #define ERB_ID_VELOCITY_NED 0x05 62 #define ERB_ID_SPACE_INFO 0x06 // not used, reduces stack usage 63 #define ERB_ID_RTK 0x07 // RTK, TODO 66 #define EMLID_UNUSED(x) (void)x; 68 #define GPS_PI 3.141592653589793238462643383280f 70 #define AUTO_DETECT_MAX_READ_SENTENCE 5 // if more detect succeed 76 _gps_position(gps_position), _satellite_info(satellite_info)
85 GPS_WARN(
"EMLIDREACH: Unsupported Output Mode %i", (
int)output_mode);
89 unsigned baud_allowed[] {57600, 115200, 230400};
91 for (
unsigned i = 0; i <
sizeof(baud_allowed) /
sizeof(baud_allowed[0]); i++) {
92 if (baudrate > 0 && baudrate != baud_allowed[i]) {
109 baudrate = baud_allowed[i];
131 unsigned read_buff_len = 0;
132 uint8_t read_ind = 0;
133 int return_status = 0;
139 read_buff_len =
read(read_buff,
sizeof(read_buff), timeout);
141 if (read_buff_len > 0) {
146 while (read_ind < read_buff_len) {
160 if (return_status > 0) {
161 return return_status;
181 uint8_t *buff_ptr = (uint8_t *)&
_erb_buff;
254 uint8_t cka = 0, ckb = 0;
256 for (
unsigned i = 2; i < _erb_payload_len + static_cast<unsigned>(
ERB_HEADER_LEN); i++) {
erb_navigation_status_t navigation_status
#define ERB_ID_SPACE_INFO
uint16_t _erb_payload_len
#define ERB_SENTENCE_MAX_LEN
unsigned _sentence_cnt
counts decoded sentence when testing connection
int setBaudrate(int baudrate)
set the Baudrate
GPSDriverEmlidReach(GPSCallbackPtr callback, void *callback_user, struct vehicle_gps_position_s *gps_position, struct satellite_info_s *satellite_info)
struct vehicle_gps_position_s * _gps_position
Pointer provided by caller, ie gps.cpp.
erb_geodic_position_t geodic_position
ERB_State _erb_decode_state
NMEA parser state machine.
int read(uint8_t *buf, int buf_length, int timeout)
read from device
erb_checksum_t _erb_checksum
Buffer used by parser to build ERB checksum.
erb_message_t _erb_buff
Buffer used by parser to build ERB sentences.
uint32_t _last_VEL_timeGPS
int erbParseChar(uint8_t b)
Feed ERB parser with received bytes from serial.
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
int(* GPSCallbackPtr)(GPSCallbackType type, void *data1, int data2, void *user)
Callback function for platform-specific stuff.
#define AUTO_DETECT_MAX_READ_SENTENCE
#define GPS_READ_BUFFER_SIZE
buffer size for the read() call. Messages can be longer than that.
uint32_t _last_POS_timeGPS
#define ERB_ID_GEODIC_POSITION
int handleErbSentence()
ERB sentence into vehicle_gps_position_s or satellite_info_s, to be used by GPSHelper.
uint8_t _rate_count_lat_lon
erb_ned_velocity_t ned_velocity
#define ERB_ID_NAV_STATUS
#define gps_absolute_time
Get the current time in us.
int configure(unsigned &baudrate, OutputMode output_mode) override
configure the device
int receive(unsigned timeout) override
receive & handle new data from the device
#define ERB_ID_VELOCITY_NED