15 #include <unordered_set> 16 #include <unordered_map> 41 class CarlaTransformPublisher;
42 class CarlaClockPublisher;
43 class CarlaEgoVehicleControlSubscriber;
53 _instance = std::shared_ptr<ROS2>(
new ROS2);
58 void Enable(
bool enable);
61 void SetFrame(uint64_t frame);
62 void SetTimestamp(
double timestamp);
65 void AddActorRosName(
void *actor, std::string ros_name);
66 void AddActorParentRosName(
void *actor,
void* parent);
67 void RemoveActorRosName(
void *actor);
68 void UpdateActorRosName(
void *actor, std::string ros_name);
69 std::string GetActorRosName(
void *actor);
70 std::string GetActorParentRosName(
void *actor);
73 void AddActorCallback(
void* actor, std::string ros_name,
ActorCallback callback);
74 void RemoveActorCallback(
void* actor);
82 void ProcessDataFromCamera(
86 int W,
int H,
float Fov,
88 void *actor =
nullptr);
89 void ProcessDataFromGNSS(
94 void *actor =
nullptr);
95 void ProcessDataFromIMU(
102 void *actor =
nullptr);
103 void ProcessDataFromDVS(
104 uint64_t sensor_type,
108 int W,
int H,
float Fov,
109 void *actor =
nullptr);
110 void ProcessDataFromLidar(
111 uint64_t sensor_type,
115 void *actor =
nullptr);
116 void ProcessDataFromSemanticLidar(
117 uint64_t sensor_type,
121 void *actor =
nullptr);
122 void ProcessDataFromRadar(
123 uint64_t sensor_type,
127 void *actor =
nullptr);
128 void ProcessDataFromObstacleDetection(
129 uint64_t sensor_type,
135 void *actor =
nullptr);
136 void ProcessDataFromCollisionSensor(
137 uint64_t sensor_type,
140 uint32_t other_actor,
150 static std::shared_ptr<ROS2> _instance;
152 bool _enabled {
false };
153 uint64_t _frame { 0 };
154 int32_t _seconds { 0 };
155 uint32_t _nanoseconds { 0 };
160 std::unordered_map<void *, std::shared_ptr<CarlaPublisher>>
_publishers;
161 std::unordered_map<void *, std::shared_ptr<CarlaTransformPublisher>>
_transforms;
std::unordered_map< void *, std::string > _actor_ros_name
std::unordered_map< void *, std::shared_ptr< CarlaPublisher > > _publishers
std::unordered_set< carla::streaming::detail::stream_id_type > _publish_stream
This file contains definitions of common data structures used in traffic manager. ...
std::unordered_map< void *, std::vector< void * > > _actor_parent_ros_name
std::shared_ptr< CarlaEgoVehicleControlSubscriber > _controller
std::shared_ptr< CarlaClockPublisher > _clock_publisher
carla::streaming::detail::stream_id_type stream_id
void EnableStream(carla::streaming::detail::stream_id_type id)
std::function< void(void *actor, ROS2CallbackData data)> ActorCallback
std::unordered_map< void *, std::shared_ptr< CarlaTransformPublisher > > _transforms
std::shared_ptr< BufferView > SharedBufferView
static std::shared_ptr< ROS2 > GetInstance()
std::unordered_map< void *, ActorCallback > _actor_callbacks
bool IsStreamEnabled(carla::streaming::detail::stream_id_type id)