CARLA
Loading...
Searching...
No Matches
LaneInvasionEvent.cpp
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
8
9#include "carla/Exception.h"
11
12namespace carla {
13namespace sensor {
14namespace data {
15
17 auto episode = GetEpisode().Lock();
18 auto description = episode->GetActorById(_parent);
19 if (!description.has_value()) {
20 throw_exception(std::runtime_error("LaneInvasionEvent: parent already dead"));
21 }
22 return episode->MakeActor(*description);
23 }
24
25} // namespace data
26} // namespace sensor
27} // namespace carla
const auto & GetEpisode() const
Definition SensorData.h:54
SharedPtr< client::Actor > GetActor() const
Get "self" actor. Actor that invaded another lane.
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr
Definition Memory.h:15
void throw_exception(const ExceptionT &e)
Templated on the static type so the thrown object keeps its dynamic type: taking a const std::excepti...
Definition Exception.h:44