27 out << m_pgn << m_src_address << m_priority << m_pdu_format;
28 out << m_pdu_spec << m_data_length;
29 out.WriteAs<uint32_t>(m_data.size());
30 if (!m_data.empty())
out.WriteBuffer(&m_data[0], m_data.size());
31 out.WriteAs<uint32_t>(m_raw_frame.size());
32 if (!m_raw_frame.empty())
33 out.WriteBuffer(&m_raw_frame[0], m_raw_frame.size());
34 out << sensorLabel << timestamp;
59 for (i = 0; i < n; ++i) in >> m_data[i];
62 m_raw_frame.resize(n);
64 for (i = 0; i < n; ++i)
67 m_raw_frame[i] = char(aux);
83 o <<
"Priority: " <<
format(
"0x%02X", m_priority)
84 <<
" [Dec: " << int(m_priority) <<
"]" << endl;
85 o <<
"Parameter Group Number (PGN): " <<
format(
"0x%04X", m_pgn)
86 <<
" [Dec: " << int(m_pgn) <<
"]" << endl;
87 o <<
"PDU Format: " <<
format(
"0x%02X", m_pdu_format)
88 <<
" [Dec: " << int(m_pdu_format) <<
"]" << endl;
89 o <<
"PDU Spec: " <<
format(
"0x%02X", m_pdu_spec)
90 <<
" [Dec: " << int(m_pdu_spec) <<
"]" << endl;
91 o <<
"Source address: " <<
format(
"0x%02X", m_src_address)
92 <<
" [Dec: " << int(m_src_address) <<
"]" << endl;
93 o <<
"Data length: " <<
format(
"0x%02X", m_data_length)
94 <<
" [Dec: " << int(m_data_length) <<
"]" << endl;
96 for (
unsigned char k : m_data) o <<
format(
"0x%02X", k) <<
" ";
98 for (
unsigned char k : m_data) o << int(k) <<
" ";
102 for (
char k : m_raw_frame) o << k;
std::string std::string format(std::string_view fmt, ARGS &&... args)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
This class stores a message from a CAN BUS with the protocol J1939.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::vision::TStereoCalibResults out
Declares a class that represents any robot's observation.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...