CARLA
 
载入中...
搜索中...
未找到
CarlaRGBCameraPublisher.cpp
浏览该文件的文档.
1#define _GLIBCXX_USE_CXX11_ABI 0
2// 包含Carla RGBCamera发布者相关的头文件,推测其中定义了CarlaRGBCameraPublisher类的声明等内容
4// 引入C++标准库中的字符串头文件,用于处理字符串相关操作
5#include <string>
6// 引入Carla项目中ROS2相关的图像发布/订阅类型定义头文件,用于在ROS2环境下处理图像数据的发布和订阅
7#include "carla/ros2/types/ImagePubSubTypes.h"// 引入Carla项目中ROS2相关的相机信息发布/订阅类型定义头文件,用于处理相机参数等信息的发布和订阅
8#include "carla/ros2/types/CameraInfoPubSubTypes.h"// 引入Carla项目中ROS2相关的监听器(Listener)头文件,可能用于监听一些事件、消息等
10// 引入eProsima Fast DDS库中与域参与者(DomainParticipant)相关的头文件,
11// 域参与者是Fast DDS中用于参与数据分发服务的一个核心概念,多个参与者可以在同一个域内进行通信
12#include <fastdds/dds/domain/DomainParticipant.hpp> // 引入eProsima Fast DDS库中与发布者(Publisher)相关的头文件,用于创建发布者对象来发布数据
13#include <fastdds/dds/publisher/Publisher.hpp>// 引入eProsima Fast DDS库中与主题(Topic)相关的头文件,主题用于定义发布和订阅的数据类型和名称等信息
14#include <fastdds/dds/topic/Topic.hpp> // 引入eProsima Fast DDS库中与数据写入器(DataWriter)相关的头文件,用于将数据写入到对应的主题中进行发布
15#include <fastdds/dds/publisher/DataWriter.hpp>// 引入eProsima Fast DDS库中与类型支持(TypeSupport)相关的头文件,用于注册和管理数据类型
16#include <fastdds/dds/topic/TypeSupport.hpp>
17// 引入eProsima Fast DDS库中与服务质量(QoS,Quality of Service)相关的头文件,用于配置各种服务质量参数,如可靠性、实时性等
18// 服务质量 (QoS)
19#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
20#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
21#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
22#include <fastdds/dds/topic/qos/TopicQos.hpp>
23
24// RTPS规范,全称为实时发布/订阅 协议DDS互操作规范(The Real-Time Publish-Subscribe Protocol (RTPS) DDS Interoperability Wire Protocol Specification)
25#include <fastrtps/attributes/ParticipantAttributes.h>
26#include <fastrtps/qos/QosPolicies.h>
27#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
28#include <fastdds/dds/publisher/DataWriterListener.hpp>
29
30// 定义在Carla项目的ros2命名空间下,方便组织和管理与ROS2相关的代码
31namespace carla {
32namespace ros2 {
33
34// 为eProsima Fast DDS库的相关命名空间创建别名efd,方便后续代码书写,减少代码冗长度
35 namespace efd = eprosima::fastdds::dds;// 为eProsima Fast RTPS库中的返回码类型(ReturnCode_t)创建别名erc,方便后续使用返回码进行错误处理等操作
36 using erc = eprosima::fastrtps::types::ReturnCode_t;
37// CarlaRGBCameraPublisherImpl结构体,用于存储Carla RGBCamera发布者的具体实现相关的内部数据成员,
38 // 可以看作是对CarlaRGBCameraPublisher类内部实现细节的一种封装,将相关的数据和操作放在一起
39 struct CarlaRGBCameraPublisherImpl {// 指向域参与者对象的指针,用于参与Fast DDS的数据分发服务,初始化为nullptr
40 efd::DomainParticipant* _participant { nullptr };// 指向发布者对象的指针,用于发布数据,初始化为nullptr
41 efd::Publisher* _publisher { nullptr };// 指向主题对象的指针,用于定义发布的数据主题相关信息,初始化为nullptr
42 efd::Topic* _topic { nullptr }; // 指向数据写入器对象的指针,用于将实际数据写入到主题中进行发布,初始化为nullptr
43 efd::DataWriter* _datawriter { nullptr }; // 类型支持对象,用于注册和管理要发布的图像数据类型,这里初始化为sensor_msgs::msg::ImagePubSubType类型的实例
44 efd::TypeSupport _type { new sensor_msgs::msg::ImagePubSubType() };// CarlaListener对象,用于监听相关事件,具体功能取决于CarlaListener的实现
45 CarlaListener _listener {}; // 用于存储要发布的图像消息数据,初始化为默认构造的空图像消息
47 };
48// CarlaCameraInfoPublisherImpl结构体,与CarlaRGBCameraPublisherImpl类似,
49 // 不过是用于存储相机信息发布相关的内部数据成员,比如相机的参数信息等
50 struct CarlaCameraInfoPublisherImpl {
51 efd::DomainParticipant* _participant { nullptr };
52 efd::Publisher* _publisher { nullptr };
53 efd::Topic* _topic { nullptr };
54 efd::DataWriter* _datawriter { nullptr };
55 efd::TypeSupport _type { new sensor_msgs::msg::CameraInfoPubSubType() };
56 CarlaListener _listener {};// 用于标记相机信息是否已经初始化,初始化为false
57 bool _init {false};// 用于存储要发布的相机信息消息数据,初始化为默认构造的空相机信息消息
59 };
60// 判断Carla RGBCamera发布者是否已经初始化的函数,通过查看CarlaCameraInfoPublisherImpl结构体中的_init成员来判断
62 return _impl_info->_init;
63 }
64// 初始化相机信息数据的函数,根据传入的相机参数(偏移量、高度、宽度、视场角等)构建相机信息消息,
65 // 并设置感兴趣区域(ROI)信息,最后将初始化标记置为true,表示相机信息已初始化
66 void CarlaRGBCameraPublisher::InitInfoData(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify) {
67 _impl_info->_info = std::move(sensor_msgs::msg::CameraInfo(height, width, fov));
68 SetInfoRegionOfInterest(x_offset, y_offset, height, width, do_rectify);
69 _impl_info->_init = true;
70 }
71// 初始化整个Carla RGBCamera发布者的函数,调用InitImage和InitInfo函数分别对图像发布和相机信息发布相关的部分进行初始化,
72 // 只有当这两部分都初始化成功时才返回true,否则返回false
74 return InitImage() && InitInfo();
75 }
76// 初始化图像发布相关部分的函数,主要完成以下步骤:
77 // 1. 检查类型支持对象是否有效,若无效则输出错误信息并返回false。
78 // 2. 设置域参与者的服务质量参数(QoS),包括设置名称等,然后通过域参与者工厂创建域参与者对象,若创建失败则返回false。
79 // 3. 使用创建好的域参与者对象注册要发布的图像数据类型。
80 // 4. 设置发布者的服务质量参数并创建发布者对象,若创建失败则返回false。
81 // 5. 设置主题的服务质量参数,根据给定的规则构建主题名称,然后创建主题对象,若创建失败则返回false。
82 // 6. 设置数据写入器的服务质量参数,获取对应的监听器对象,然后创建数据写入器对象,若创建失败则返回false。
83 // 7. 设置图像数据的帧ID,最后返回true表示初始化成功。
85 if (_impl->_type == nullptr) {
86 std::cerr << "Invalid TypeSupport" << std::endl;
87 return false;
88 }
89
90 efd::DomainParticipantQos pqos = efd::PARTICIPANT_QOS_DEFAULT;
91 pqos.name(_name);
92 auto factory = efd::DomainParticipantFactory::get_instance();
93 _impl->_participant = factory->create_participant(0, pqos);
94 if (_impl->_participant == nullptr) {
95 std::cerr << "Failed to create DomainParticipant" << std::endl;
96 return false;
97 }
98 _impl->_type.register_type(_impl->_participant);
99
100 efd::PublisherQos pubqos = efd::PUBLISHER_QOS_DEFAULT;
101 _impl->_publisher = _impl->_participant->create_publisher(pubqos, nullptr);
102 if (_impl->_publisher == nullptr) {
103 std::cerr << "Failed to create Publisher" << std::endl;
104 return false;
105 }
106
107 efd::TopicQos tqos = efd::TOPIC_QOS_DEFAULT;
108 const std::string publisher_type {"/image"};
109 const std::string base { "rt/carla/" };
110 std::string topic_name = base;
111 if (!_parent.empty())
112 topic_name += _parent + "/";
113 topic_name += _name;
114 topic_name += publisher_type;
115 _impl->_topic = _impl->_participant->create_topic(topic_name, _impl->_type->getName(), tqos);
116 if (_impl->_topic == nullptr) {
117 std::cerr << "Failed to create Topic" << std::endl;
118 return false;
119 }
120 efd::DataWriterQos wqos = efd::DATAWRITER_QOS_DEFAULT;
121 wqos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
122 efd::DataWriterListener* listener = (efd::DataWriterListener*)_impl->_listener._impl.get();
123 _impl->_datawriter = _impl->_publisher->create_datawriter(_impl->_topic, wqos, listener);
124 if (_impl->_datawriter == nullptr) {
125 std::cerr << "Failed to create DataWriter" << std::endl;
126 return false;
127 }
128
130 return true;
131 }
132// 初始化相机信息发布相关部分的函数,与InitImage函数的逻辑类似,不过操作的对象是相机信息相关的数据成员和组件,
133 // 同样完成创建域参与者、发布者、主题、数据写入器等一系列操作,若过程中任何一步失败则返回false,全部成功则返回true
135 if (_impl_info->_type == nullptr) {
136 std::cerr << "Invalid TypeSupport" << std::endl;
137 return false;
138 }
139
140 efd::DomainParticipantQos pqos = efd::PARTICIPANT_QOS_DEFAULT;
141 pqos.name(_name);
142 auto factory = efd::DomainParticipantFactory::get_instance();
143 _impl_info->_participant = factory->create_participant(0, pqos);
144 if (_impl_info->_participant == nullptr) {
145 std::cerr << "Failed to create DomainParticipant" << std::endl;
146 return false;
147 }
148 _impl_info->_type.register_type(_impl_info->_participant);
149
150 efd::PublisherQos pubqos = efd::PUBLISHER_QOS_DEFAULT;
151 _impl_info->_publisher = _impl_info->_participant->create_publisher(pubqos, nullptr);
152 if (_impl_info->_publisher == nullptr) {
153 std::cerr << "Failed to create Publisher" << std::endl;
154 return false;
155 }
156
157 efd::TopicQos tqos = efd::TOPIC_QOS_DEFAULT;
158 const std::string publisher_type {"/camera_info"};
159 const std::string base { "rt/carla/" };
160 std::string topic_name = base;
161 if (!_parent.empty())
162 topic_name += _parent + "/";
163 topic_name += _name;
164 topic_name += publisher_type;
165 _impl_info->_topic = _impl_info->_participant->create_topic(topic_name, _impl_info->_type->getName(), tqos);
166 if (_impl_info->_topic == nullptr) {
167 std::cerr << "Failed to create Topic" << std::endl;
168 return false;
169 }
170 efd::DataWriterQos wqos = efd::DATAWRITER_QOS_DEFAULT;
171 efd::DataWriterListener* listener = (efd::DataWriterListener*)_impl_info->_listener._impl.get();
172 _impl_info->_datawriter = _impl_info->_publisher->create_datawriter(_impl_info->_topic, wqos, listener);
173 if (_impl_info->_datawriter == nullptr) {
174 std::cerr << "Failed to create DataWriter" << std::endl;
175 return false;
176 }
177
179 return true;
180 }
181// 发布数据的函数,调用PublishImage和PublishInfo函数分别发布图像数据和相机信息数据,
182 // 只有当这两部分数据都发布成功时才返回true,否则返回false
186// 发布图像数据的函数,通过数据写入器尝试将存储的图像消息数据写入到对应的主题中进行发布,
187 // 根据返回的结果码(rcode)判断是否发布成功,若返回码表示成功(RETCODE_OK)则返回true,
188 // 否则根据不同的错误返回码输出相应的错误信息并返回false,若遇到未知的返回码也输出错误信息并返回false
190 eprosima::fastrtps::rtps::InstanceHandle_t instance_handle;
191 eprosima::fastrtps::types::ReturnCode_t rcode = _impl->_datawriter->write(&_impl->_image, instance_handle);
192 if (rcode == erc::ReturnCodeValue::RETCODE_OK) {
193 return true;
194 }
195 if (rcode == erc::ReturnCodeValue::RETCODE_ERROR) {
196 std::cerr << "RETCODE_ERROR" << std::endl;
197 return false;
198 }
199 if (rcode == erc::ReturnCodeValue::RETCODE_UNSUPPORTED) {
200 std::cerr << "RETCODE_UNSUPPORTED" << std::endl;
201 return false;
202 }
203 if (rcode == erc::ReturnCodeValue::RETCODE_BAD_PARAMETER) {
204 std::cerr << "RETCODE_BAD_PARAMETER" << std::endl;
205 return false;
206 }
207 if (rcode == erc::ReturnCodeValue::RETCODE_PRECONDITION_NOT_MET) {
208 std::cerr << "RETCODE_PRECONDITION_NOT_MET" << std::endl;
209 return false;
210 }
211 if (rcode == erc::ReturnCodeValue::RETCODE_OUT_OF_RESOURCES) {
212 std::cerr << "RETCODE_OUT_OF_RESOURCES" << std::endl;
213 return false;
214 }
215 if (rcode == erc::ReturnCodeValue::RETCODE_NOT_ENABLED) {
216 std::cerr << "RETCODE_NOT_ENABLED" << std::endl;
217 return false;
218 }
219 if (rcode == erc::ReturnCodeValue::RETCODE_IMMUTABLE_POLICY) {
220 std::cerr << "RETCODE_IMMUTABLE_POLICY" << std::endl;
221 return false;
222 }
223 if (rcode == erc::ReturnCodeValue::RETCODE_INCONSISTENT_POLICY) {
224 std::cerr << "RETCODE_INCONSISTENT_POLICY" << std::endl;
225 return false;
226 }
227 if (rcode == erc::ReturnCodeValue::RETCODE_ALREADY_DELETED) {
228 std::cerr << "RETCODE_ALREADY_DELETED" << std::endl;
229 return false;
230 }
231 if (rcode == erc::ReturnCodeValue::RETCODE_TIMEOUT) {
232 std::cerr << "RETCODE_TIMEOUT" << std::endl;
233 return false;
234 }
235 if (rcode == erc::ReturnCodeValue::RETCODE_NO_DATA) {
236 std::cerr << "RETCODE_NO_DATA" << std::endl;
237 return false;
238 }
239 if (rcode == erc::ReturnCodeValue::RETCODE_ILLEGAL_OPERATION) {
240 std::cerr << "RETCODE_ILLEGAL_OPERATION" << std::endl;
241 return false;
242 }
243 if (rcode == erc::ReturnCodeValue::RETCODE_NOT_ALLOWED_BY_SECURITY) {
244 std::cerr << "RETCODE_NOT_ALLOWED_BY_SECURITY" << std::endl;
245 return false;
246 }
247 std::cerr << "UNKNOWN" << std::endl;
248 return false;
249 }
250
252 eprosima::fastrtps::rtps::InstanceHandle_t instance_handle;
253 // 执行信息的发布动作
254 eprosima::fastrtps::types::ReturnCode_t rcode = _impl_info->_datawriter->write(&_impl_info->_info, instance_handle);
255 if (rcode == erc::ReturnCodeValue::RETCODE_OK) {
256 return true;
257 }
258 if (rcode == erc::ReturnCodeValue::RETCODE_ERROR) {
259 std::cerr << "RETCODE_ERROR" << std::endl;
260 return false;
261 }
262 if (rcode == erc::ReturnCodeValue::RETCODE_UNSUPPORTED) {
263 std::cerr << "RETCODE_UNSUPPORTED" << std::endl;
264 return false;
265 }
266 if (rcode == erc::ReturnCodeValue::RETCODE_BAD_PARAMETER) {
267 std::cerr << "RETCODE_BAD_PARAMETER" << std::endl;
268 return false;
269 }
270 if (rcode == erc::ReturnCodeValue::RETCODE_PRECONDITION_NOT_MET) {
271 std::cerr << "RETCODE_PRECONDITION_NOT_MET" << std::endl;
272 return false;
273 }
274 if (rcode == erc::ReturnCodeValue::RETCODE_OUT_OF_RESOURCES) {
275 std::cerr << "RETCODE_OUT_OF_RESOURCES" << std::endl;
276 return false;
277 }
278 if (rcode == erc::ReturnCodeValue::RETCODE_NOT_ENABLED) {
279 std::cerr << "RETCODE_NOT_ENABLED" << std::endl;
280 return false;
281 }
282 if (rcode == erc::ReturnCodeValue::RETCODE_IMMUTABLE_POLICY) {
283 std::cerr << "RETCODE_IMMUTABLE_POLICY" << std::endl;
284 return false;
285 }
286 if (rcode == erc::ReturnCodeValue::RETCODE_INCONSISTENT_POLICY) {
287 std::cerr << "RETCODE_INCONSISTENT_POLICY" << std::endl;
288 return false;
289 }
290 if (rcode == erc::ReturnCodeValue::RETCODE_ALREADY_DELETED) {
291 std::cerr << "RETCODE_ALREADY_DELETED" << std::endl;
292 return false;
293 }
294 if (rcode == erc::ReturnCodeValue::RETCODE_TIMEOUT) {
295 std::cerr << "RETCODE_TIMEOUT" << std::endl;
296 return false;
297 }
298 if (rcode == erc::ReturnCodeValue::RETCODE_NO_DATA) {
299 std::cerr << "RETCODE_NO_DATA" << std::endl;
300 return false;
301 }
302 if (rcode == erc::ReturnCodeValue::RETCODE_ILLEGAL_OPERATION) {
303 std::cerr << "RETCODE_ILLEGAL_OPERATION" << std::endl;
304 return false;
305 }
306 if (rcode == erc::ReturnCodeValue::RETCODE_NOT_ALLOWED_BY_SECURITY) {
307 std::cerr << "RETCODE_NOT_ALLOWED_BY_SECURITY" << std::endl;
308 return false;
309 }
310 std::cerr << "UNKNOWN" << std::endl;
311 return false;
312 }
313
314void CarlaRGBCameraPublisher::SetImageData(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, const uint8_t* data) {
315 std::vector<uint8_t> vector_data;
316 const size_t size = height * width * 4;
317 vector_data.resize(size);
318 std::memcpy(&vector_data[0], &data[0], size);
319 SetImageData(seconds, nanoseconds, height, width, std::move(vector_data));
320 }
321
322 void CarlaRGBCameraPublisher::SetImageData(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, std::vector<uint8_t>&& data) {
323
325 time.sec(seconds);
326 time.nanosec(nanoseconds);
327
328 std_msgs::msg::Header header;
329 header.stamp(std::move(time));
330 header.frame_id(_frame_id);
331 _impl->_image.header(header);
332
333 _impl->_image.width(width);
334 _impl->_image.height(height);
335 _impl->_image.encoding("bgra8");
336 _impl->_image.is_bigendian(0);
337 _impl->_image.step(_impl->_image.width() * sizeof(uint8_t) * 4);
338 _impl->_image.data(std::move(data));
339 }
340
341 void CarlaRGBCameraPublisher::SetCameraInfoData(int32_t seconds, uint32_t nanoseconds) {
343 time.sec(seconds);
344 time.nanosec(nanoseconds);
345
346 std_msgs::msg::Header header;
347 header.stamp(std::move(time));
348 header.frame_id(_frame_id);
349 _impl_info->_info.header(header);
350 }
351
352 void CarlaRGBCameraPublisher::SetInfoRegionOfInterest( uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, bool do_rectify) {
354 roi.x_offset(x_offset);
355 roi.y_offset(y_offset);
356 roi.height(height);
357 roi.width(width);
358 roi.do_rectify(do_rectify);
359 _impl_info->_info.roi(roi);
360 }
361
362 CarlaRGBCameraPublisher::CarlaRGBCameraPublisher(const char* ros_name, const char* parent) :
363 _impl(std::make_shared<CarlaRGBCameraPublisherImpl>()),
364 _impl_info(std::make_shared<CarlaCameraInfoPublisherImpl>()) {
365 _name = ros_name;
366 _parent = parent;
367 }
368
370 if (!_impl)
371 return;
372
373 if (_impl->_datawriter)
374 _impl->_publisher->delete_datawriter(_impl->_datawriter);
375
376 if (_impl->_publisher)
377 _impl->_participant->delete_publisher(_impl->_publisher);
378
379 if (_impl->_topic)
380 _impl->_participant->delete_topic(_impl->_topic);
381
382 if (_impl->_participant)
383 efd::DomainParticipantFactory::get_instance()->delete_participant(_impl->_participant);
384
385 if (!_impl_info)
386 return;
387
388 if (_impl_info->_datawriter)
389 _impl_info->_publisher->delete_datawriter(_impl_info->_datawriter);
390
391 if (_impl_info->_publisher)
392 _impl_info->_participant->delete_publisher(_impl_info->_publisher);
393
394 if (_impl_info->_topic)
395 _impl_info->_participant->delete_topic(_impl_info->_topic);
396
397 if (_impl_info->_participant)
398 efd::DomainParticipantFactory::get_instance()->delete_participant(_impl_info->_participant);
399 }
400
402 _frame_id = other._frame_id;
403 _name = other._name;
404 _parent = other._parent;
405 _impl = other._impl;
406 _impl_info = other._impl_info;
407 }
408
410 _frame_id = other._frame_id;
411 _name = other._name;
412 _parent = other._parent;
413 _impl = other._impl;
414 _impl_info = other._impl_info;
415
416 return *this;
417 }
418
420 _frame_id = std::move(other._frame_id);
421 _name = std::move(other._name);
422 _parent = std::move(other._parent);
423 _impl = std::move(other._impl);
424 _impl_info = std::move(other._impl_info);
425 }
426
428 _frame_id = std::move(other._frame_id);
429 _name = std::move(other._name);
430 _parent = std::move(other._parent);
431 _impl = std::move(other._impl);
432 _impl_info = std::move(other._impl_info);
433
434 return *this;
435 }
436}
437}
此类表示用户在IDL文件中定义的Time结构。
eProsima_user_DllExport void nanosec(uint32_t _nanosec)
此函数设置成员nanosec的值。
Definition Time.cpp:183
eProsima_user_DllExport void sec(int32_t _sec)
此函数设置成员sec的值。
Definition Time.cpp:152
const std::string & parent() const
std::shared_ptr< CarlaCameraInfoPublisherImpl > _impl_info
std::shared_ptr< CarlaRGBCameraPublisherImpl > _impl
void SetImageData(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, const uint8_t *data)
void SetInfoRegionOfInterest(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, bool do_rectify)
CarlaRGBCameraPublisher(const char *ros_name="", const char *parent="")
void InitInfoData(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify)
移动赋值运算符重载函数,类似移动构造函数的作用,不过是用于赋值操作时高效地转移资源所有权 CarlaRGBCameraPublisher & operator=(CarlaRGBCameraPublisher &&)
void SetCameraInfoData(int32_t seconds, uint32_t nanoseconds)
此类表示用户在 IDL 文件中定义的 CameraInfo 类型的 TopicDataType。 <>
This class represents the structure CameraInfo defined by the user in the IDL file....
Definition CameraInfo.h:75
此类表示用户在IDL文件中定义的Image类型的主题数据类型。
This class represents the structure Image defined by the user in the IDL file.这个类表示在 IDL(接口定义语言)文件中由用...
This class represents the structure RegionOfInterest defined by the user in the IDL file.
eProsima_user_DllExport void y_offset(uint32_t _y_offset)
This function sets a value in member y_offset
eProsima_user_DllExport void width(uint32_t _width)
This function sets a value in member width
eProsima_user_DllExport void height(uint32_t _height)
This function sets a value in member height
eProsima_user_DllExport void x_offset(uint32_t _x_offset)
This function sets a value in member x_offset
eProsima_user_DllExport void do_rectify(bool _do_rectify)
This function sets a value in member do_rectify
eprosima::fastrtps::types::ReturnCode_t erc
@using erc
CARLA模拟器的主命名空间。
Definition Carla.cpp:139
Carla相机信息发布者内部实现的结构体。
sensor_msgs::msg::CameraInfo _info
相机信息消息实例。
efd::DomainParticipant * _participant
DDS域参与者指针。
efd::TypeSupport _type
DDS类型支持,用于相机信息消息。
efd::DataWriter * _datawriter
DDS数据写入器指针。
efd::Publisher * _publisher
DDS发布者指针。
CarlaListener _listener
CARLA监听器实例。