ROSaic
|
Can search buffer for messages, read/parse them, and so on. More...
#include <mosaicMessage.hpp>
Public Member Functions | |
mosaicMessage (const uint8_t *data, std::size_t &size) | |
Constructor of the mosaicMessage 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 () |
Determines whether data_ currently points to a connection descriptor (right after initiating TCP connection) More... | |
bool | IsErrorMessage () |
Determines whether data_ currently points to an error message reply from mosaic. More... | |
std::size_t | SegmentEnd () |
Determines size of message that data_ is currently pointing at. More... | |
std::string | MessageID () |
Returns the MessageID of the message where data_ is pointing at at the moment, SBF identifiers embellished with inverted commas, e.g. "5003". More... | |
uint32_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 | BlockLength () |
Gets the length of the SBF block. More... | |
const uint8_t * | Pos () |
Gets the current position in the read buffer. More... | |
const uint8_t * | End () |
Gets the end position in the read buffer. More... | |
bool | Found () |
Has an NMEA message or SBF block been found in the buffer? More... | |
const uint8_t * | 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 block) and populates message with the necessary content (mapped 1-to-1 if SBF, parsed if NMEA), works for pure ROS message mapping. More... | |
Data Fields | |
bool | found_ |
Whether or not a message has been found. 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... | |
Private Attributes | |
const uint8_t * | data_ |
The pointer to the buffer of messages. More... | |
uint32_t | count_ |
The number of bytes in the buffer, decremented as the buffer is read (so it is the buffer's size in the beginning) More... | |
bool | CRCcheck_ |
Whether the CRC check as evaluated in the read() method was successful or not is stored here. More... | |
std::size_t | segment_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 etc. need ChannelStatus, incoming ChannelStatus blocks need to be stored. More... | |
static MeasEpoch | last_measepoch_ = MeasEpoch() |
Since GPSFix etc. need MeasEpoch (for signal-to-noise ratios), incoming MeasEpoch blocks need to be stored. More... | |
static DOP | last_dop_ = DOP() |
Since GPSFix etc. need DOP, incoming DOP blocks need to be stored. More... | |
static VelCovGeodetic | last_velcovgeodetic_ = VelCovGeodetic() |
Since GPSFix etc. need VelCovGeodetic (for signal-to-noise ratios), incoming VelCovGeodetic blocks need to be stored. More... | |
Can search buffer for messages, read/parse them, and so on.
Definition at line 205 of file mosaicMessage.hpp.
|
inline |
Constructor of the mosaicMessage 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 216 of file mosaicMessage.hpp.
References CRCcheck_, found_, IsConnectionDescriptor(), IsErrorMessage(), IsMessage(), IsNMEA(), IsResponse(), IsSBF(), MessageID(), segment_size_, and SegmentEnd().
|
private |
Callback function when reading AttCovEuler blocks.
[in] | data | The (packed and aligned) struct instance that we use to populate our ROS message rosaic::AttCovEuler |
Definition at line 202 of file mosaicMessage.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::SYNC1, BlockHeader_t::SYNC2, AttCovEuler::TOW, and AttCovEuler::WNc.
Referenced by Read().
|
private |
Callback function when reading AttEuler blocks.
[in] | data | The (packed and aligned) struct instance that we use to populate our ROS message rosaic::AttEuler |
Definition at line 180 of file mosaicMessage.cpp.
References AttEuler::Block_Header, BlockHeader_t::CRC, AttEuler::Error, AttEuler::Heading, AttEuler::HeadingDot, BlockHeader_t::ID, BlockHeader_t::Length, AttEuler::Mode, AttEuler::NrSV, AttEuler::Pitch, AttEuler::PitchDot, AttEuler::Roll, AttEuler::RollDot, BlockHeader_t::SYNC1, BlockHeader_t::SYNC2, AttEuler::TOW, and AttEuler::WNc.
Referenced by Read().
uint16_t io_comm_mosaic::mosaicMessage::BlockLength | ( | ) |
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 853 of file mosaicMessage.cpp.
References data_, and IsSBF().
Referenced by GetCount(), Next(), Read(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
const uint8_t * io_comm_mosaic::mosaicMessage::End | ( | ) |
Gets the end position in the read buffer.
Definition at line 848 of file mosaicMessage.cpp.
Referenced by GetCount(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
bool io_comm_mosaic::mosaicMessage::Found | ( | ) |
Has an NMEA message or SBF block been found in the buffer?
Definition at line 652 of file mosaicMessage.cpp.
References found_, IsConnectionDescriptor(), IsNMEA(), IsResponse(), IsSBF(), and read_cd.
Referenced by GetCount(), Next(), Read(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
|
inline |
Returns the count_ variable.
Definition at line 241 of file mosaicMessage.hpp.
References BlockLength(), count_, End(), Found(), Next(), Pos(), Read(), and Search().
|
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 to understand the meaning of the satellite 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 mosaic 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 its 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".
Definition at line 365 of file mosaicMessage.cpp.
References ChannelSatInfo::Az_RiseSet, 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, 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::NrSV, DOP::PDOP, AttEuler::Pitch, ChannelStateInfo::PVTStatus, PVTGeodetic::ReferenceID, AttEuler::Roll, ChannelStatus::SB1Size, MeasEpoch::SB1Size, ChannelStatus::SB2Size, MeasEpoch::SB2Size, ChannelSatInfo::SVID, MeasEpochChannelType1::SVID, svid_pvt, BlockHeader_t::SYNC1, DOP::TDOP, PVTGeodetic::TOW, MeasEpochChannelType1::Type, DOP::VDOP, PVTGeodetic::Ve, PVTGeodetic::Vn, PVTGeodetic::Vu, and PVTGeodetic::WNc.
Referenced by Read().
bool io_comm_mosaic::mosaicMessage::IsConnectionDescriptor | ( | ) |
Determines whether data_ currently points to a connection descriptor (right after initiating TCP connection)
Definition at line 794 of file mosaicMessage.cpp.
References CONNECTION_DESCRIPTOR_BYTE_1, CONNECTION_DESCRIPTOR_BYTE_2, and data_.
Referenced by Found(), mosaicMessage(), Next(), io_comm_mosaic::CallbackHandlers::ReadCallback(), and Search().
bool io_comm_mosaic::mosaicMessage::IsErrorMessage | ( | ) |
Determines whether data_ currently points to an error message reply from mosaic.
Definition at line 806 of file mosaicMessage.cpp.
References data_, RESPONSE_SYNC_BYTE_1, RESPONSE_SYNC_BYTE_2, and RESPONSE_SYNC_BYTE_3.
Referenced by mosaicMessage(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
bool io_comm_mosaic::mosaicMessage::IsMessage | ( | const uint16_t | ID | ) |
Determines whether data_ points to the SBF block with ID "ID", e.g. 5003.
Definition at line 712 of file mosaicMessage.cpp.
References data_, and IsSBF().
Referenced by mosaicMessage().
bool io_comm_mosaic::mosaicMessage::IsMessage | ( | std::string | ID | ) |
Determines whether data_ points to the NMEA message with ID "ID", e.g. "$GPGGA".
Definition at line 734 of file mosaicMessage.cpp.
References data_, IsNMEA(), and SegmentEnd().
bool io_comm_mosaic::mosaicMessage::IsNMEA | ( | ) |
Determines whether data_ currently points to an NMEA message.
Definition at line 770 of file mosaicMessage.cpp.
References data_, NMEA_SYNC_BYTE_1, NMEA_SYNC_BYTE_2_1, and NMEA_SYNC_BYTE_2_2.
Referenced by Found(), IsMessage(), MessageID(), mosaicMessage(), Next(), io_comm_mosaic::CallbackHandlers::ReadCallback(), and Search().
bool io_comm_mosaic::mosaicMessage::IsResponse | ( | ) |
Determines whether data_ currently points to an NMEA message.
Definition at line 782 of file mosaicMessage.cpp.
References data_, RESPONSE_SYNC_BYTE_1, and RESPONSE_SYNC_BYTE_2.
Referenced by Found(), mosaicMessage(), Next(), io_comm_mosaic::CallbackHandlers::ReadCallback(), Search(), and SegmentEnd().
bool io_comm_mosaic::mosaicMessage::IsSBF | ( | ) |
Determines whether data_ currently points to an SBF block.
Definition at line 758 of file mosaicMessage.cpp.
References data_, SBF_SYNC_BYTE_1, and SBF_SYNC_BYTE_2.
Referenced by BlockLength(), Found(), IsMessage(), MessageID(), mosaicMessage(), Next(), Read(), io_comm_mosaic::CallbackHandlers::ReadCallback(), and Search().
std::string io_comm_mosaic::mosaicMessage::MessageID | ( | ) |
Returns the MessageID of the message where data_ is pointing at at the moment, SBF identifiers embellished with inverted commas, e.g. "5003".
Definition at line 818 of file mosaicMessage.cpp.
References data_, IsNMEA(), IsSBF(), and SegmentEnd().
Referenced by io_comm_mosaic::CallbackHandler< T >::Handle(), io_comm_mosaic::CallbackHandlers::Handle(), mosaicMessage(), Read(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
|
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 283 of file mosaicMessage.cpp.
References PosCovGeodetic::Cov_hgthgt, PosCovGeodetic::Cov_lathgt, PosCovGeodetic::Cov_latlat, PosCovGeodetic::Cov_latlon, PosCovGeodetic::Cov_lonhgt, PosCovGeodetic::Cov_lonlon, PVTGeodetic::Height, last_poscovgeodetic_, last_pvtgeodetic_, PVTGeodetic::Latitude, PVTGeodetic::Longitude, PVTGeodetic::Mode, and PVTGeodetic::SignalInfo.
Referenced by Read().
const uint8_t * io_comm_mosaic::mosaicMessage::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 872 of file mosaicMessage.cpp.
References BlockLength(), cd_count, count_, CRCcheck_, data_, Found(), found_, IsConnectionDescriptor(), IsNMEA(), IsResponse(), IsSBF(), and read_cd.
Referenced by GetCount(), and Search().
const uint8_t * io_comm_mosaic::mosaicMessage::Pos | ( | ) |
Gets the current position in the read buffer.
Definition at line 843 of file mosaicMessage.cpp.
References data_.
Referenced by GetCount(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
|
private |
Callback function when reading PosCovCartesian blocks.
[in] | data | The (packed and aligned) struct instance that we use to populate our ROS message rosaic::PosCovCartesian |
Definition at line 129 of file mosaicMessage.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::SYNC1, BlockHeader_t::SYNC2, PosCovCartesian::TOW, and PosCovCartesian::WNc.
Referenced by Read().
|
private |
Callback function when reading PosCovGeodetic blocks.
[in] | data | The (packed and aligned) struct instance that we use to populate our ROS message rosaic::PosCovGeodetic |
Definition at line 155 of file mosaicMessage.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::SYNC1, BlockHeader_t::SYNC2, 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 229 of file mosaicMessage.cpp.
References 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, AttEuler::Roll, and parsing_utilities::ToQuaternion().
Referenced by Read().
|
private |
Callback function when reading PVTCartesian blocks.
[in] | data | The (packed and aligned) struct instance that we use to populate our ROS message rosaic::PVTCartesian |
Definition at line 90 of file mosaicMessage.cpp.
References PVTCartesian::AlertFlag, PVTCartesian::Block_Header, PVTCartesian::COG, BlockHeader_t::CRC, PVTCartesian::Datum, PVTCartesian::Error, PVTCartesian::HAccuracy, BlockHeader_t::ID, PVTCartesian::Latency, BlockHeader_t::Length, PVTCartesian::MeanCorrAge, PVTCartesian::Misc, PVTCartesian::Mode, PVTCartesian::NrBases, PVTCartesian::NrSV, PVTCartesian::PPPInfo, PVTCartesian::ReferenceID, PVTCartesian::RxClkBias, PVTCartesian::RxClkDrift, PVTCartesian::SignalInfo, BlockHeader_t::SYNC1, BlockHeader_t::SYNC2, PVTCartesian::TimeSystem, PVTCartesian::TOW, PVTCartesian::Undulation, PVTCartesian::VAccuracy, PVTCartesian::Vx, PVTCartesian::Vy, PVTCartesian::Vz, PVTCartesian::WACorrInfo, 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 that we use to populate our ROS message rosaic::PVTGeodetic |
Definition at line 50 of file mosaicMessage.cpp.
References PVTGeodetic::AlertFlag, PVTGeodetic::Block_Header, PVTGeodetic::COG, BlockHeader_t::CRC, PVTGeodetic::Datum, PVTGeodetic::Error, PVTGeodetic::HAccuracy, PVTGeodetic::Height, BlockHeader_t::ID, PVTGeodetic::Latency, PVTGeodetic::Latitude, BlockHeader_t::Length, PVTGeodetic::Longitude, PVTGeodetic::MeanCorrAge, PVTGeodetic::Misc, PVTGeodetic::Mode, PVTGeodetic::NrBases, PVTGeodetic::NrSV, PVTGeodetic::PPPInfo, PVTGeodetic::ReferenceID, PVTGeodetic::RxClkBias, PVTGeodetic::RxClkDrift, PVTGeodetic::SignalInfo, BlockHeader_t::SYNC1, BlockHeader_t::SYNC2, PVTGeodetic::TimeSystem, PVTGeodetic::TOW, PVTGeodetic::Undulation, PVTGeodetic::VAccuracy, PVTGeodetic::Ve, PVTGeodetic::Vn, PVTGeodetic::Vu, PVTGeodetic::WACorrInfo, and PVTGeodetic::WNc.
Referenced by Read().
bool io_comm_mosaic::mosaicMessage::Read | ( | typename boost::call_traits< T >::reference | message, |
std::string | message_key, | ||
bool | search = false |
||
) |
Performs the CRC check (if SBF block) and populates message with the necessary content (mapped 1-to-1 if SBF, parsed if NMEA), works for pure ROS message mapping.
Note that boost::call_traits<T>::reference is more robust than traditional T&. Note that this function also assigns 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. Finally 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 mosaic by default increases precision on lat/lon s.t. the maximum allowed e.g. for GGA seems to be 89. Luckily, when parsing we do not care since we just search for <LF><CR>.
Definition at line 432 of file mosaicMessage.hpp.
References AttCovEulerCallback(), AttEulerCallback(), BlockLength(), count_, count_gpsfix_, CRCcheck_, CRCIsValid(), data_, evAttCovEuler, evAttEuler, evChannelStatus, evDOP, evGAGSV, evGLGSV, evGPGGA, evGPGSA, evGPGSV, evGPRMC, evGPSFix, evGPST, evMeasEpoch, evNavSatFix, evPosCovCartesian, evPosCovGeodetic, evPoseWithCovarianceStamped, evPVTCartesian, evPVTGeodetic, evVelCovGeodetic, Found(), frame_id, GPSFixCallback(), IsSBF(), last_attcoveuler_, last_atteuler_, last_channelstatus_, last_dop_, last_measepoch_, last_poscovgeodetic_, last_pvtgeodetic_, last_velcovgeodetic_, MessageID(), NavSatFixCallback(), GpggaParser::ParseASCII(), GpgsvParser::ParseASCII(), GprmcParser::ParseASCII(), GpgsaParser::ParseASCII(), PosCovCartesianCallback(), PosCovGeodeticCallback(), PoseWithCovarianceStampedCallback(), PVTCartesianCallback(), PVTGeodeticCallback(), Search(), SegmentEnd(), io_comm_mosaic::TimestampSBF(), PVTGeodetic::TOW, and use_GNSS_time.
Referenced by GetCount(), and io_comm_mosaic::CallbackHandler< T >::Handle().
const uint8_t * io_comm_mosaic::mosaicMessage::Search | ( | ) |
Searches the buffer for the beginning of the next message (NMEA or SBF)
Definition at line 666 of file mosaicMessage.cpp.
References count_, data_, found_, IsConnectionDescriptor(), IsNMEA(), IsResponse(), IsSBF(), Next(), and read_cd.
Referenced by GetCount(), Read(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
std::size_t io_comm_mosaic::mosaicMessage::SegmentEnd | ( | ) |
Determines size of message that data_ is currently pointing at.
Definition at line 684 of file mosaicMessage.cpp.
References CARRIAGE_RETURN, count_, data_, IsResponse(), LINE_FEED, and segment_size_.
Referenced by IsMessage(), MessageID(), mosaicMessage(), Read(), and io_comm_mosaic::CallbackHandlers::ReadCallback().
|
private |
The number of bytes in the buffer, decremented as the buffer is read (so it is the buffer's size in the beginning)
Definition at line 301 of file mosaicMessage.hpp.
Referenced by End(), GetCount(), Next(), Read(), Search(), and SegmentEnd().
|
staticprivate |
Number of times the gps_common::GPSFix message has been published.
Number of times the "read" method of the mosaicMessage class has been called.
Definition at line 316 of file mosaicMessage.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 306 of file mosaicMessage.hpp.
Referenced by mosaicMessage(), Next(), and Read().
|
private |
The pointer to the buffer of messages.
Definition at line 296 of file mosaicMessage.hpp.
Referenced by BlockLength(), End(), IsConnectionDescriptor(), IsErrorMessage(), IsMessage(), IsNMEA(), IsResponse(), IsSBF(), MessageID(), Next(), Pos(), Read(), Search(), and SegmentEnd().
bool io_comm_mosaic::mosaicMessage::found_ |
Whether or not a message has been found.
Definition at line 289 of file mosaicMessage.hpp.
Referenced by Found(), mosaicMessage(), Next(), and Search().
|
staticprivate |
Since GPSFix etc. need AttCovEuler, incoming AttCovEuler blocks need to be stored.
Definition at line 336 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), PoseWithCovarianceStampedCallback(), and Read().
Since GPSFix etc. need AttEuler, incoming AttEuler blocks need to be stored.
Definition at line 331 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), PoseWithCovarianceStampedCallback(), and Read().
|
staticprivate |
Since GPSFix etc. need ChannelStatus, incoming ChannelStatus blocks need to be stored.
Definition at line 341 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), and Read().
Since GPSFix etc. need DOP, incoming DOP blocks need to be stored.
Definition at line 351 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), and Read().
Since GPSFix etc. need MeasEpoch (for signal-to-noise ratios), incoming MeasEpoch blocks need to be stored.
Definition at line 346 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), and Read().
|
staticprivate |
Since NavSatFix etc. need PosCovGeodetic, incoming PosCovGeodetic blocks need to be stored.
Definition at line 326 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), NavSatFixCallback(), PoseWithCovarianceStampedCallback(), and Read().
|
staticprivate |
Since NavSatFix etc. need PVTGeodetic, incoming PVTGeodetic blocks need to be stored.
Definition at line 321 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), NavSatFixCallback(), PoseWithCovarianceStampedCallback(), and Read().
|
staticprivate |
Since GPSFix etc. need VelCovGeodetic (for signal-to-noise ratios), incoming VelCovGeodetic blocks need to be stored.
Definition at line 356 of file mosaicMessage.hpp.
Referenced by GPSFixCallback(), and Read().
|
private |
Helps to determine size of response message / NMEA message / SBF block.
Definition at line 311 of file mosaicMessage.hpp.
Referenced by mosaicMessage(), and SegmentEnd().