6#define _GLIBCXX_USE_CXX11_ABI 0
17 struct CarlaDepthCameraPublisherImpl;
20 struct CarlaCameraInfoPublisherImpl;
43 void InitInfoData(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width,
float fov,
bool do_rectify);
47 void SetImageData(int32_t seconds, uint32_t nanoseconds,
size_t height,
size_t width,
const uint8_t* data);
49 const char*
type()
const override {
return "depth camera"; }
57 void SetInfoRegionOfInterest( uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width,
bool do_rectify);
58 void SetData(int32_t seconds, uint32_t nanoseconds,
size_t height,
size_t width, std::vector<uint8_t>&& data);
61 std::shared_ptr<CarlaDepthCameraPublisherImpl>
_impl;
62 std::shared_ptr<CarlaCameraInfoPublisherImpl>
_impl_info;
用于在ROS 2中发布CARLA深度相机数据的类。 这个类继承自CarlaPublisher,专门用于初始化、设置和发布深度相机数据。
bool Publish()
发布深度图像和相机信息。
bool InitInfo()
初始化相机信息发布者的DDS相关组件。
bool PublishInfo()
发布深度相机信息
~CarlaDepthCameraPublisher()
析构函数,用于销毁CarlaDepthCameraPublisher对象。
CarlaDepthCameraPublisher & operator=(const CarlaDepthCameraPublisher &)
拷贝赋值运算符。
void SetInfoRegionOfInterest(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, bool do_rectify)
设置感兴趣区域(ROI)信息
const char * type() const override
CarlaDepthCameraPublisher(const char *ros_name="", const char *parent="")
构造函数,用于创建CarlaDepthCameraPublisher对象。
bool InitImage()
初始化深度图像数据。
void SetImageData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, const uint8_t *data)
设置图像数据
bool Init()
初始化函数,用于设置ROS节点和发布者。
void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, std::vector< uint8_t > &&data)
设置图像数据及其元数据
std::shared_ptr< CarlaDepthCameraPublisherImpl > _impl
bool PublishImage()
发布深度图像
void InitInfoData(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify)
初始化深度相机信息数据。
std::shared_ptr< CarlaCameraInfoPublisherImpl > _impl_info
bool HasBeenInitialized() const
检查深度相机发布者是否已初始化。
void SetCameraInfoData(int32_t seconds, uint32_t nanoseconds)
设置相机信息数据的时间戳
const std::string & parent() const