48 #include "../../definitions.h" 50 #define SBF_CONFIG_FORCE_INPUT "SSSSSSSSSS\n" 52 #define SBF_CONFIG_BAUDRATE "setCOMSettings, COM1, baud%d\n" 54 #define SBF_CONFIG_RESET "setSBFOutput, all, COM1, none, off\n" 56 #define SBF_CONFIG_RECEIVER_DYNAMICS "setReceiverDynamics, %s, UAV\n" 58 #define SBF_TX_CFG_PRT_BAUDRATE 115200 60 #define SBF_CONFIG "" \ 61 "setDataInOut, COM1, Auto, SBF\n" \ 62 "setPVTMode, Rover, All, auto\n" \ 63 "setSatelliteTracking, All\n" \ 64 "setSatelliteUsage, All\n" \ 65 "setElevationMask, All, 10\n" \ 66 "setSBFOutput, Stream1, DSK1, Support, msec100\n" \ 67 "setSBFOutput, Stream2, Dsk1, Event+Comment, OnChange\n" \ 68 "setSBFOutput, Stream3, COM1, DOP+VelCovGeodetic, sec1\n" \ 69 "setSBFOutput, Stream4, COM1, PVTGeodetic, msec100\n" \ 70 "setFileNaming, DSK1, Incremental\n" \ 71 "setFileNaming, DSK1, , 'px4'\n" 73 #define SBF_CONFIG_RTCM "" \ 74 "setDataInOut, USB1, Auto, RTCMv3+SBF\n" \ 75 "setPVTMode, Rover, All, auto\n" \ 76 "setSatelliteTracking, All\n" \ 77 "setSatelliteUsage, All\n" \ 78 "setElevationMask, All, 10\n" \ 79 "setReceiverDynamics, Moderate, Automotive\n" \ 80 "setSBFOutput, Stream1, DSK1, Support, msec100\n" \ 81 "setSBFOutput, Stream2, USB1, DOP+VelCovGeodetic, sec1\n" \ 82 "setSBFOutput, Stream3, USB1, PVTGeodetic, msec200\n" \ 83 "setFileNaming, DSK1, Incremental\n" \ 84 "setFileNaming, DSK1, , 'px4rtcm'\n" 86 #define SBF_CONFIG_RTCM_STATIC1 "" \ 87 "setReceiverDynamics, Low, Static\n" 89 #define SBF_CONFIG_RTCM_STATIC2 "" \ 90 "setPVTMode, Static, , Geodetic1\n" 92 #define SBF_CONFIG_RTCM_STATIC_COORDINATES "" \ 93 "setStaticPosGeodetic, Geodetic1, %f, %f, %f\n" 95 #define SBF_CONFIG_RTCM_STATIC_OFFSET "" \ 96 "setAntennaOffset, Main, %f, %f, %f\n" 98 #define SBF_CONFIG_RESET_HOT "" \ 99 SBF_CONFIG_FORCE_INPUT"ExeResetReceiver, soft, none\n" 101 #define SBF_CONFIG_RESET_WARM "" \ 102 SBF_CONFIG_FORCE_INPUT"ExeResetReceiver, soft, PVTData\n" 104 #define SBF_CONFIG_RESET_COLD "" \ 105 SBF_CONFIG_FORCE_INPUT"ExeResetReceiver, hard, SatData\n" 107 #define SBF_SYNC1 0x24 108 #define SBF_SYNC2 0x40 111 #define SBF_ID_DOP 4001 112 #define SBF_ID_PVTGeodetic 4007 113 #define SBF_ID_ChannelStatus 4013 114 #define SBF_ID_VelCovGeodetic 5908 117 #pragma pack(push, 1) 276 uint8_t msg_revision:
314 uint8_t dynamic_model);
318 int receive(
unsigned timeout)
override;
319 int configure(
unsigned &
baudrate, OutputMode output_mode)
override;
327 int parseChar(
const uint8_t b);
332 int payloadRxAdd(
const uint8_t b);
337 int payloadRxDone(
void);
342 void decodeInit(
void);
348 bool sendMessage(
const char *
msg);
354 bool sendMessageAndWaitForAck(
const char *msg,
const int timeout);
358 uint8_t _dynamic_model{ 7 };
359 uint64_t _last_timestamp_time { 0 };
360 bool _configured {
false };
361 uint8_t _msg_status { 0 };
363 uint16_t _rx_payload_index { 0 };
365 OutputMode _output_mode { OutputMode::GPS };
369 uint16_t
crc16(
const uint8_t *buf, uint32_t len);
float cog
Course over ground: this is defined as the angle of the vehicle with respect to the local level North...
uint8_t mode_reserved
Reserved.
uint8_t error
PVT error code.
float cov_vn_vu
Covariance between the north - and up - velocity estimates.
float cov_vu_dt
Covariance between the up - velocity and clock drift estimates.
float cov_dt_dt
Variance of the clock drift estimate.
float cov_vn_ve
Covariance between the north - and east - velocity estimates.
uint8_t time_system
Time system of which the offset is provided in this sub-block: 0:GPStime 1:Galileotime 3:GLONASStime...
float ve
Velocity in the East direction.
double rx_clk_bias
Receiver clock bias relative to system time reported in the Time System field.
uint16_t reference_id
In case of DGPS or RTK operation, this field is to be interpreted as the base station identifier...
float vpl
Vertical Protection Level (see the DO229 standard).
uint8_t alert_flag
Bit field indicating integrity related information.
int reset(enum LPS22HB_BUS busid)
Reset the driver.
uint8_t mode_2d
2D/3D flag: set in 2D mode(height assumed constant and not computed).
uint8_t error
PVT error code.
float cov_ve_dt
Covariance between the east - velocity and clock drift estimates.
static enum ST24_DECODE_STATE _decode_state
double height
Marker ellipsoidal height (with respect to the ellipsoid specified by Datum)
static char msg[NUM_MSG][CONFIG_USART1_TXBUFSIZE]
uint8_t mode_type
Bit field indicating the PVT mode type, as follows: 0: No PVT available (the Error field indicates th...
float vn
Velocity in the North direction.
int(* GPSCallbackPtr)(GPSCallbackType type, void *data1, int data2, void *user)
Callback function for platform-specific stuff.
double latitude
Marker latitude, from −π/2 to +π/2, positive North of Equator.
uint16_t length
block revision number, starting from 0 at the initial block definition, and incrementing each time ba...
uint16_t mean_corr_age
In case of DGPS or RTK, this field is the mean age of the differential corrections.
double longitude
Marker longitude, from −π to +π, positive East of Greenwich.
float cov_ve_ve
Variance of the east-velocity estimate.
float cov_ve_vu
Covariance between the east - and up - velocity estimates.
uint32_t TOW
The Length field is a 2-byte unsigned integer containing the size of the SBF block.
GPS driver base class with Base Station Support.
uint8_t mode_type
Bit field indicating the PVT mode type, as follows: 0: No PVT available (the Error field indicates th...
float RxClkDrift
Receiver clock drift relative to system time (relative frequency error)
uint8_t mode_base_fixed
Set if the user has entered the command setPVTMode,base,auto and the receiver is still in the process...
uint8_t datum
This field defines in which datum the coordinates are expressed: 0: WGS84/ITRS 19: Datum equal to tha...
float undulation
Geoid undulation computed from the global geoid model defined in the document ’Technical Characteris...
float cov_vn_dt
Covariance between the north - velocity and clock drift estimates.
uint16_t WNc
The GPS week number associated with the TOW.
uint8_t nr_sv
Total number of satellites used in the PVT computation.
uint8_t wa_corr_info
Bit field providing information about which wide area corrections have been applied: Bit 0: set if or...
uint8_t mode_base_fixed
Set if the user has entered the command setPVTMode,base,auto and the receiver is still in the process...
uint8_t nr_sv
Total number of satellites used in the PVT computation.
sbf_payload_vel_cov_geodetic_t payload_vel_col_geodetic
sbf_payload_pvt_geodetic_t payload_pvt_geodetic
uint16_t crc16(const uint8_t *buf, uint32_t len)
Calculate buffer CRC16.
float cov_vn_vn
Variance of the north-velocity estimate.
uint8_t mode_reserved
Reserved.
float vu
Velocity in the Up direction.
sbf_payload_dop_t payload_dop
uint32_t signal_info
Bit field indicating the type of GNSS signals having been used in the PVT computations.
float hpl
Horizontal Protection Level (see the DO229 standard).
float cov_vu_vu
Variance of the up - velocity estimate.
uint16_t crc16
The Sync field is a 2-byte array always set to 0x24, 0x40.
uint8_t mode_2d
2D/3D flag: set in 2D mode(height assumed constant and not computed).