CARLA
LaneInvasionEvent.cpp
Go to the documentation of this file.
1 // Copyright (c) 2019 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 
12 namespace carla {
13 namespace sensor {
14 namespace 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
void throw_exception(const std::exception &e)
Definition: Carla.cpp:135
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
Definition: Memory.h:20
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
const auto & GetEpisode() const
Definition: SensorData.h:54
SharedPtr< client::Actor > GetActor() const
Get "self" actor. Actor that invaded another lane.