CARLA
 
载入中...
搜索中...
未找到
CarlaDVSCameraPublisher.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
7
8#include <memory>
9#include <vector>
10
11#include "CarlaPublisher.h"
12
13namespace carla {
14namespace ros2 {
15
16 struct CarlaDVSCameraPublisherImpl;
17 struct CarlaCameraInfoPublisherImpl;
18 struct CarlaPointCloudPublisherImpl;
19
21 public:
22 CarlaDVSCameraPublisher(const char* ros_name = "", const char* parent = "");
28
29 bool Init();
30 void InitInfoData(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify);
31 bool Publish();
32
33 bool HasBeenInitialized() const;
34 void SetImageData(int32_t seconds, uint32_t nanoseconds, size_t elements, size_t height, size_t width, const uint8_t* data);
35 void SetCameraInfoData(int32_t seconds, uint32_t nanoseconds);
36 void SetPointCloudData(size_t height, size_t width, size_t elements, const uint8_t* data);
37 const char* type() const override { return "dvs camera"; }
38
39 private:
40 private:
41 bool InitImage();
42 bool InitInfo();
43 bool InitPointCloud();
44
45 void SetInfoRegionOfInterest( uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, bool do_rectify);
46 void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, std::vector<uint8_t>&& data);
47 void SetPointCloudData(size_t height, size_t width, std::vector<uint8_t>&& data);
48 bool PublishImage();
49 bool PublishInfo();
50 bool PublishPointCloud();
51
52 private:
53 std::shared_ptr<CarlaDVSCameraPublisherImpl> _impl;
54 std::shared_ptr<CarlaCameraInfoPublisherImpl> _info;
55 std::shared_ptr<CarlaPointCloudPublisherImpl> _point_cloud;
56 };
57}
58}
void SetPointCloudData(size_t height, size_t width, size_t elements, const uint8_t *data)
CarlaDVSCameraPublisher & operator=(const CarlaDVSCameraPublisher &)
CarlaDVSCameraPublisher(const char *ros_name="", const char *parent="")
std::shared_ptr< CarlaCameraInfoPublisherImpl > _info
std::shared_ptr< CarlaDVSCameraPublisherImpl > _impl
void SetImageData(int32_t seconds, uint32_t nanoseconds, size_t elements, size_t height, size_t width, const uint8_t *data)
void InitInfoData(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify)
void SetCameraInfoData(int32_t seconds, uint32_t nanoseconds)
void SetPointCloudData(size_t height, size_t width, std::vector< uint8_t > &&data)
void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, std::vector< uint8_t > &&data)
void SetInfoRegionOfInterest(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, bool do_rectify)
std::shared_ptr< CarlaPointCloudPublisherImpl > _point_cloud
const std::string & parent() const
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133