ROSaic
|
Can search buffer for messages, read/parse them, and so on. More...
#include <rx_message.hpp>
Public Member Functions | |
RxMessage (const uint8_t *data, std::size_t &size) | |
Constructor of the RxMessage class. More... | |
bool | isMessage (const uint16_t ID) |
Determines whether data_ points to the SBF block with ID "ID", e.g. 5003. More... | |
bool | isMessage (std::string ID) |
Determines whether data_ points to the NMEA message with ID "ID", e.g. "$GPGGA". More... | |
bool | isSBF () |
Determines whether data_ currently points to an SBF block. More... | |
bool | isNMEA () |
Determines whether data_ currently points to an NMEA message. More... | |
bool | isResponse () |
Determines whether data_ currently points to an NMEA message. More... | |
bool | isConnectionDescriptor () |
bool | isErrorMessage () |
Determines whether data_ currently points to an error message reply from the Rx. More... | |
std::size_t | messageSize () |
Determines size of the message (also command reply) that data_ is currently pointing at. More... | |
std::string | messageID () |
std::size_t | getCount () |
Returns the count_ variable. More... | |
const uint8_t * | search () |
Searches the buffer for the beginning of the next message (NMEA or SBF) More... | |
uint16_t | getBlockLength () |
Gets the length of the SBF block. More... | |
const uint8_t * | getPosBuffer () |
Gets the current position in the read buffer. More... | |
const uint8_t * | getEndBuffer () |
Gets the end position in the read buffer. More... | |
bool | found () |
Has an NMEA message, SBF block or command reply been found in the buffer? More... | |
void | next () |
Goes to the start of the next message based on the calculated length of current message. More... | |
template<typename T > | |
bool | read (typename boost::call_traits< T >::reference message, std::string message_key, bool search=false) |
Performs the CRC check (if SBF) and populates ROS message "message" with the necessary content. More... | |
Data Fields | |
bool | found_ |
Whether or not a message has been found. More... | |
Private Types | |
typedef std::map< uint16_t, TypeOfPVT_Enum > | TypeOfPVTMap |
Shorthand for the map responsible for matching PVTGeodetic's Mode field to an enum value. More... | |
typedef std::map< std::string, RxID_Enum > | RxIDMap |
Shorthand for the map responsible for matching ROS message identifiers to an enum value. More... | |
Private Member Functions | |
rosaic::PVTCartesianPtr | PVTCartesianCallback (PVTCartesian &data) |
Callback function when reading PVTCartesian blocks. More... | |
rosaic::PVTGeodeticPtr | PVTGeodeticCallback (PVTGeodetic &data) |
Callback function when reading PVTGeodetic blocks. More... | |
rosaic::PosCovCartesianPtr | PosCovCartesianCallback (PosCovCartesian &data) |
Callback function when reading PosCovCartesian blocks. More... | |
rosaic::PosCovGeodeticPtr | PosCovGeodeticCallback (PosCovGeodetic &data) |
Callback function when reading PosCovGeodetic blocks. More... | |
rosaic::AttEulerPtr | AttEulerCallback (AttEuler &data) |
Callback function when reading AttEuler blocks. More... | |
rosaic::AttCovEulerPtr | AttCovEulerCallback (AttCovEuler &data) |
Callback function when reading AttCovEuler blocks. More... | |
sensor_msgs::NavSatFixPtr | NavSatFixCallback () |
"Callback" function when constructing NavSatFix messages More... | |
gps_common::GPSFixPtr | GPSFixCallback () |
"Callback" function when constructing GPSFix messages More... | |
geometry_msgs::PoseWithCovarianceStampedPtr | PoseWithCovarianceStampedCallback () |
"Callback" function when constructing PoseWithCovarianceStamped messages More... | |
diagnostic_msgs::DiagnosticArrayPtr | DiagnosticArrayCallback () |
"Callback" function when constructing diagnostic_msgs::DiagnosticArray messages More... | |
Private Attributes | |
const uint8_t * | data_ |
Pointer to the buffer of messages. More... | |
std::size_t | count_ |
Number of unread bytes in the buffer. More... | |
bool | crc_check_ |
Whether the CRC check as evaluated in the read() method was successful or not is stored here. More... | |
std::size_t | message_size_ |
Helps to determine size of response message / NMEA message / SBF block. More... | |
Static Private Attributes | |
static uint32_t | count_gpsfix_ = 0 |
Number of times the gps_common::GPSFix message has been published. More... | |
static PVTGeodetic | last_pvtgeodetic_ = PVTGeodetic() |
Since NavSatFix etc. need PVTGeodetic, incoming PVTGeodetic blocks need to be stored. More... | |
static PosCovGeodetic | last_poscovgeodetic_ = PosCovGeodetic() |
Since NavSatFix etc. need PosCovGeodetic, incoming PosCovGeodetic blocks need to be stored. More... | |
static AttEuler | last_atteuler_ = AttEuler() |
Since GPSFix etc. need AttEuler, incoming AttEuler blocks need to be stored. More... | |
static AttCovEuler | last_attcoveuler_ = AttCovEuler() |
Since GPSFix etc. need AttCovEuler, incoming AttCovEuler blocks need to be stored. More... | |
static ChannelStatus | last_channelstatus_ = ChannelStatus() |
Since GPSFix needs ChannelStatus, incoming ChannelStatus blocks need to be stored. More... | |
static MeasEpoch | last_measepoch_ = MeasEpoch() |
Since GPSFix needs MeasEpoch (for SNRs), incoming MeasEpoch blocks need to be stored. More... | |
static DOP | last_dop_ = DOP() |
Since GPSFix needs DOP, incoming DOP blocks need to be stored. More... | |
static VelCovGeodetic | last_velcovgeodetic_ = VelCovGeodetic() |
Since GPSFix needs VelCovGeodetic, incoming VelCovGeodetic blocks need to be stored. More... | |
static ReceiverStatus | last_receiverstatus_ = ReceiverStatus() |
Since DiagnosticArray needs ReceiverStatus, incoming ReceiverStatus blocks need to be stored. More... | |
static QualityInd | last_qualityind_ = QualityInd() |
Since DiagnosticArray needs QualityInd, incoming QualityInd blocks need to be stored. More... | |
static ReceiverSetup | last_receiversetup_ = ReceiverSetup() |
Since DiagnosticArray needs ReceiverSetup, incoming ReceiverSetup blocks need to be stored. More... | |
static TypeOfPVTMap | type_of_pvt_map |
All instances of the RxMessage class shall have access to the map without reinitializing it, hence static. More... | |
static RxIDMap | rx_id_map |
All instances of the RxMessage class shall have access to the map without reinitializing it, hence static. More... | |
Can search buffer for messages, read/parse them, and so on.
Definition at line 200 of file rx_message.hpp.
|
private |
Shorthand for the map responsible for matching ROS message identifiers to an enum value.
Definition at line 384 of file rx_message.hpp.
|
private |
Shorthand for the map responsible for matching PVTGeodetic's Mode field to an enum value.
Definition at line 376 of file rx_message.hpp.
|
inline |
Constructor of the RxMessage class.
One can always provide a non-const value where a const one was expected. The const-ness of the argument just means the function promises not to change it.. Recall: static_cast by the way can remove or add const-ness, no other C++ cast is capable of removing it (not even reinterpret_cast)
[in] | data | Pointer to the buffer that is about to be analyzed |
[in] | size | Size of the buffer (as handed over by async_read_some) |
Definition at line 213 of file rx_message.hpp.
References crc_check_, found_, isConnectionDescriptor(), isErrorMessage(), isMessage(), isNMEA(), isResponse(), isSBF(), message_size_, messageID(), and messageSize().
|
private |
Callback function when reading AttCovEuler blocks.
[in] | data | The (packed and aligned) struct instance used to populate the ROS message AttCovEuler |
Definition at line 252 of file rx_message.cpp.
References AttCovEuler::block_header, AttCovEuler::cov_headhead, AttCovEuler::cov_headpitch, AttCovEuler::cov_headroll, AttCovEuler::cov_pitchpitch, AttCovEuler::cov_pitchroll, AttCovEuler::cov_rollroll, BlockHeader_t::crc, AttCovEuler::error, BlockHeader_t::id, BlockHeader_t::length, BlockHeader_t::sync_1, BlockHeader_t::sync_2, AttCovEuler::tow, and AttCovEuler::wnc.
Referenced by read().
|
private |
Callback function when reading AttEuler blocks.
[in] | data | The (packed and aligned) struct instance used to populate the ROS message AttEuler |
Definition at line 230 of file rx_message.cpp.
References AttEuler::block_header, BlockHeader_t::crc, AttEuler::error, AttEuler::heading, AttEuler::heading_dot, BlockHeader_t::id, BlockHeader_t::length, AttEuler::mode, AttEuler::nr_sv, AttEuler::pitch, AttEuler::pitch_dot, AttEuler::roll, AttEuler::roll_dot, BlockHeader_t::sync_1, BlockHeader_t::sync_2, AttEuler::tow, and AttEuler::wnc.
Referenced by read().
|
private |
"Callback" function when constructing diagnostic_msgs::DiagnosticArray messages
Definition at line 332 of file rx_message.cpp.
References QualityInd::indicators, last_qualityind_, last_receiversetup_, last_receiverstatus_, QualityInd::n, ReceiverStatus::rx_error, and ReceiverSetup::rx_serial_number.
Referenced by read().
bool io_comm_rx::RxMessage::found | ( | ) |
Has an NMEA message, SBF block or command reply been found in the buffer?
Definition at line 820 of file rx_message.cpp.
References found_, g_read_cd, isConnectionDescriptor(), isNMEA(), isResponse(), and isSBF().
Referenced by getCount(), next(), read(), and io_comm_rx::CallbackHandlers::readCallback().
uint16_t io_comm_rx::RxMessage::getBlockLength | ( | ) |
Gets the length of the SBF block.
It determines the length from the header of the SBF block. The block length thus includes the header length.
Definition at line 1066 of file rx_message.cpp.
References data_, and isSBF().
Referenced by getCount(), next(), and io_comm_rx::CallbackHandlers::readCallback().
|
inline |
Returns the count_ variable.
Definition at line 241 of file rx_message.hpp.
References count_, found(), getBlockLength(), getEndBuffer(), getPosBuffer(), next(), read(), and search().
Referenced by io_comm_rx::CallbackHandlers::readCallback().
const uint8_t * io_comm_rx::RxMessage::getEndBuffer | ( | ) |
Gets the end position in the read buffer.
Definition at line 1061 of file rx_message.cpp.
Referenced by getCount(), and io_comm_rx::CallbackHandlers::readCallback().
const uint8_t * io_comm_rx::RxMessage::getPosBuffer | ( | ) |
Gets the current position in the read buffer.
Definition at line 1056 of file rx_message.cpp.
References data_.
Referenced by getCount(), and io_comm_rx::CallbackHandlers::readCallback().
|
private |
"Callback" function when constructing GPSFix messages
For some unknown reason, the first 2 entries of the GPSStatus field's arrays are not shown properly when published. Please consult section 4.1.9 of the firmware (at least for mosaic-x5) to understand the meaning of the SV identifiers used in the arrays of the GPSStatus field. Note that the field "dip" denotes the local magnetic inclination in degrees (positive when the magnetic field points downwards (into the Earth)). This quantity cannot be calculated by most Septentrio receivers. We assume that for the ROS field "err_time", we are requested to provide the 2 sigma uncertainty on the clock bias estimate in square meters, not the clock drift estimate (latter would be "2*std::sqrt(static_cast<double>(last_velcovgeodetic_.Cov_DtDt))"). The "err_track" entry is calculated via the Gaussian error propagation formula from the eastward and the northward velocities. For the formula's usage we have to assume that the eastward and the northward velocities are independent variables. Note that elevations and azimuths of visible satellites are taken from the ChannelStatus block, which provides 1 degree precision, while the SatVisibility block could provide hundredths of degrees precision. Change if imperative for your application... Definition of "visible satellite" adopted here: We define a visible satellite as being !up to! "in sync" mode with the receiver, which corresponds to last_measepoch_.N (signal-to-noise ratios are thereby available for these), though not last_channelstatus_.N, which also includes those "in search". In case certain values appear unphysical, please consult the firmware, since those most likely refer to Do-Not-Use values.
Definition at line 519 of file rx_message.cpp.
References ChannelSatInfo::az_rise_set, ChannelStatus::block_header, MeasEpoch::block_header, MeasEpochChannelType1::cn0, PVTGeodetic::cog, PosCovGeodetic::cov_bb, PosCovGeodetic::cov_hgthgt, PosCovGeodetic::cov_lathgt, PosCovGeodetic::cov_latlat, PosCovGeodetic::cov_latlon, PosCovGeodetic::cov_lonhgt, PosCovGeodetic::cov_lonlon, AttCovEuler::cov_pitchpitch, AttCovEuler::cov_rollroll, VelCovGeodetic::cov_veve, VelCovGeodetic::cov_vnvn, VelCovGeodetic::cov_vuvu, ChannelStatus::data, MeasEpoch::data, ChannelSatInfo::elev, evDGPS, evFixed, evMovingBaseRTKFixed, evMovingBaseRTKFloat, evNoPVT, evPPP, evRTKFixed, evRTKFloat, evSBAS, evStandAlone, DOP::hdop, PVTGeodetic::height, last_attcoveuler_, last_atteuler_, last_channelstatus_, last_dop_, last_measepoch_, last_poscovgeodetic_, last_pvtgeodetic_, last_velcovgeodetic_, PVTGeodetic::latitude, PVTGeodetic::longitude, PVTGeodetic::mode, ChannelStatus::n, MeasEpoch::n, ChannelSatInfo::n2, MeasEpochChannelType1::n_type2, PVTGeodetic::nr_sv, DOP::pdop, AttEuler::pitch, ChannelStateInfo::pvt_status, PVTGeodetic::reference_id, AttEuler::roll, ChannelStatus::sb1_size, MeasEpoch::sb1_size, ChannelStatus::sb2_size, MeasEpoch::sb2_size, ChannelSatInfo::sv_id, MeasEpochChannelType1::sv_id, BlockHeader_t::sync_1, DOP::tdop, PVTGeodetic::tow, MeasEpochChannelType1::type, type_of_pvt_map, DOP::vdop, PVTGeodetic::ve, PVTGeodetic::vn, PVTGeodetic::vu, and PVTGeodetic::wnc.
Referenced by read().
bool io_comm_rx::RxMessage::isConnectionDescriptor | ( | ) |
Determines whether data_ currently points to a connection descriptor (right after initiating a TCP connection)
Definition at line 991 of file rx_message.cpp.
References CONNECTION_DESCRIPTOR_BYTE_1, CONNECTION_DESCRIPTOR_BYTE_2, count_, and data_.
Referenced by found(), next(), io_comm_rx::CallbackHandlers::readCallback(), RxMessage(), and search().
bool io_comm_rx::RxMessage::isErrorMessage | ( | ) |
Determines whether data_ currently points to an error message reply from the Rx.
Definition at line 1010 of file rx_message.cpp.
References count_, data_, RESPONSE_SYNC_BYTE_1, RESPONSE_SYNC_BYTE_2, and RESPONSE_SYNC_BYTE_3.
Referenced by io_comm_rx::CallbackHandlers::readCallback(), and RxMessage().
bool io_comm_rx::RxMessage::isMessage | ( | const uint16_t | ID | ) |
Determines whether data_ points to the SBF block with ID "ID", e.g. 5003.
Definition at line 886 of file rx_message.cpp.
References data_, and isSBF().
Referenced by RxMessage().
bool io_comm_rx::RxMessage::isMessage | ( | std::string | ID | ) |
Determines whether data_ points to the NMEA message with ID "ID", e.g. "$GPGGA".
Definition at line 909 of file rx_message.cpp.
References data_, isNMEA(), and messageSize().
bool io_comm_rx::RxMessage::isNMEA | ( | ) |
Determines whether data_ currently points to an NMEA message.
Definition at line 952 of file rx_message.cpp.
References count_, data_, NMEA_SYNC_BYTE_1, NMEA_SYNC_BYTE_2_1, and NMEA_SYNC_BYTE_2_2.
Referenced by found(), isMessage(), messageID(), next(), io_comm_rx::CallbackHandlers::readCallback(), RxMessage(), and search().
bool io_comm_rx::RxMessage::isResponse | ( | ) |
Determines whether data_ currently points to an NMEA message.
Definition at line 972 of file rx_message.cpp.
References count_, data_, RESPONSE_SYNC_BYTE_1, and RESPONSE_SYNC_BYTE_2.
Referenced by found(), messageSize(), next(), io_comm_rx::CallbackHandlers::readCallback(), RxMessage(), and search().
bool io_comm_rx::RxMessage::isSBF | ( | ) |
Determines whether data_ currently points to an SBF block.
Definition at line 933 of file rx_message.cpp.
References count_, data_, SBF_SYNC_BYTE_1, and SBF_SYNC_BYTE_2.
Referenced by found(), getBlockLength(), isMessage(), messageID(), next(), read(), io_comm_rx::CallbackHandlers::readCallback(), RxMessage(), and search().
std::string io_comm_rx::RxMessage::messageID | ( | ) |
Returns the message ID of the message where data_ is pointing at at the moment, SBF identifiers embellished with inverted commas, e.g. "5003"
Definition at line 1029 of file rx_message.cpp.
References data_, isNMEA(), isSBF(), and messageSize().
Referenced by io_comm_rx::CallbackHandler< T >::handle(), io_comm_rx::CallbackHandlers::handle(), read(), io_comm_rx::CallbackHandlers::readCallback(), and RxMessage().
std::size_t io_comm_rx::RxMessage::messageSize | ( | ) |
Determines size of the message (also command reply) that data_ is currently pointing at.
Definition at line 852 of file rx_message.cpp.
References CARRIAGE_RETURN, count_, data_, isResponse(), LINE_FEED, and message_size_.
Referenced by isMessage(), messageID(), read(), io_comm_rx::CallbackHandlers::readCallback(), and RxMessage().
|
private |
"Callback" function when constructing NavSatFix messages
The position_covariance array is populated in row-major order, where the basis of the corresponding matrix is ENU (so Cov_lonlon is in location 11 of the matrix). The B2b signal type of BeiDou is not checked for usage, since the SignalInfo field of the PVTGeodetic block does not disclose it. For that, one would need to go to the ObsInfo field of the MeasEpochChannelType1 sub-block.
Definition at line 430 of file rx_message.cpp.
References PosCovGeodetic::cov_hgthgt, PosCovGeodetic::cov_lathgt, PosCovGeodetic::cov_latlat, PosCovGeodetic::cov_latlon, PosCovGeodetic::cov_lonhgt, PosCovGeodetic::cov_lonlon, evDGPS, evFixed, evMovingBaseRTKFixed, evMovingBaseRTKFloat, evNoPVT, evPPP, evRTKFixed, evRTKFloat, evSBAS, evStandAlone, PVTGeodetic::height, last_poscovgeodetic_, last_pvtgeodetic_, PVTGeodetic::latitude, PVTGeodetic::longitude, PVTGeodetic::mode, PVTGeodetic::signal_info, and type_of_pvt_map.
Referenced by read().
void io_comm_rx::RxMessage::next | ( | ) |
Goes to the start of the next message based on the calculated length of current message.
This method won't make data_ jump to the next message if the current one is an NMEA message or a command reply. In that case, search() will check the bytes one by one for the new message's sync bytes ($P, $G or $R).
Definition at line 1086 of file rx_message.cpp.
References count_, crc_check_, data_, found(), found_, g_cd_count, g_read_cd, getBlockLength(), isConnectionDescriptor(), isNMEA(), isResponse(), and isSBF().
Referenced by getCount(), and search().
|
private |
Callback function when reading PosCovCartesian blocks.
[in] | data | The (packed and aligned) struct instance used to populate the ROS message PosCovCartesian |
Definition at line 179 of file rx_message.cpp.
References PosCovCartesian::block_header, PosCovCartesian::cov_bb, PosCovCartesian::cov_xb, PosCovCartesian::cov_xx, PosCovCartesian::cov_xy, PosCovCartesian::cov_xz, PosCovCartesian::cov_yb, PosCovCartesian::cov_yy, PosCovCartesian::cov_yz, PosCovCartesian::cov_zb, PosCovCartesian::cov_zz, BlockHeader_t::crc, PosCovCartesian::error, BlockHeader_t::id, BlockHeader_t::length, PosCovCartesian::mode, BlockHeader_t::sync_1, BlockHeader_t::sync_2, PosCovCartesian::tow, and PosCovCartesian::wnc.
Referenced by read().
|
private |
Callback function when reading PosCovGeodetic blocks.
[in] | data | The (packed and aligned) struct instance used to populate the ROS message PosCovGeodetic |
Definition at line 205 of file rx_message.cpp.
References PosCovGeodetic::block_header, PosCovGeodetic::cov_bb, PosCovGeodetic::cov_hb, PosCovGeodetic::cov_hgthgt, PosCovGeodetic::cov_latb, PosCovGeodetic::cov_lathgt, PosCovGeodetic::cov_latlat, PosCovGeodetic::cov_latlon, PosCovGeodetic::cov_lonb, PosCovGeodetic::cov_lonhgt, PosCovGeodetic::cov_lonlon, BlockHeader_t::crc, PosCovGeodetic::error, BlockHeader_t::id, BlockHeader_t::length, PosCovGeodetic::mode, BlockHeader_t::sync_1, BlockHeader_t::sync_2, PosCovGeodetic::tow, and PosCovGeodetic::wnc.
Referenced by read().
|
private |
"Callback" function when constructing PoseWithCovarianceStamped messages
The position_covariance array is populated in row-major order, where the basis of the correspond matrix is (E, N, U, Roll, Pitch, Heading). Important: The Euler angles (Roll, Pitch, Heading) are with respect to a vehicle-fixed (e.g. for mosaic-x5 in moving base mode via the command setAntennaLocation, ...) !local! NED frame. Thus the orientation is !not! given with respect to the same frame as the position is given in. The cross-covariances are hence (apart from the fact that e.g. mosaic receivers do not calculate these quantities) set to zero. The position and the partial (with 2 antennas) or full (for INS receivers) orientation have covariances matrices available e.g. in the PosCovGeodetic or AttCovEuler blocks, yet those are separate computations.
Definition at line 282 of file rx_message.cpp.
References parsing_utilities::convertEulerToQuaternion(), AttCovEuler::cov_headhead, AttCovEuler::cov_headpitch, AttCovEuler::cov_headroll, PosCovGeodetic::cov_hgthgt, PosCovGeodetic::cov_lathgt, PosCovGeodetic::cov_latlat, PosCovGeodetic::cov_latlon, PosCovGeodetic::cov_lonhgt, PosCovGeodetic::cov_lonlon, AttCovEuler::cov_pitchpitch, AttCovEuler::cov_pitchroll, AttCovEuler::cov_rollroll, AttEuler::heading, PVTGeodetic::height, last_attcoveuler_, last_atteuler_, last_poscovgeodetic_, last_pvtgeodetic_, PVTGeodetic::latitude, PVTGeodetic::longitude, AttEuler::pitch, and AttEuler::roll.
Referenced by read().
|
private |
Callback function when reading PVTCartesian blocks.
[in] | data | The (packed and aligned) struct instance used to populate the ROS message PVTCartesian |
Definition at line 140 of file rx_message.cpp.
References PVTCartesian::alert_flag, PVTCartesian::block_header, PVTCartesian::cog, BlockHeader_t::crc, PVTCartesian::datum, PVTCartesian::error, PVTCartesian::h_accuracy, BlockHeader_t::id, PVTCartesian::latency, BlockHeader_t::length, PVTCartesian::mean_corr_age, PVTCartesian::misc, PVTCartesian::mode, PVTCartesian::nr_bases, PVTCartesian::nr_sv, PVTCartesian::ppp_info, PVTCartesian::reference_id, PVTCartesian::rx_clk_bias, PVTCartesian::rx_clk_drift, PVTCartesian::signal_info, BlockHeader_t::sync_1, BlockHeader_t::sync_2, PVTCartesian::time_system, PVTCartesian::tow, PVTCartesian::undulation, PVTCartesian::v_accuracy, PVTCartesian::vx, PVTCartesian::vy, PVTCartesian::vz, PVTCartesian::wa_corr_info, PVTCartesian::wnc, PVTCartesian::x, PVTCartesian::y, and PVTCartesian::z.
Referenced by read().
|
private |
Callback function when reading PVTGeodetic blocks.
[in] | data | The (packed and aligned) struct instance used to populate the ROS message PVTGeodetic |
Definition at line 100 of file rx_message.cpp.
References PVTGeodetic::alert_flag, PVTGeodetic::block_header, PVTGeodetic::cog, BlockHeader_t::crc, PVTGeodetic::datum, PVTGeodetic::error, PVTGeodetic::h_accuracy, PVTGeodetic::height, BlockHeader_t::id, PVTGeodetic::latency, PVTGeodetic::latitude, BlockHeader_t::length, PVTGeodetic::longitude, PVTGeodetic::mean_corr_age, PVTGeodetic::misc, PVTGeodetic::mode, PVTGeodetic::nr_bases, PVTGeodetic::nr_sv, PVTGeodetic::ppp_info, PVTGeodetic::reference_id, PVTGeodetic::rx_clk_bias, PVTGeodetic::rx_clk_drift, PVTGeodetic::signal_info, BlockHeader_t::sync_1, BlockHeader_t::sync_2, PVTGeodetic::time_system, PVTGeodetic::tow, PVTGeodetic::undulation, PVTGeodetic::v_accuracy, PVTGeodetic::ve, PVTGeodetic::vn, PVTGeodetic::vu, PVTGeodetic::wa_corr_info, and PVTGeodetic::wnc.
Referenced by read().
bool io_comm_rx::RxMessage::read | ( | typename boost::call_traits< T >::reference | message, |
std::string | message_key, | ||
bool | search = false |
||
) |
Performs the CRC check (if SBF) and populates ROS message "message" with the necessary content.
Note that the boost::call_traits<T>::reference is more robust than the traditional T&. Note that this function can also deal with the appropriate !derived! parser in case T is an NMEA message. Note that putting the default in the definition's argument list instead of the declaration's is an added extra that is not available for function templates, hence no search = false here. Also note that it is bad practice (one gets undefined reference to .. error) to separate the definition of template functions into the source file and declarations into header file. Also note that the SBF block header part of the SBF-echoing ROS messages have ID fields that only show the block number as found in the firmware (e.g. 4007 for PVTGeodetic), without the revision number. NMEA 0183 messages are at most 82 characters long in principle, but most Septentrio Rxs by default increase precision on lat/lon s.t. the maximum allowed e.g. for GGA seems to be 89 on a mosaic-x5. Luckily, when parsing we do not care since we just search for <LF><CR>.
Definition at line 477 of file rx_message.hpp.
References AttCovEulerCallback(), AttEulerCallback(), count_gpsfix_, crc_check_, data_, DiagnosticArrayCallback(), evAttCovEuler, evAttEuler, evChannelStatus, evDiagnosticArray, evDOP, evGAGSV, evGLGSV, evGPGGA, evGPGSA, evGPGSV, evGPRMC, evGPSFix, evGPST, evMeasEpoch, evNavSatFix, evPosCovCartesian, evPosCovGeodetic, evPoseWithCovarianceStamped, evPVTCartesian, evPVTGeodetic, evQualityInd, evReceiverSetup, evReceiverStatus, evVelCovGeodetic, found(), g_attcoveuler_has_arrived_gpsfix, g_attcoveuler_has_arrived_pose, g_atteuler_has_arrived_gpsfix, g_atteuler_has_arrived_pose, g_channelstatus_has_arrived_gpsfix, g_dop_has_arrived_gpsfix, g_frame_id, g_measepoch_has_arrived_gpsfix, g_nh, g_poscovgeodetic_has_arrived_gpsfix, g_poscovgeodetic_has_arrived_navsatfix, g_poscovgeodetic_has_arrived_pose, g_pvtgeodetic_has_arrived_gpsfix, g_pvtgeodetic_has_arrived_navsatfix, g_pvtgeodetic_has_arrived_pose, g_qualityind_has_arrived_diagnostics, g_receiverstatus_has_arrived_diagnostics, g_ROS_QUEUE_SIZE, g_use_gnss_time, g_velcovgeodetic_has_arrived_gpsfix, GPSFixCallback(), isSBF(), isValid(), last_attcoveuler_, last_atteuler_, last_channelstatus_, last_dop_, last_measepoch_, last_poscovgeodetic_, last_pvtgeodetic_, last_qualityind_, last_receiversetup_, last_receiverstatus_, last_velcovgeodetic_, messageID(), messageSize(), NavSatFixCallback(), GpgsaParser::parseASCII(), GpgsvParser::parseASCII(), GpggaParser::parseASCII(), GprmcParser::parseASCII(), PosCovCartesianCallback(), PosCovGeodeticCallback(), PoseWithCovarianceStampedCallback(), PVTCartesianCallback(), PVTGeodeticCallback(), rx_id_map, search(), io_comm_rx::timestampSBF(), and PVTGeodetic::tow.
Referenced by getCount(), and io_comm_rx::CallbackHandler< T >::handle().
const uint8_t * io_comm_rx::RxMessage::search | ( | ) |
Searches the buffer for the beginning of the next message (NMEA or SBF)
Definition at line 834 of file rx_message.cpp.
References count_, data_, found_, g_read_cd, isConnectionDescriptor(), isNMEA(), isResponse(), isSBF(), and next().
Referenced by getCount(), read(), and io_comm_rx::CallbackHandlers::readCallback().
|
private |
Number of unread bytes in the buffer.
Definition at line 303 of file rx_message.hpp.
Referenced by getCount(), getEndBuffer(), isConnectionDescriptor(), isErrorMessage(), isNMEA(), isResponse(), isSBF(), messageSize(), next(), and search().
|
staticprivate |
Number of times the gps_common::GPSFix message has been published.
Definition at line 318 of file rx_message.hpp.
Referenced by read().
|
private |
Whether the CRC check as evaluated in the read() method was successful or not is stored here.
Definition at line 308 of file rx_message.hpp.
Referenced by next(), read(), and RxMessage().
|
private |
Pointer to the buffer of messages.
Definition at line 298 of file rx_message.hpp.
Referenced by getBlockLength(), getEndBuffer(), getPosBuffer(), isConnectionDescriptor(), isErrorMessage(), isMessage(), isNMEA(), isResponse(), isSBF(), messageID(), messageSize(), next(), read(), and search().
bool io_comm_rx::RxMessage::found_ |
Whether or not a message has been found.
Definition at line 291 of file rx_message.hpp.
Referenced by found(), next(), RxMessage(), and search().
|
staticprivate |
Since GPSFix etc. need AttCovEuler, incoming AttCovEuler blocks need to be stored.
Definition at line 338 of file rx_message.hpp.
Referenced by GPSFixCallback(), PoseWithCovarianceStampedCallback(), and read().
Since GPSFix etc. need AttEuler, incoming AttEuler blocks need to be stored.
Definition at line 333 of file rx_message.hpp.
Referenced by GPSFixCallback(), PoseWithCovarianceStampedCallback(), and read().
|
staticprivate |
Since GPSFix needs ChannelStatus, incoming ChannelStatus blocks need to be stored.
Definition at line 343 of file rx_message.hpp.
Referenced by GPSFixCallback(), and read().
Since GPSFix needs DOP, incoming DOP blocks need to be stored.
Definition at line 353 of file rx_message.hpp.
Referenced by GPSFixCallback(), and read().
Since GPSFix needs MeasEpoch (for SNRs), incoming MeasEpoch blocks need to be stored.
Definition at line 348 of file rx_message.hpp.
Referenced by GPSFixCallback(), and read().
|
staticprivate |
Since NavSatFix etc. need PosCovGeodetic, incoming PosCovGeodetic blocks need to be stored.
Definition at line 328 of file rx_message.hpp.
Referenced by GPSFixCallback(), NavSatFixCallback(), PoseWithCovarianceStampedCallback(), and read().
|
staticprivate |
Since NavSatFix etc. need PVTGeodetic, incoming PVTGeodetic blocks need to be stored.
Definition at line 323 of file rx_message.hpp.
Referenced by GPSFixCallback(), NavSatFixCallback(), PoseWithCovarianceStampedCallback(), and read().
|
staticprivate |
Since DiagnosticArray needs QualityInd, incoming QualityInd blocks need to be stored.
Definition at line 368 of file rx_message.hpp.
Referenced by DiagnosticArrayCallback(), and read().
|
staticprivate |
Since DiagnosticArray needs ReceiverSetup, incoming ReceiverSetup blocks need to be stored.
Definition at line 373 of file rx_message.hpp.
Referenced by DiagnosticArrayCallback(), and read().
|
staticprivate |
Since DiagnosticArray needs ReceiverStatus, incoming ReceiverStatus blocks need to be stored.
Definition at line 363 of file rx_message.hpp.
Referenced by DiagnosticArrayCallback(), and read().
|
staticprivate |
Since GPSFix needs VelCovGeodetic, incoming VelCovGeodetic blocks need to be stored.
Definition at line 358 of file rx_message.hpp.
Referenced by GPSFixCallback(), and read().
|
private |
Helps to determine size of response message / NMEA message / SBF block.
Definition at line 313 of file rx_message.hpp.
Referenced by messageSize(), and RxMessage().
|
staticprivate |
All instances of the RxMessage class shall have access to the map without reinitializing it, hence static.
This map is for mapping ROS message, SBF and NMEA identifiers to an enumeration and makes the switch-case formalism in rx_message.hpp more explicit.
Definition at line 392 of file rx_message.hpp.
Referenced by read().
|
staticprivate |
All instances of the RxMessage class shall have access to the map without reinitializing it, hence static.
Definition at line 381 of file rx_message.hpp.
Referenced by GPSFixCallback(), and NavSatFixCallback().