30#include <fastcdr/Cdr.h>
32#include <fastcdr/exceptions/BadParamException.h>
33using namespace eprosima::fastcdr::exception;
37#define geometry_msgs_msg_Pose_max_cdr_typesize 56ULL;
38#define geometry_msgs_msg_Point_max_cdr_typesize 24ULL;
39#define geometry_msgs_msg_PoseWithCovariance_max_cdr_typesize 344ULL;
40#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL;
41#define geometry_msgs_msg_Pose_max_key_cdr_typesize 0ULL;
42#define geometry_msgs_msg_Point_max_key_cdr_typesize 0ULL;
43#define geometry_msgs_msg_PoseWithCovariance_max_key_cdr_typesize 0ULL;
44#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL;
69 m_pose = std::move(x.m_pose);
72 m_covariance = std::move(x.m_covariance);
88 m_pose = std::move(x.m_pose);
91 m_covariance = std::move(x.m_covariance);
98bool ImuPubSubType::getKey(
104 if (!m_isGetKeyDefined)
110 Imu* p_type =
static_cast<Imu*
>(data);
115 eprosima::fastcdr::FastBuffer fastbuffer(
reinterpret_cast<char*
>(m_keyBuffer),
116 Imu::getKeyMaxCdrSerializedSize());
121 eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS);
125 p_type->serializeKey(ser);
128 if (force_md5 || Imu::getKeyMaxCdrSerializedSize() > 16)
134 m_md5.update(m_keyBuffer,
static_cast<unsigned int>(ser.getSerializedDataLength()));
140 for (uint8_t i = 0; i < 16; ++i)
142 handle->value[i] = m_md5.digest[i];
149 for (uint8_t i = 0; i < 16; ++i)
151 handle->value[i] = m_keyBuffer[i];
174 eprosima::fastcdr::Cdr& scdr)
const
177 scdr << m_covariance;
181 eprosima::fastcdr::Cdr& dcdr)
184 dcdr >> m_covariance;
204 m_pose = std::move(_pose);
231 m_covariance = _covariance;
241 m_covariance = std::move(_covariance);
284 eprosima::fastcdr::Cdr& scdr)
const
eprosima::fastrtps::rtps::InstanceHandle_t InstanceHandle_t
#define geometry_msgs_msg_PoseWithCovariance_max_key_cdr_typesize
return current_alignment initial_alignment
This class represents the structure PoseWithCovariance defined by the user in the IDL file.
geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36 m_covariance
geometry_msgs::msg::Pose m_pose
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
eProsima_user_DllExport const geometry_msgs::msg::Pose & pose() const
This function returns a constant reference to member pose
static eProsima_user_DllExport size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
eProsima_user_DllExport ~PoseWithCovariance()
Default destructor.
eProsima_user_DllExport const geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36 & covariance() const
This function returns a constant reference to member covariance
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type
eProsima_user_DllExport PoseWithCovariance()
Default constructor.
eProsima_user_DllExport PoseWithCovariance & operator=(const PoseWithCovariance &x)
Copy assignment.
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Pose &data, size_t current_alignment=0)
返回数据的序列化大小,取决于缓冲区对齐。
std::array< double, 36 > geometry_msgs__PoseWithCovariance__double_array_36