CARLA
 
载入中...
搜索中...
未找到
LaneInvasionEvent.cpp
浏览该文件的文档.
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
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.
Definition Carla.cpp:133
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