CARLA
Loading...
Searching...
No Matches
ObstacleDetectionEvent.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9#include "carla/Debug.h"
13
14
15namespace carla {
16namespace sensor {
17namespace data {
18
19 /// A registered detection.
22 protected:
23
25
26 friend Serializer;
27
29 : Super(data),
30 _self_actor(nullptr),
31 _other_actor(nullptr) {
33 _self_actor = std::move(ddata.self_actor);
34 _other_actor = std::move(ddata.other_actor);
35 _distance = ddata.distance;
36 }
37
38 public:
39
40 /// Get "self" actor. Actor that measured the collision.
44
45 /// Get the actor to which we collided.
49
50 /// Get obstacle distance.
51 float GetDistance() const {
52 return _distance;
53 }
54
55 private:
56
58
60
61 float _distance;
62 };
63
64} // namespace data
65} // namespace sensor
66} // namespace carla
Holds an Actor, but only instantiates it when needed.
SharedPtr< client::Actor > Get(EpisodeProxy episode) const
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
const auto & GetEpisode() const
Definition SensorData.h:54
SensorData(size_t frame, double timestamp, const rpc::Transform &sensor_transform)
Definition SensorData.h:25
s11n::ObstacleDetectionEventSerializer Serializer
SharedPtr< client::Actor > GetActor() const
Get "self" actor. Actor that measured the collision.
SharedPtr< client::Actor > GetOtherActor() const
Get the actor to which we collided.
float GetDistance() const
Get obstacle distance.
Serializes the current state of the whole episode.
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr
Definition Memory.h:15