15 #include <boost/make_shared.hpp> 29 novatel_gps_msgs::NovatelPsrdop2Ptr
35 std::stringstream error;
36 error <<
"Unexpected PSRDOP2 message size: " << bin_msg.
data_.size();
40 auto ros_msg = boost::make_shared<novatel_gps_msgs::NovatelPsrdop2>();
43 ros_msg->novatel_msg_header = header_parser.ParseBinary(bin_msg);
54 ros_msg->systems.reserve(num_systems);
55 for (uint32_t i = 0; i < num_systems; i++)
58 novatel_gps_msgs::NovatelPsrdop2System system;
63 ros_msg->systems.push_back(system);
69 novatel_gps_msgs::NovatelPsrdop2Ptr
74 std::stringstream error;
75 error <<
"Unexpected number of body fields in PSRDOP2 log: " << sentence.
body.size();
79 uint32_t num_systems = 0;
84 std::stringstream error;
85 error <<
"Size of PSRDOP2 log (" << sentence.
body.size() <<
") did not match expected size (" 91 auto msg = boost::make_shared<novatel_gps_msgs::NovatelPsrdop2>();
93 msg->novatel_msg_header = h_parser.ParseAscii(sentence);
99 msg->systems.reserve(num_systems);
100 for (
size_t i = 0; i < num_systems; i++)
102 novatel_gps_msgs::NovatelPsrdop2System system;
104 system.system = sentence.
body[offset];
106 msg->systems.push_back(system);
111 std::stringstream error;
112 error <<
"Error parsing PSRDOP2 log.";
static constexpr size_t ASCII_BODY_FIELDS
static constexpr size_t BINARY_BODY_LENGTH
static constexpr size_t ASCII_SYSTEM_FIELDS
static constexpr size_t BINARY_SYSTEM_LENGTH
novatel_gps_msgs::NovatelPsrdop2Ptr ParseAscii(const NovatelSentence &sentence) override
Converts sentence into a ROS message pointer and returns it.
std::string GetSystemName(uint32_t system_id)
uint32_t GetMessageId() const override
uint32_t ParseUInt32(const uint8_t *buffer)
Converts a buffer containing 4 bytes into an unsigned 32-bit int.
const std::string GetMessageName() const override
float ParseFloat(const uint8_t *buffer)
Converts a buffer containing 4 bytes into a float.
std::vector< std::string > body
static const std::string MESSAGE_NAME
novatel_gps_msgs::NovatelPsrdop2Ptr ParseBinary(const BinaryMessage &bin_msg) override
Converts bin_msg into a ROS message pointer and returns it.
static constexpr uint16_t MESSAGE_ID
std::vector< uint8_t > data_