CARLA
 
载入中...
搜索中...
未找到
PoseWithCovariance.cpp
浏览该文件的文档.
1// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/*!
16 * @file PoseWithCovariance.cpp
17 * This source file contains the definition of the described types in the IDL file.
18 *
19 * This file was generated by the tool gen.
20 */
21
22#ifdef _WIN32
23// Remove linker warning LNK4221 on Visual Studio
24namespace {
25char dummy;
26} // namespace
27#endif // _WIN32
28
29#include "PoseWithCovariance.h"
30#include <fastcdr/Cdr.h>
31
32#include <fastcdr/exceptions/BadParamException.h>
33using namespace eprosima::fastcdr::exception;
34
35#include <utility>
36
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;
45
47{
48 // geometry_msgs::msg::Pose m_pose
49
50 // geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36 m_covariance
51 memset(&m_covariance, 0, (36) * 8);
52}
53
57
64
66 PoseWithCovariance&& x) noexcept
67{
68 m_pose = std::move(x.m_pose);
69 m_covariance = std::move(x.m_covariance);
70}
71
80
82 PoseWithCovariance&& x) noexcept
83{
84 m_pose = std::move(x.m_pose);
85 m_covariance = std::move(x.m_covariance);
86
87 return *this;
88}
89
91 const PoseWithCovariance& x) const
92{
93 return (m_pose == x.m_pose && m_covariance == x.m_covariance);
94}
95
97 const PoseWithCovariance& x) const
98{
99 return !(*this == x);
100}
101
103 size_t current_alignment)
104{
105 static_cast<void>(current_alignment);
107}
108
111 size_t current_alignment)
112{
113 size_t initial_alignment = current_alignment;
114 current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.pose(), current_alignment);
115 current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
116
117 return current_alignment - initial_alignment;
118}
119
121 eprosima::fastcdr::Cdr& scdr) const
122{
123 scdr << m_pose;
124 scdr << m_covariance;
125}
126
128 eprosima::fastcdr::Cdr& dcdr)
129{
130 dcdr >> m_pose;
131 dcdr >> m_covariance;
132}
133
134/*!
135 * @brief This function copies the value in member pose
136 * @param _pose New value to be copied in member pose
137 */
139 const geometry_msgs::msg::Pose& _pose)
140{
141 m_pose = _pose;
142}
143
144/*!
145 * @brief This function moves the value in member pose
146 * @param _pose New value to be moved in member pose
147 */
150{
151 m_pose = std::move(_pose);
152}
153
154/*!
155 * @brief This function returns a constant reference to member pose
156 * @return Constant reference to member pose
157 */
162
163/*!
164 * @brief This function returns a reference to member pose
165 * @return Reference to member pose
166 */
171/*!
172 * @brief This function copies the value in member covariance
173 * @param _covariance New value to be copied in member covariance
174 */
180
181/*!
182 * @brief This function moves the value in member covariance
183 * @param _covariance New value to be moved in member covariance
184 */
190
191/*!
192 * @brief This function returns a constant reference to member covariance
193 * @return Constant reference to member covariance
194 */
199
200/*!
201 * @brief This function returns a reference to member covariance
202 * @return Reference to member covariance
203 */
208
209
211 size_t current_alignment)
212{
213 static_cast<void>(current_alignment);
215}
216
221
223 eprosima::fastcdr::Cdr& scdr) const
224{
225 (void) scdr;
226}
#define geometry_msgs_msg_PoseWithCovariance_max_cdr_typesize
Definition Odometry.cpp:44
#define geometry_msgs_msg_PoseWithCovariance_max_key_cdr_typesize
Definition Odometry.cpp:54
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
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::PoseWithCovariance &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
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 bool operator==(const PoseWithCovariance &x) const
Comparison operator.
eProsima_user_DllExport bool operator!=(const PoseWithCovariance &x) const
Comparison operator.
static eProsima_user_DllExport size_t getMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of an object depending on the buffer alignment.
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 void pose(const geometry_msgs::msg::Pose &_pose)
This function copies the value in member pose
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.
This class represents the structure Pose defined by the user in the IDL file.
Definition Pose.h:74
static eProsima_user_DllExport size_t getCdrSerializedSize(const geometry_msgs::msg::Pose &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
Definition Pose.cpp:103
std::array< double, 36 > geometry_msgs__PoseWithCovariance__double_array_36