1 #ifndef ADVANCED_NAVIGATION_ANPP_HEADER_HPP 2 #define ADVANCED_NAVIGATION_ANPP_HEADER_HPP 10 #include <type_traits> 11 #include <base/Timeout.hpp> 12 #include <iodrivers_base/Exceptions.hpp> 14 #include <imu_advanced_navigation_anpp/Constants.hpp> 15 #include <imu_advanced_navigation_anpp/DeviceInformation.hpp> 16 #include <imu_advanced_navigation_anpp/Exceptions.hpp> 34 template<
typename T,
typename InputIterator>
37 static_assert(
sizeof(T) == 2,
"return type is not a 2-byte data type");
39 uint16_t b1 = *(++it);
40 uint16_t r = b0 | b1 << 8;
41 return reinterpret_cast<T const&
>(r);
45 template<
typename T,
typename InputIterator>
48 static_assert(
sizeof(T) == 4,
"return type is not a 4-byte data type");
50 uint32_t b1 = *(++it);
51 uint32_t b2 = *(++it);
52 uint32_t b3 = *(++it);
53 uint32_t r = b0 | b1 << 8 | b2 << 16 | b3 << 24;
54 return reinterpret_cast<T const&
>(r);
58 template<
typename T,
typename InputIterator>
61 static_assert(
sizeof(T) == 8,
"return type is not a 8-byte data type");
63 uint64_t b1 = *(++it);
64 uint64_t b2 = *(++it);
65 uint64_t b3 = *(++it);
66 uint64_t b4 = *(++it);
67 uint64_t b5 = *(++it);
68 uint64_t b6 = *(++it);
69 uint64_t b7 = *(++it);
70 uint64_t r = b0 | b1 << 8 | b2 << 16 | b3 << 24 | b4 << 32 | b5 << 40 | b6 << 48 | b7 << 56;
71 return reinterpret_cast<T const&
>(r);
75 template<
typename T,
typename Out>
78 static_assert(
sizeof(T) == 2,
"sample is not a 2-byte data type");
79 uint16_t value =
reinterpret_cast<uint16_t&
>(sample);
80 out[0] = value & 0xFF;
81 out[1] = (value >> 8) & 0xFF;
85 template<
typename T,
typename Out>
88 static_assert(
sizeof(T) == 4,
"sample is not a 4-byte data type");
89 uint32_t value =
reinterpret_cast<uint32_t&
>(sample);
90 out[0] = (value >> 0) & 0xFF;
91 out[1] = (value >> 8) & 0xFF;
92 out[2] = (value >> 16) & 0xFF;
93 out[3] = (value >> 24) & 0xFF;
97 template<
typename T,
typename Out>
100 static_assert(
sizeof(T) == 8,
"sample is not a 8-byte data type");
101 uint64_t value =
reinterpret_cast<uint64_t&
>(sample);
102 out[1] = (value >> 8) & 0xFF;
103 out[2] = (value >> 16) & 0xFF;
104 out[3] = (value >> 24) & 0xFF;
105 out[4] = (value >> 32) & 0xFF;
106 out[5] = (value >> 40) & 0xFF;
107 out[6] = (value >> 48) & 0xFF;
108 out[7] = (value >> 56) & 0xFF;
111 static constexpr
int PACKET_ID_COUNT = 256;
148 Header(uint8_t packet_id, uint8_t
const* begin, uint8_t
const* end);
159 bool isPacketValid(uint8_t
const* begin, uint8_t
const* end)
const;
168 static constexpr
int MAX_PACKET_SIZE = 256 +
sizeof(
Header);
172 uint16_t
crc(uint8_t
const* begin, uint8_t
const* end);
177 static constexpr uint8_t ID = 0;
216 template<
typename RandomInputIterator>
220 throw std::length_error(
"Acknowledge::unmarshal buffer size not the expected size");
221 return Acknowledge{ begin[0], begin[1], begin[2], begin[3] };
232 static constexpr uint8_t ID = 1;
233 static constexpr
int MIN_SIZE = 0;
235 template<
typename OutputIterator,
typename InputIterator>
236 OutputIterator
marshal(OutputIterator out, InputIterator begin, InputIterator end)
const 238 return std::copy(begin, end, out);
241 template<
typename OutputIterator>
244 return std::copy(&packet_id, &packet_id + 1, out);
258 static constexpr uint8_t ID = 2;
263 template<
typename OutputIterator>
264 OutputIterator
marshal(OutputIterator out)
const 270 template<
typename RandomInputIterator>
273 if (end - begin !=
sizeof(
BootMode))
274 throw std::length_error(
"BootMode::unmarshal: buffer size is not expected size");
282 static constexpr uint8_t ID = 3;
283 static constexpr
int SIZE = 24;
285 template<
typename RandomInputIterator>
289 throw std::length_error(
"DeviceInformation::unmarshal: buffer size is not expected size");
293 info.
device_id = read32<uint32_t>(begin + 4);
304 static constexpr uint8_t ID = 4;
309 template<
typename OutputIterator>
310 OutputIterator
marshal(OutputIterator out)
const 312 std::copy(verification_sequence, verification_sequence + 4, out);
319 static constexpr uint8_t ID = 5;
324 template<
typename OutputIterator>
325 OutputIterator
marshal(OutputIterator out)
const 327 std::copy(verification_sequence, verification_sequence + 4, out);
334 static constexpr uint8_t ID = 5;
339 template<
typename OutputIterator>
340 OutputIterator
marshal(OutputIterator out)
const 342 std::copy(verification_sequence, verification_sequence + 4, out);
349 static constexpr uint8_t ID = 20;
350 static constexpr
int SIZE = 100;
366 template<
typename InputIterator>
370 throw std::length_error(
"SystemState::unmarshal buffer size not the expected size");
378 state.
g = read32<float>(begin + 60);
380 for (
int i = 0; i < 3; ++i)
382 state.
lat_lon_z[i] = read64<double>(begin + 12 + 8 * i);
383 state.
velocity_ned[i] = read32<float>(begin + 36 + 4 * i);
385 state.
rpy[i] = read32<float>(begin + 64 + 4 * i);
395 static constexpr uint8_t ID = 21;
401 template<
typename InputIterator>
404 if (end - begin !=
sizeof(
UnixTime))
405 throw std::length_error(
"SystemState::unmarshal buffer size not the expected size");
406 return UnixTime{read32<uint32_t>(begin), read32<uint32_t>(begin + 4)};
412 static constexpr uint8_t ID = 23;
420 template<
typename InputIterator>
423 if (end - begin !=
sizeof(
Status))
424 throw std::length_error(
"SystemState::unmarshal buffer size not the expected size");
425 return Status{read16<uint16_t>(begin), read16<uint16_t>(begin + 2)};
431 static constexpr uint8_t ID = 24;
432 static constexpr
int SIZE = 12;
436 template<
typename InputIterator>
440 throw std::length_error(
"SystemState::unmarshal buffer size not the expected size");
442 read32<float>(begin + 0),
443 read32<float>(begin + 4),
444 read32<float>(begin + 8)
451 static constexpr uint8_t ID = 25;
452 static constexpr
int SIZE = 12;
456 template<
typename InputIterator>
460 throw std::length_error(
"NEDVelocityStandardDeviation::unmarshal buffer size not the expected size");
462 read32<float>(begin + 0),
463 read32<float>(begin + 4),
464 read32<float>(begin + 8)
471 static constexpr uint8_t ID = 26;
472 static constexpr
int SIZE = 12;
476 template<
typename InputIterator>
480 throw std::length_error(
"EulerOrientationStandardDeviation::unmarshal buffer size not the expected size");
482 read32<float>(begin + 0),
483 read32<float>(begin + 4),
484 read32<float>(begin + 8)
491 static constexpr uint8_t ID = 28;
492 static constexpr
int SIZE = 48;
501 template<
typename InputIterator>
505 throw std::length_error(
"RawSensors::unmarshal buffer size not the expected size");
508 for (
int i = 0; i < 3; ++i)
516 out.
pressure = read32<float>(begin + 40);
524 static constexpr uint8_t ID = 29;
525 static constexpr
int SIZE = 74;
539 template<
typename InputIterator>
542 if (end - begin != SIZE)
543 throw std::length_error(
"RawGNSS::unmarshal buffer size not the expected size");
548 for (
int i = 0; i < 3; ++i)
550 out.
lat_lon_z[i] = read64<double>(begin + 8 + 8 * i);
551 out.
velocity_ned[i] = read32<float>(begin + 32 + 4 * i);
555 out.
pitch = read32<float>(begin + 56);
556 out.
yaw = read32<float>(begin + 60);
559 out.
status = read16<uint16_t>(begin + 72);
586 static constexpr uint8_t ID = 30;
587 static constexpr
int SIZE = 13;
597 template<
typename InputIterator>
600 if (end - begin != SIZE)
601 throw std::length_error(
"Satellites::unmarshal buffer size not the expected size");
604 read32<float>(begin + 0),
605 read32<float>(begin + 4),
662 template<
typename InputIterator>
666 begin[0], begin[1], begin[2], begin[3],
667 read16<uint16_t>(begin + 4), begin[6]
674 static constexpr uint8_t ID = 31;
675 static constexpr
int MIN_SIZE = 0;
677 template<
typename InputIterator>
678 static void unmarshal(InputIterator begin, InputIterator end, std::vector<SatelliteInfo>& info)
681 throw std::length_error(
"Satellites::unmarshal buffer is not a multiple of the SatelliteInfo size");
692 static constexpr uint8_t ID = 32;
693 static constexpr
int SIZE = 24;
697 template<
typename InputIterator>
701 throw std::length_error(
"GeodeticPosition::unmarshal unexpected buffer size");
704 for (
int i = 0; i < 3; ++i)
705 out.
lat_lon_z[i] = read64<double>(begin + 8 * i);
712 static constexpr uint8_t ID = 35;
713 static constexpr
int SIZE = 12;
717 template<
typename InputIterator>
720 if ((end - begin) != SIZE)
721 throw std::length_error(
"NEDVelocity::unmarshal buffer is not of the expected size");
724 read32<float>(begin),
725 read32<float>(begin + 4),
726 read32<float>(begin + 8) } };
732 static constexpr uint8_t ID = 36;
733 static constexpr
int SIZE = 12;
737 template<
typename InputIterator>
740 if ((end - begin) != SIZE)
741 throw std::length_error(
"BodyVelocity::unmarshal buffer is not of the expected size");
744 read32<float>(begin),
745 read32<float>(begin + 4),
746 read32<float>(begin + 8) } };
753 static constexpr uint8_t ID = 37;
754 static constexpr
int SIZE = 12;
758 template<
typename InputIterator>
761 if ((end - begin) != SIZE)
762 throw std::length_error(
"Acceleration::unmarshal buffer is not of the expected size");
765 read32<float>(begin),
766 read32<float>(begin + 4),
767 read32<float>(begin + 8) } };
773 static constexpr uint8_t ID = 38;
774 static constexpr
int SIZE = 16;
779 template<
typename InputIterator>
782 if ((end - begin) != SIZE)
783 throw std::length_error(
"BodyAcceleration::unmarshal buffer is not of the expected size");
787 read32<float>(begin),
788 read32<float>(begin + 4),
789 read32<float>(begin + 8)
791 read32<float>(begin + 12)
798 static constexpr uint8_t ID = 40;
799 static constexpr
int SIZE = 16;
804 template<
typename InputIterator>
807 if ((end - begin) != SIZE)
808 throw std::length_error(
"QuaternionOrientation::unmarshal buffer is not of the expected size");
811 read32<float>(begin + 0),
813 read32<float>(begin + 4),
814 read32<float>(begin + 8),
815 read32<float>(begin + 12)
823 static constexpr uint8_t ID = 42;
824 static constexpr
int SIZE = 12;
828 template<
typename InputIterator>
831 if ((end - begin) != SIZE)
832 throw std::length_error(
"AngularVelocity::unmarshal buffer is not of the expected size");
835 read32<float>(begin),
836 read32<float>(begin + 4),
837 read32<float>(begin + 8) } };
843 static constexpr uint8_t ID = 43;
844 static constexpr
int SIZE = 12;
848 template<
typename InputIterator>
851 if ((end - begin) != SIZE)
852 throw std::length_error(
"AngularAcceleration::unmarshal buffer is not of the expected size");
855 read32<float>(begin),
856 read32<float>(begin + 4),
857 read32<float>(begin + 8) } };
863 static constexpr uint8_t ID = 50;
864 static constexpr
int SIZE = 12;
868 template<
typename InputIterator>
871 if ((end - begin) != SIZE)
872 throw std::length_error(
"LocalMagneticField::unmarshal buffer is not of the expected size");
875 read32<float>(begin),
876 read32<float>(begin + 4),
877 read32<float>(begin + 8) } };
883 static constexpr uint8_t ID = 71;
884 static constexpr
int SIZE = 28;
894 template<
typename InputIterator>
897 if (end - begin != SIZE)
898 throw std::length_error(
"MagneticCalibrationStatus::unmarshal buffer size not the expected size");
901 out.
flags = read16<uint16_t>(begin);
902 std::copy_n(begin + 4, 4, out.
progress);
904 for (
int i = 0; i < 3; ++i)
913 static constexpr uint8_t ID = 180;
920 template<
typename OutputIterator>
921 OutputIterator
marshal(OutputIterator out)
const 929 template<
typename InputIterator>
932 if (end - begin != SIZE)
933 throw std::length_error(
"PacketTimerPeriod::unmarshal buffer size not the expected size");
938 out.
period = read16<uint16_t>(begin + 2);
945 static constexpr uint8_t ID = 181;
946 static constexpr
int MIN_SIZE = 2;
947 static constexpr
int PERIOD_SIZE = 5;
954 template<
typename OutputIterator>
955 OutputIterator
marshal(OutputIterator out)
const 959 return out + MIN_SIZE;
962 template<
typename OutputIterator>
967 std::pair<uint8_t, uint32_t> pair(packet_id, period);
968 return marshal(out, &pair, &pair + 1);
971 template<
typename OutputIterator,
typename InputIterator>
972 OutputIterator
marshal(OutputIterator out, InputIterator begin, InputIterator end)
const 976 for (out += 2; begin != end; ++begin, out += PERIOD_SIZE)
978 out[0] = begin->first;
979 write32(out + 1, begin->second);
984 template<
typename InputIterator>
985 static std::map<uint8_t, uint32_t>
unmarshal(InputIterator begin, InputIterator end)
987 if ((end - begin) < MIN_SIZE)
988 throw std::length_error(
"PacketPeriods::unmarshal buffer too small");
989 else if ((end - begin - MIN_SIZE) % PERIOD_SIZE != 0)
990 throw std::length_error(
"PacketPeriods::unmarshal expected period list to be a multiple of 5");
992 std::map<uint8_t, uint32_t>
result;
993 for (; begin != end; begin += PERIOD_SIZE)
994 result[*begin] = read32<uint32_t>(begin + 1);
1001 static constexpr uint8_t ID = 182;
1010 template<
typename OutputIterator>
1014 write32(out + 1, primary_port);
1016 write32(out + 9, auxiliary_rs232);
1017 write32(out + 13, static_cast<uint32_t>(0));
1021 template<
typename InputIterator>
1024 if (end - begin != SIZE)
1025 throw std::length_error(
"BaudRates::unmarshal buffer size not the expected size");
1029 read32<uint32_t>(begin + 1),
1030 read32<uint32_t>(begin + 5),
1031 read32<uint32_t>(begin + 9),
1032 static_cast<uint32_t>(0)
1039 static constexpr uint8_t ID = 185;
1048 template<
typename OutputIterator>
1052 for (
int i = 0; i < 9; ++i)
1053 write32(out + 1 + 4 * i, dcm[i]);
1054 for (
int i = 0; i < 3; ++i)
1056 write32(out + 37 + 4 * i, gnss_antenna_offset_xyz[i]);
1057 write32(out + 49 + 4 * i, odometer_offset_xyz[i]);
1058 write32(out + 61 + 4 * i, external_data_offset_xyz[i]);
1063 template<
typename InputIterator>
1066 if (end - begin != SIZE)
1067 throw std::length_error(
"Alignment::unmarshal buffer size not the expected size");
1071 for (
int i = 0; i < 9; ++i)
1072 out.
dcm[i] = read32<float>(begin + 1 + 4 * i);
1073 for (
int i = 0; i < 3; ++i)
1085 static constexpr uint8_t ID = 186;
1102 template<
typename OutputIterator>
1105 return std::copy(&permanent, reserved_1 + 9, out);
1108 template<
typename InputIterator>
1111 if (end - begin != SIZE)
1112 throw std::length_error(
"FilterOptions::unmarshal buffer size not the expected size");
1123 static constexpr uint8_t ID = 189;
1130 template<
typename OutputIterator>
1134 for (
int i = 0; i < 3; ++i)
1135 write32(out + 1 + 4 * i, hard_iron_bias_xyz[i]);
1136 for (
int i = 0; i < 9; ++i)
1137 write32(out + 13 + 4 * i, soft_iron_transformation[i]);
1141 template<
typename InputIterator>
1144 if (end - begin != SIZE)
1145 throw std::length_error(
"MagneticCalibrationValues::unmarshal buffer size not the expected size");
1149 for (
int i = 0; i < 3; ++i)
1151 for (
int i = 0; i < 9; ++i)
1159 static constexpr uint8_t ID = 190;
1165 template<
typename OutputIterator>
1183 static constexpr uint8_t ID = 191;
1191 template<
typename InputIterator>
1194 if (end - begin != SIZE)
1195 throw std::length_error(
"MagneticCalibrationStatus::unmarshal buffer size not the expected size");
1198 std::copy(begin, end, &out.
status);
1203 template<
typename Packet,
typename Driver>
1206 static_assert(Packet::SIZE +
Header::SIZE < 300,
"packet and header size are bigger than the expected buffer size");
1207 uint8_t marshalled[300];
1208 uint8_t* marshalled_end = packet.marshal(marshalled +
Header::SIZE);
1211 driver.writePacket(marshalled, marshalled_end - marshalled);
1215 template<
typename Packet,
typename Driver>
1218 uint8_t marshalled[MAX_PACKET_SIZE * 10];
1221 base::Timeout timeout(_timeout);
1224 base::Time left = timeout.timeLeft();
1225 if (left.toMicroseconds() < 0)
1226 left = base::Time();
1227 int packet_size = driver.readPacket(marshalled,
sizeof(marshalled), left);
1229 Header const& header =
reinterpret_cast<Header const&
>(*marshalled);
1231 return Packet::unmarshal(marshalled +
Header::SIZE, marshalled + packet_size);
1233 while (!timeout.elapsed());
1234 throw iodrivers_base::TimeoutError(
1235 iodrivers_base::TimeoutError::NONE,
1236 "failed to get an expected response from the device");
1239 template<
typename Driver>
1242 base::Timeout timeout(_timeout);
1245 base::Time left = timeout.timeLeft();
1246 if (left.toMicroseconds() < 0)
1247 left = base::Time();
1248 Acknowledge ack = waitForPacket<Acknowledge>(driver, left);
1250 if (ack.isMatching(header))
1251 return static_cast<ACK_RESULTS>(ack.result);
1253 while (!timeout.elapsed());
1254 throw iodrivers_base::TimeoutError(
1255 iodrivers_base::TimeoutError::NONE,
1256 "failed to get an ack matching the given packet header");
1259 template<
typename Driver>
1267 template<
typename Packet,
typename Driver>
1270 uint8_t marshalled[MAX_PACKET_SIZE];
1273 driver.writePacket(marshalled, marshalled_end - marshalled);
1275 return waitForPacket<Packet>(driver, driver.getReadTimeout());
1278 template<
typename Driver>
1281 uint8_t marshalled[MAX_PACKET_SIZE];
1288 driver.writePacket(marshalled, marshalled_end - marshalled);
static BodyAcceleration unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:780
Definition: Protocol.hpp:999
float angular_velocity[3]
Definition: Protocol.hpp:187
float im
Definition: Protocol.hpp:801
Definition: Protocol.hpp:1037
Definition: Protocol.hpp:631
static void unmarshal(InputIterator begin, InputIterator end, std::vector< SatelliteInfo > &info)
Definition: Protocol.hpp:678
Definition: Exceptions.hpp:11
uint32_t auxiliary_rs232
Definition: Protocol.hpp:1007
Definition: Protocol.hpp:1175
uint8_t verification_sequence[4]
Definition: Protocol.hpp:176
float gyroscopes_xyz[3]
Definition: Protocol.hpp:495
uint16_t reserved
Definition: Protocol.hpp:178
Definition: Protocol.hpp:1157
static BaudRates unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:1022
float odometer_offset_xyz[3]
Definition: Protocol.hpp:179
float gyroscope_bias_solution_error
Definition: Protocol.hpp:892
static UnixTime unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:402
uint16_t filter_status
Definition: Protocol.hpp:418
static PacketTimerPeriod unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:930
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:264
float pitch
Definition: Protocol.hpp:532
float yaw
Definition: Protocol.hpp:533
Definition: Protocol.hpp:642
uint8_t permanent
Definition: Protocol.hpp:916
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:1049
SATELLITE_FREQUENCIES
Definition: Protocol.hpp:629
float hard_iron_bias_xyz[3]
Definition: Protocol.hpp:177
uint8_t permanent
Definition: Protocol.hpp:176
static constexpr uint8_t ID
Definition: Protocol.hpp:232
float g
Definition: Protocol.hpp:361
Definition: Protocol.hpp:635
float dcm[9]
Definition: Protocol.hpp:1043
T read64(InputIterator it)
Definition: Protocol.hpp:59
uint16_t system_status
Definition: Protocol.hpp:416
uint8_t boot_mode
Definition: Protocol.hpp:176
Definition: Protocol.hpp:302
static SystemState unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:367
Definition: Protocol.hpp:638
Definition: Protocol.hpp:911
Definition: Protocol.hpp:567
Definition: Protocol.hpp:690
static Status unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:421
uint8_t enabled_velocity_heading
Definition: Protocol.hpp:1097
float pitch_stddev
Definition: Protocol.hpp:534
double lat_lon_z[3]
Definition: Protocol.hpp:182
Definition: Protocol.hpp:568
Definition: Driver.hpp:49
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:1166
uint8_t sbas_satellite_count
Definition: Protocol.hpp:595
uint8_t frequencies
Definition: Protocol.hpp:654
Definition: Protocol.hpp:584
static MagneticCalibrationValues unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:1142
Definition: Protocol.hpp:347
Definition: Protocol.hpp:230
Definition: Protocol.hpp:574
static RawSensors unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:502
Definition: Protocol.hpp:256
uint8_t permanent
Definition: Protocol.hpp:1004
float velocity_ned[3]
Definition: Protocol.hpp:530
uint8_t result
Definition: Protocol.hpp:179
Definition: Protocol.hpp:581
static GeodeticPosition unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:698
Definition: Protocol.hpp:580
Definition: Protocol.hpp:622
uint16_t system_status
Definition: Protocol.hpp:353
uint32_t unix_time_microseconds
Definition: Protocol.hpp:528
Definition: Protocol.hpp:566
uint8_t permanent
Definition: Protocol.hpp:1126
uint8_t progress[4]
Definition: Protocol.hpp:889
double lat_lon_z[3]
Definition: Protocol.hpp:358
float hdop
Definition: Protocol.hpp:589
Definition: Protocol.hpp:710
float velocity_ned[3]
Definition: Protocol.hpp:183
uint8_t status
Definition: Protocol.hpp:1187
Definition: Protocol.hpp:617
uint8_t snr
Definition: Protocol.hpp:660
float odometer_offset_xyz[3]
Definition: Protocol.hpp:1045
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:1011
uint8_t beidou_satellite_count
Definition: Protocol.hpp:593
float lat_lon_z_stddev[3]
Definition: Protocol.hpp:531
std::map< uint8_t, uint32_t > Periods
Definition: Protocol.hpp:949
static BootMode unmarshal(RandomInputIterator begin, RandomInputIterator end)
Definition: Protocol.hpp:271
Definition: Protocol.hpp:1176
uint8_t system
Definition: Protocol.hpp:647
Definition: Protocol.hpp:522
float lat_lon_z_stddev[3]
Definition: Protocol.hpp:364
bool isProtocolError() const
Definition: Protocol.hpp:621
static Satellites unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:598
void write64(Out out, T sample)
Definition: Protocol.hpp:98
float accelerometers_xyz[3]
Definition: Protocol.hpp:494
Definition: Protocol.hpp:410
static AngularVelocity unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:829
Definition: Protocol.hpp:636
RAW_GNSS_STATUS
Definition: Protocol.hpp:564
float velocity_ned[3]
Definition: Protocol.hpp:359
uint32_t microseconds
Definition: Protocol.hpp:399
uint8_t enabled_atmospheric_altitude
Definition: Protocol.hpp:1096
uint8_t utc_synchronization
Definition: Protocol.hpp:917
uint8_t acked_payload_checksum_lsb
Definition: Protocol.hpp:177
static Acknowledge unmarshal(RandomInputIterator begin, RandomInputIterator end)
Definition: Protocol.hpp:217
uint8_t acked_packet_id
Definition: Protocol.hpp:176
uint8_t progress
Definition: Protocol.hpp:1188
uint16_t status
Definition: Protocol.hpp:537
float g
Definition: Protocol.hpp:777
Definition: Protocol.hpp:1177
Definition: Protocol.hpp:1178
MAGNETIC_CALIBRATION_ACTIONS
Definition: Protocol.hpp:1173
uint16_t crc(uint8_t const *begin, uint8_t const *end)
Definition: Protocol.cpp:63
float dcm[9]
Definition: Protocol.hpp:177
uint8_t clear_existing
Definition: Protocol.hpp:952
Definition: Protocol.hpp:634
bool isSystemError() const
Definition: Protocol.hpp:579
uint32_t reserved
Definition: Protocol.hpp:1008
uint8_t utc_synchronization
Definition: Protocol.hpp:177
Definition: Exceptions.hpp:20
void resetPollSynchronization()
Definition: Driver.cpp:634
Definition: Protocol.hpp:619
uint16_t period
Definition: Protocol.hpp:918
static constexpr int SIZE
Definition: Protocol.hpp:693
Definition: Protocol.hpp:572
Definition: Protocol.hpp:821
Packet query(Driver &driver)
Definition: Protocol.hpp:1268
float body_acceleration_xyz[3]
Definition: Protocol.hpp:360
float gnss_antenna_offset_xyz[3]
Definition: Protocol.hpp:1044
ACK_RESULTS
Definition: Exceptions.hpp:9
Definition: Protocol.hpp:637
uint8_t reserved_1[9]
Definition: Protocol.hpp:188
OutputIterator marshal(OutputIterator out, InputIterator begin, InputIterator end) const
Definition: Protocol.hpp:972
uint32_t gpio
Definition: Protocol.hpp:1006
static AngularAcceleration unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:849
uint16_t filter_status
Definition: Protocol.hpp:355
static BodyVelocity unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:738
uint8_t enabled_reversing_detection
Definition: Protocol.hpp:1098
static constexpr int SIZE
Definition: Protocol.hpp:644
static Alignment unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:1064
OutputIterator marshal(OutputIterator out, InputIterator begin, InputIterator end) const
Definition: Protocol.hpp:177
uint32_t primary_port
Definition: Protocol.hpp:1005
float soft_iron_transformation[9]
Definition: Protocol.hpp:178
float angular_velocity[3]
Definition: Protocol.hpp:363
Header writePacket(Driver &driver, Packet const &packet)
Definition: Protocol.hpp:1204
static NEDVelocity unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:718
uint8_t glonass_satellite_count
Definition: Protocol.hpp:592
float pressure_temperature_C
Definition: Protocol.hpp:499
float yaw_stddev
Definition: Protocol.hpp:535
static EulerOrientationStandardDeviation unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:477
Definition: Protocol.hpp:751
static MagneticCalibrationStatus unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:1192
uint8_t enabled_internal_gnss
Definition: Protocol.hpp:1094
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:310
uint8_t acked_payload_checksum_msb
Definition: Protocol.hpp:178
uint8_t enabled_motion_analysis
Definition: Protocol.hpp:1099
Definition: Protocol.hpp:251
uint8_t reserved_0
Definition: Protocol.hpp:183
float rpy[3]
Definition: Protocol.hpp:362
static GeodeticPositionStandardDeviation unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:437
static LocalMagneticField unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:869
Definition: Protocol.hpp:578
static NorthSeekingInitializationStatus unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:895
uint16_t period
Definition: Protocol.hpp:178
float vdop
Definition: Protocol.hpp:590
double lat_lon_z[3]
Definition: Protocol.hpp:529
uint8_t progress[4]
Definition: Protocol.hpp:179
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:340
float accelerometers_xyz[3]
Definition: Protocol.hpp:176
uint8_t permanent
Definition: Protocol.hpp:1042
float gyroscope_bias_solution_xyz[3]
Definition: Protocol.hpp:891
float hard_iron_bias_xyz[3]
Definition: Protocol.hpp:1127
uint32_t unix_time_microseconds
Definition: Protocol.hpp:357
float xyz[3]
Definition: Protocol.hpp:176
static constexpr uint8_t ID
Definition: Protocol.hpp:945
Definition: Protocol.hpp:841
Definition: Protocol.hpp:569
BOOT_MODES
Definition: Protocol.hpp:249
OutputIterator marshal(OutputIterator out, uint8_t packet_id) const
Definition: Protocol.hpp:242
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:325
Header writePacketPeriod(Driver &driver, uint8_t packet_id, int period, bool clear_existing)
Definition: Protocol.hpp:1279
uint8_t boot_mode
Definition: Protocol.hpp:261
Definition: Protocol.hpp:618
Definition: Protocol.hpp:332
void validateAck(Driver &driver, Header const &header, base::Time const &_timeout)
Definition: Protocol.hpp:1260
static std::map< uint8_t, uint32_t > unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:985
static FilterOptions unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:1109
float body_acceleration_xyz[3]
Definition: Protocol.hpp:184
float pressure
Definition: Protocol.hpp:498
ACK_RESULTS waitForAck(Driver &driver, Header const &header, base::Time const &_timeout)
Definition: Protocol.hpp:1240
Definition: Protocol.hpp:624
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:1131
uint16_t flags
Definition: Protocol.hpp:887
Definition: Protocol.hpp:317
bool isMatching(Header const &header) const
void write16(Out out, T sample)
Definition: Protocol.hpp:76
T read32(InputIterator it)
Definition: Protocol.hpp:46
enum imu_advanced_navigation_anpp::protocol::BOOT_MODES __attribute__
Definition: Protocol.hpp:633
uint8_t error
Definition: Protocol.hpp:1189
Definition: Protocol.hpp:1181
bool isPacketValidationFailure() const
Definition: Protocol.hpp:576
float imu_temperature_C
Definition: Protocol.hpp:497
uint32_t unix_time_seconds
Definition: Protocol.hpp:356
uint32_t seconds
Definition: Protocol.hpp:398
Definition: Protocol.hpp:796
Definition: Protocol.hpp:1121
uint8_t galileo_satellite_count
Definition: Protocol.hpp:594
float gyroscope_bias_solution_xyz[3]
Definition: Protocol.hpp:181
Definition: Protocol.hpp:771
static QuaternionOrientation unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:805
Definition: Protocol.hpp:570
static Acceleration unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:759
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:921
uint8_t prn
Definition: Protocol.hpp:649
Definition: Protocol.hpp:881
Definition: Protocol.hpp:620
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:1103
Definition: Protocol.hpp:1083
SATELLITE_SYSTEM
Definition: Protocol.hpp:615
uint8_t gps_satellite_count
Definition: Protocol.hpp:591
Definition: Protocol.hpp:252
uint8_t permanent
Definition: Protocol.hpp:1088
Definition: Protocol.hpp:429
Definition: Protocol.hpp:861
uint8_t permanent
Definition: Protocol.hpp:951
Definition: Protocol.hpp:577
uint8_t vehicle_type
Definition: Protocol.hpp:1093
double lat_lon_z[3]
Definition: Protocol.hpp:695
uint8_t action
Definition: Protocol.hpp:177
Definition: Protocol.hpp:393
float soft_iron_transformation[9]
Definition: Protocol.hpp:1128
Definition: Protocol.hpp:449
static NEDVelocityStandardDeviation unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:457
uint8_t clear_existing
Definition: Protocol.hpp:180
Definition: Protocol.hpp:571
float gnss_antenna_offset_xyz[3]
Definition: Protocol.hpp:178
static SatelliteInfo unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:663
OutputIterator marshal(OutputIterator out, uint8_t packet_id, uint32_t period) const
Definition: Protocol.hpp:963
Definition: Protocol.hpp:489
Definition: Protocol.hpp:943
Definition: Configuration.hpp:8
float external_data_offset_xyz[3]
Definition: Protocol.hpp:180
float gyroscopes_xyz[3]
Definition: Protocol.hpp:177
Definition: Protocol.hpp:175
Packet waitForPacket(Driver &driver, base::Time const &_timeout)
Definition: Protocol.hpp:1216
Definition: Protocol.hpp:573
OutputIterator marshal(OutputIterator out) const
Definition: Protocol.hpp:955
float lat_lon_z_stddev[3]
Definition: Protocol.hpp:188
Definition: Protocol.hpp:625
OutputIterator marshal(OutputIterator out, InputIterator begin, InputIterator end) const
Definition: Protocol.hpp:236
uint8_t action
Definition: Protocol.hpp:1163
float magnetometers_xyz[3]
Definition: Protocol.hpp:496
float external_data_offset_xyz[3]
Definition: Protocol.hpp:1046
uint32_t unix_time_seconds
Definition: Protocol.hpp:527
static RawGNSS unmarshal(InputIterator begin, InputIterator end)
Definition: Protocol.hpp:540
void write32(Out out, T sample)
Definition: Protocol.hpp:86
uint8_t elevation
Definition: Protocol.hpp:656
uint16_t azimuth
Definition: Protocol.hpp:658
Definition: Protocol.hpp:730
Definition: Protocol.hpp:623
float rpy[3]
Definition: Protocol.hpp:186
T read16(InputIterator it)
Definition: Protocol.hpp:35
float magnetometers_xyz[3]
Definition: Protocol.hpp:178
Definition: Protocol.hpp:672
Definition: Protocol.hpp:469
float current_rotation_angle
Definition: Protocol.hpp:890
Definition: Protocol.hpp:632
float ned[3]
Definition: Protocol.hpp:176