CARLA
 
载入中...
搜索中...
未找到
CarlaSemanticLidarPublisher.h
浏览该文件的文档.
1// Copyright (c) 2022 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB).
2// This work is licensed under the terms of the MIT license.
3// For a copy, see <https://opensource.org/licenses/MIT>.
4
5#pragma once// 指示编译器这个头文件已经被包含过一次,防止重复包含。
6#define _GLIBCXX_USE_CXX11_ABI 0// 定义宏_GLIBCXX_USE_CXX11_ABI,设置为0,这通常用于控制C++库ABI的版本。
7
8#include <memory>// 包含C++标准库中的智能指针和向量容器。
9#include <vector>
10
11#include "CarlaPublisher.h"// 包含自定义的CarlaPublisher头文件。
12// 定义carla命名空间下的ros2子命名空间。
13namespace carla {
14namespace ros2 {
15
16 struct CarlaSemanticLidarPublisherImpl;// 声明一个内部使用的类CarlaSemanticLidarPublisherImpl,具体实现细节未给出。
17 // 定义CarlaSemanticLidarPublisher类,继承自CarlaPublisher。
19 public:
20 CarlaSemanticLidarPublisher(const char* ros_name = "", const char* parent = "");// 构造函数,接受ROS名称和父节点名称作为参数,并初始化类成员。
21 ~CarlaSemanticLidarPublisher();// 析构函数,用于清理资源。
22 CarlaSemanticLidarPublisher(const CarlaSemanticLidarPublisher&);// 拷贝构造函数。
23 CarlaSemanticLidarPublisher& operator=(const CarlaSemanticLidarPublisher&); // 拷贝赋值运算符。
26
27 bool Init();// 初始化方法,准备发布数据。
28 bool Publish();// 发布数据的方法。
29 void SetData(int32_t seconds, uint32_t nanoseconds, size_t elements, size_t height, size_t width, float* data); // 设置数据,包括时间戳和点云数据。
30 const char* type() const override { return "semantic lidar"; } // 返回发布数据的类型。
31
32 private:
33 void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, std::vector<uint8_t>&& data);// 私有方法,设置数据,包括时间戳和点云数据的另一种形式。
34
35 private:
36 std::shared_ptr<CarlaSemanticLidarPublisherImpl> _impl;// 一个指向内部实现类的智能指针。
37 };
38}
39}
const std::string & parent() const
std::shared_ptr< CarlaSemanticLidarPublisherImpl > _impl
void SetData(int32_t seconds, uint32_t nanoseconds, size_t elements, size_t height, size_t width, float *data)
设置激光雷达数据,包括时间戳、数据尺寸以及浮点数据数组,并对数据进行预处理。
bool Init()
初始化Carla语义激光雷达数据发布者。
CarlaSemanticLidarPublisher(const char *ros_name="", const char *parent="")
CarlaSemanticLidarPublisher类的构造函数。
CarlaSemanticLidarPublisher & operator=(const CarlaSemanticLidarPublisher &)
拷贝赋值运算符重载。
~CarlaSemanticLidarPublisher()
CarlaSemanticLidarPublisher类的析构函数。
CARLA模拟器的主命名空间。
Definition Carla.cpp:139