30#include <fastcdr/Cdr.h>
32#include <fastcdr/exceptions/BadParamException.h>
33using namespace eprosima::fastcdr::exception;
38#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL;
39#define sensor_msgs_msg_CameraInfo_max_cdr_typesize 3793ULL;
40#define sensor_msgs_msg_RegionOfInterest_max_cdr_typesize 17ULL;
41#define std_msgs_msg_Header_max_cdr_typesize 268ULL;
42#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL;
43#define sensor_msgs_msg_CameraInfo_max_key_cdr_typesize 0ULL;
44#define sensor_msgs_msg_RegionOfInterest_max_key_cdr_typesize 0ULL;
45#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL;
54 const double cx =
static_cast<double>(
m_width) / 2.0;
55 const double cy =
static_cast<double>(
m_height) / 2.0;
56 const double fx =
static_cast<double>(
m_width) / (2.0 * std::tan(fov) * M_PI / 360.0);
59 m_d = { 0.0, 0.0, 0.0, 0.0, 0.0 };
60 m_k = {fx, 0.0, cx, 0.0, fy, cy, 0.0, 0.0, 1.0};
61 m_r = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 };
62 m_p = {fx, 0.0, cx, 0.0, 0.0, fy, cy, 0.0, 0.0, 0.0, 1.0, 0.0};
91 m_header = std::move(x.m_header);
92 m_height = x.m_height;
94 m_distortion_model = std::move(x.m_distortion_model);
95 m_d = std::move(x.m_d);
96 m_k = std::move(x.m_k);
97 m_r = std::move(x.m_r);
98 m_p = std::move(x.m_p);
99 m_binning_x = x.m_binning_x;
100 m_binning_y = x.m_binning_y;
101 m_roi = std::move(x.m_roi);
125 m_header = std::move(x.m_header);
126 m_height = x.m_height;
128 m_distortion_model = std::move(x.m_distortion_model);
129 m_d = std::move(x.m_d);
130 m_k = std::move(x.m_k);
131 m_r = std::move(x.m_r);
132 m_p = std::move(x.m_p);
133 m_binning_x = x.m_binning_x;
134 m_binning_y = x.m_binning_y;
135 m_roi = std::move(x.m_roi);
149 return !(*
this == x);
153 size_t current_alignment)
155 static_cast<void>(current_alignment);
161 size_t current_alignment)
164 size_t initial_alignment = current_alignment;
166 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
167 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
168 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.
distortion_model().size() + 1;
169 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
171 if (data.
D().size() > 0)
173 current_alignment += (data.
D().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
176 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
178 if (data.
k().size() > 0)
180 current_alignment += (data.
k().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
183 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
185 if (data.
r().size() > 0)
187 current_alignment += (data.
r().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
190 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
192 if (data.
p().size() > 0)
194 current_alignment += (data.
p().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);
197 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
198 current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
201 return current_alignment - initial_alignment;
205 eprosima::fastcdr::Cdr& scdr)
const
210 scdr << m_distortion_model.c_str();
221 eprosima::fastcdr::Cdr& dcdr)
226 dcdr >> m_distortion_model;
253 m_header = std::move(_header);
334 const std::string& _distortion_model)
336 m_distortion_model = _distortion_model;
344 std::string&& _distortion_model)
346 m_distortion_model = std::move(_distortion_model);
355 return m_distortion_model;
364 return m_distortion_model;
372 const std::vector<double>& _D)
382 std::vector<double>&& _D)
410 const std::array<double, 9>& _k)
420 std::array<double, 9>&& _k)
447 const std::array<double, 9>& _r)
457 std::array<double, 9>&& _r)
485 const std::array<double, 12>& _p)
495 std::array<double, 12>&& _p)
525 m_binning_x = _binning_x;
553 m_binning_y = _binning_y;
591 m_roi = std::move(_roi);
613 size_t current_alignment)
615 static_cast<void>(current_alignment);
625 eprosima::fastcdr::Cdr& scdr)
const
#define sensor_msgs_msg_CameraInfo_max_cdr_typesize
#define sensor_msgs_msg_CameraInfo_max_key_cdr_typesize
This class represents the structure CameraInfo defined by the user in the IDL file.
std::array< double, 12 > m_p
std_msgs::msg::Header m_header
eProsima_user_DllExport void p(const std::array< double, 12 > &_p)
This function copies the value in member p
static eProsima_user_DllExport bool isKeyDefined()
This function tells you if the Key has been defined for this type
std::array< double, 9 > m_r
eProsima_user_DllExport void k(const std::array< double, 9 > &_k)
This function copies the value in member K
eProsima_user_DllExport const std::array< double, 9 > & r() const
This function returns a constant reference to member r
std::string m_distortion_model
eProsima_user_DllExport void D(const std::vector< double > &_D)
This function copies the value in member D
eProsima_user_DllExport const sensor_msgs::msg::RegionOfInterest & roi() const
This function returns a constant reference to member roi
eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
eProsima_user_DllExport bool operator==(const CameraInfo &x) const
Comparison operator.
eProsima_user_DllExport CameraInfo(uint32_t height=0, uint32_t width=0, double fov=0.0)
Default constructor.
eProsima_user_DllExport bool operator!=(const CameraInfo &x) const
Comparison operator.
eProsima_user_DllExport void roi(const sensor_msgs::msg::RegionOfInterest &_roi)
This function copies the value in member roi
std::vector< double > m_d
eProsima_user_DllExport uint32_t binning_y() const
This function returns the value of member binning_y
eProsima_user_DllExport const std::array< double, 12 > & p() const
This function returns a constant reference to member p
eProsima_user_DllExport uint32_t width() const
This function returns the value of member width
eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
eProsima_user_DllExport CameraInfo & operator=(const CameraInfo &x)
Copy assignment.
eProsima_user_DllExport const std_msgs::msg::Header & header() const
This function returns a constant reference to member header
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 void header(const std_msgs::msg::Header &_header)
This function copies the value in member header
eProsima_user_DllExport void distortion_model(const std::string &_distortion_model)
This function copies the value in member distortion_model
eProsima_user_DllExport void r(const std::array< double, 9 > &_r)
This function copies the value in member r
eProsima_user_DllExport const std::vector< double > & D() const
This function returns a constant reference to member D
eProsima_user_DllExport uint32_t binning_x() const
This function returns the value of member binning_x
eProsima_user_DllExport uint32_t height() const
This function returns the value of member height
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...
sensor_msgs::msg::RegionOfInterest m_roi
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.
std::array< double, 9 > m_k
eProsima_user_DllExport const std::string & distortion_model() const
This function returns a constant reference to member distortion_model
eProsima_user_DllExport ~CameraInfo()
Default destructor.
eProsima_user_DllExport const std::array< double, 9 > & k() const
This function returns a constant reference to member k
static eProsima_user_DllExport size_t getCdrSerializedSize(const sensor_msgs::msg::CameraInfo &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
This class represents the structure RegionOfInterest defined by the user in the IDL file.
static eProsima_user_DllExport size_t getCdrSerializedSize(const sensor_msgs::msg::RegionOfInterest &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.