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
const std::string & parent() const
CARLA模拟器的主命�空间。
Definition: Carla.cpp:139