25 #include <rpc/config.h> 26 #include <rpc/rpc_error.h> 38 if ((ptr !=
nullptr) && ptr->IsAlive()) {
42 }
catch (const ::rpc::timeout &timeout) {
45 "timeout while trying to garbage collect Actor",
47 "actor hasn't been removed from the simulation");
48 }
catch (
const std::exception &e) {
50 "exception thrown while trying to garbage collect Actor",
56 "unknown exception thrown while trying to garbage collect an Actor :",
64 template <
typename ActorT>
78 if (description.
description.
id ==
"sensor.other.lane_invasion") {
79 return MakeActorImpl<LaneInvasionSensor>(std::move(init), gc);
81 }
else if (description.
description.
id ==
"sensor.other.rss") {
82 return MakeActorImpl<RssSensor>(std::move(init), gc);
85 return MakeActorImpl<ServerSideSensor>(std::move(init), gc);
87 return MakeActorImpl<Vehicle>(std::move(init), gc);
89 return MakeActorImpl<Walker>(std::move(init), gc);
91 return MakeActorImpl<TrafficLight>(std::move(init), gc);
93 return MakeActorImpl<TrafficSign>(std::move(init), gc);
94 }
else if (description.
description.
id ==
"controller.ai.walker") {
95 return MakeActorImpl<WalkerAIController>(std::move(init), gc);
97 return MakeActorImpl<Actor>(std::move(init), gc);
void operator()(::carla::client::Actor *ptr) const noexcept
static void log_error(Args &&... args)
static SharedPtr< Actor > MakeActor(EpisodeProxy episode, rpc::Actor actor_description, GarbageCollectionPolicy garbage_collection_policy)
Create an Actor based on the provided actor_description.
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
This file contains definitions of common data structures used in traffic manager. ...
ActorDescription description
Used to initialize Actor classes.
#define DEBUG_ASSERT(predicate)
static auto MakeActorImpl(ActorInitializer init, GarbageCollectionPolicy gc)
static void log_critical(Args &&... args)
Represents an actor in the simulation.
static bool StartsWith(const Range1T &input, const Range2T &test)