CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
sensor
data
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
7
#include "
carla/sensor/data/LaneInvasionEvent.h
"
8
9
#include "
carla/Exception.h
"
10
#include "
carla/client/detail/Simulator.h
"
11
12
namespace
carla
{
13
namespace
sensor {
14
namespace
data {
15
16
SharedPtr<client::Actor>
LaneInvasionEvent::GetActor
()
const
{
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
Exception.h
LaneInvasionEvent.h
Simulator.h
carla::sensor::SensorData::GetEpisode
const auto & GetEpisode() const
Definition
SensorData.h:54
carla::sensor::data::LaneInvasionEvent::GetActor
SharedPtr< client::Actor > GetActor() const
Get "self" actor. Actor that invaded another lane.
Definition
LaneInvasionEvent.cpp:16
carla::sensor::data::LaneInvasionEvent::_parent
ActorId _parent
Definition
LaneInvasionEvent.h:47
carla
This file contains definitions of common data structures used in traffic manager.
Definition
Carla.cpp:133
carla::throw_exception
void throw_exception(const std::exception &e)
Definition
Carla.cpp:135
carla::SharedPtr
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
制作者
1.10.0