CARLA
CarlaNormalsCameraPublisher.h
Go to the documentation of this file.
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 
13 namespace carla {
14 namespace ros2 {
15 
16  struct CarlaNormalsCameraPublisherImpl;
17  struct CarlaCameraInfoPublisherImpl;
18 
20  public:
21  CarlaNormalsCameraPublisher(const char* ros_name = "", const char* parent = "");
27 
28  bool Init();
29  void InitInfoData(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify);
30  bool Publish();
31 
32  bool HasBeenInitialized() const;
33  void SetImageData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, const uint8_t* data);
34  void SetCameraInfoData(int32_t seconds, uint32_t nanoseconds);
35 
36  const char* type() const override { return "normals camera"; }
37 
38  private:
39  bool InitImage();
40  bool InitInfo();
41  bool PublishImage();
42  bool PublishInfo();
43 
44  void SetInfoRegionOfInterest( uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, bool do_rectify);
45  void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, std::vector<uint8_t>&& data);
46 
47  private:
48  std::shared_ptr<CarlaNormalsCameraPublisherImpl> _impl;
49  std::shared_ptr<CarlaCameraInfoPublisherImpl> _impl_info;
50  };
51 }
52 }
std::shared_ptr< CarlaNormalsCameraPublisherImpl > _impl
void SetImageData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, const uint8_t *data)
CarlaNormalsCameraPublisher & operator=(const CarlaNormalsCameraPublisher &)
void SetInfoRegionOfInterest(uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, bool do_rectify)
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
CarlaNormalsCameraPublisher(const char *ros_name="", const char *parent="")
void SetData(int32_t seconds, uint32_t nanoseconds, size_t height, size_t width, std::vector< uint8_t > &&data)
std::shared_ptr< CarlaCameraInfoPublisherImpl > _impl_info
const std::string & parent() const
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)