CARLA
 
载入中...
搜索中...
未找到
CarlaLidarPublisher.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// ָʾͷļֻһ
6#pragma once
7// GLIBCXX ʹ C++11 ABI ĺ
8#define _GLIBCXX_USE_CXX11_ABI 0
9
10// ڴ
11#include <memory>
12#include <vector>
13
14// CarlaPublisher Ķ
15#include "CarlaPublisher.h"
16
17namespace carla {
18namespace ros2 {
19
20 // ǰṹ CarlaLidarPublisherImpl
21 struct CarlaLidarPublisherImpl;
22
23 // CarlaLidarPublisher ̳࣬ CarlaPublisher
25 public:
26 // 캯 ROS ƺ͸ΪĬΪַ
27 CarlaLidarPublisher(const char* ros_name = "", const char* parent = "");
28 //
30 // 캯
32 // ֵ
34 // ƶ캯
36 // ƶֵ
38
39 // ʼزֵָʾǷɹ
40 bool Init();
41 // ݵĺزֵָʾǷɹ
42 bool Publish();
43 // ü״ݵĺʱ߶ȡȺָ
44 void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, float* data);
45 // ǻ type() ش
46 const char* type() const override { return "lidar"; }
47
48 private:
49 // ˽ݵĺʱ߶ȡȺ rvalue ÷ʽݵ
50 void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, std::vector<uint8_t>&& data);
51
52 private:
53 // ʹָ CarlaLidarPublisherImpl ʵ
54 std::shared_ptr<CarlaLidarPublisherImpl> _impl;
55 };
56}// namespace ros2
57}// namespace carla
~CarlaLidarPublisher()
CarlaLidarPublisher 类的析构函数
const char * type() const override
bool Publish()
发布激光雷达数据
void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, float *data)
设置激光雷达数据,处理并转换数据类型
bool Init()
初始化CarlaLidarPublisher。
CarlaLidarPublisher & operator=(const CarlaLidarPublisher &)
拷贝赋值运算符重载
std::shared_ptr< CarlaLidarPublisherImpl > _impl
CarlaLidarPublisher(const char *ros_name="", const char *parent="")
CarlaLidarPublisher 类的构造函数
const std::string & parent() const
CARLA模拟器的主命名空间。
Definition Carla.cpp:139