Connects and controls a CARLA Simulator. More...
#include <Simulator.h>
Public Member Functions | |
Constructor | |
Simulator (const std::string &host, uint16_t port, size_t worker_threads=0u, bool enable_garbage_collection=false) | |
Load a new episode | |
EpisodeProxy | ReloadEpisode (bool reset_settings=true) |
EpisodeProxy | LoadEpisode (std::string map_name, bool reset_settings=true, rpc::MapLayer map_layers=rpc::MapLayer::All) |
void | LoadLevelLayer (rpc::MapLayer map_layers) const |
void | UnloadLevelLayer (rpc::MapLayer map_layers) const |
EpisodeProxy | LoadOpenDriveEpisode (std::string opendrive, const rpc::OpendriveGenerationParameters ¶ms, bool reset_settings=true) |
Access to current episode | |
auto | GetCurrentEpisodeId () |
void | GetReadyCurrentEpisode () |
EpisodeProxy | GetCurrentEpisode () |
World snapshot | |
World | GetWorld () |
WorldSnapshot | GetWorldSnapshot () const |
Map related methods | |
SharedPtr< Map > | GetCurrentMap () |
std::vector< std::string > | GetAvailableMaps () |
Required files related methods | |
bool | SetFilesBaseFolder (const std::string &path) |
std::vector< std::string > | GetRequiredFiles (const std::string &folder="", const bool download=true) const |
void | RequestFile (const std::string &name) const |
std::vector< uint8_t > | GetCacheFile (const std::string &name, const bool request_otherwise) const |
Garbage collection policy | |
GarbageCollectionPolicy | GetGarbageCollectionPolicy () const |
Pure networking operations | |
void | SetNetworkingTimeout (time_duration timeout) |
time_duration | GetNetworkingTimeout () |
std::string | GetClientVersion () |
std::string | GetServerVersion () |
Tick | |
WorldSnapshot | WaitForTick (time_duration timeout) |
size_t | RegisterOnTickEvent (std::function< void(WorldSnapshot)> callback) |
void | RemoveOnTickEvent (size_t id) |
uint64_t | Tick (time_duration timeout) |
Access to global objects in the episode | |
std ::string | GetEndpoint () |
bool | IsTrafficManagerRunning (uint16_t port) const |
Query to know if a Traffic Manager is running on port. More... | |
std::pair< std::string, uint16_t > | GetTrafficManagerRunning (uint16_t port) const |
Gets a pair filled with the <IP, port> of the Trafic Manager running on port. More... | |
bool | AddTrafficManagerRunning (std::pair< std::string, uint16_t > trafficManagerInfo) const |
Informs that a Traffic Manager is running on <IP, port> More... | |
void | DestroyTrafficManager (uint16_t port) const |
void | AddPendingException (std::string e) |
SharedPtr< BlueprintLibrary > | GetBlueprintLibrary () |
rpc::VehicleLightStateList | GetVehiclesLightStates () |
Returns a list of pairs where the firts element is the vehicle ID and the second one is the light state. More... | |
SharedPtr< Actor > | GetSpectator () |
rpc::EpisodeSettings | GetEpisodeSettings () |
uint64_t | SetEpisodeSettings (const rpc::EpisodeSettings &settings) |
rpc::WeatherParameters | GetWeatherParameters () |
void | SetWeatherParameters (const rpc::WeatherParameters &weather) |
rpc::VehiclePhysicsControl | GetVehiclePhysicsControl (const Vehicle &vehicle) const |
rpc::VehicleLightState | GetVehicleLightState (const Vehicle &vehicle) const |
std::vector< geom::BoundingBox > | GetLevelBBs (uint8_t queried_tag) const |
Returns all the BBs of all the elements of the level. More... | |
std::vector< rpc::EnvironmentObject > | GetEnvironmentObjects (uint8_t queried_tag) const |
void | EnableEnvironmentObjects (std::vector< uint64_t > env_objects_ids, bool enable) const |
std::pair< bool, rpc::LabelledPoint > | ProjectPoint (geom::Location location, geom::Vector3D direction, float search_distance) const |
std::vector< rpc::LabelledPoint > | CastRay (geom::Location start_location, geom::Location end_location) const |
AI | |
std::shared_ptr< WalkerNavigation > | GetNavigation () |
void | NavigationTick () |
void | RegisterAIController (const WalkerAIController &controller) |
void | UnregisterAIController (const WalkerAIController &controller) |
boost::optional< geom::Location > | GetRandomLocationFromNavigation () |
void | SetPedestriansCrossFactor (float percentage) |
void | SetPedestriansSeed (unsigned int seed) |
General operations with actors | |
boost::optional< rpc::Actor > | GetActorById (ActorId id) const |
std::vector< rpc::Actor > | GetActorsById (const std::vector< ActorId > &actor_ids) const |
std::vector< rpc::Actor > | GetAllTheActorsInTheEpisode () const |
SharedPtr< Actor > | MakeActor (rpc::Actor actor_description, GarbageCollectionPolicy gc=GarbageCollectionPolicy::Disabled) |
Creates an actor instance out of a description of an existing actor. More... | |
SharedPtr< Actor > | SpawnActor (const ActorBlueprint &blueprint, const geom::Transform &transform, Actor *parent=nullptr, rpc::AttachmentType attachment_type=rpc::AttachmentType::Rigid, GarbageCollectionPolicy gc=GarbageCollectionPolicy::Inherit) |
Spawns an actor into the simulation. More... | |
bool | DestroyActor (Actor &actor) |
bool | DestroyActor (ActorId actor_id) |
ActorSnapshot | GetActorSnapshot (ActorId actor_id) const |
ActorSnapshot | GetActorSnapshot (const Actor &actor) const |
rpc::ActorState | GetActorState (const Actor &actor) const |
geom::Location | GetActorLocation (const Actor &actor) const |
geom::Transform | GetActorTransform (const Actor &actor) const |
geom::Vector3D | GetActorVelocity (const Actor &actor) const |
void | SetActorTargetVelocity (const Actor &actor, const geom::Vector3D &vector) |
geom::Vector3D | GetActorAngularVelocity (const Actor &actor) const |
void | SetActorTargetAngularVelocity (const Actor &actor, const geom::Vector3D &vector) |
void | EnableActorConstantVelocity (const Actor &actor, const geom::Vector3D &vector) |
void | DisableActorConstantVelocity (const Actor &actor) |
void | AddActorImpulse (const Actor &actor, const geom::Vector3D &impulse) |
void | AddActorImpulse (const Actor &actor, const geom::Vector3D &impulse, const geom::Vector3D &location) |
void | AddActorForce (const Actor &actor, const geom::Vector3D &force) |
void | AddActorForce (const Actor &actor, const geom::Vector3D &force, const geom::Vector3D &location) |
void | AddActorAngularImpulse (const Actor &actor, const geom::Vector3D &vector) |
void | AddActorTorque (const Actor &actor, const geom::Vector3D &torque) |
geom::Vector3D | GetActorAcceleration (const Actor &actor) const |
void | SetActorLocation (Actor &actor, const geom::Location &location) |
void | SetActorTransform (Actor &actor, const geom::Transform &transform) |
void | SetActorSimulatePhysics (Actor &actor, bool enabled) |
void | SetActorCollisions (Actor &actor, bool enabled) |
void | SetActorCollisions (ActorId actor_id, bool enabled) |
void | SetActorDead (Actor &actor) |
void | SetActorDead (ActorId actor_id) |
void | SetActorEnableGravity (Actor &actor, bool enabled) |
Operations with vehicles | |
void | SetVehicleAutopilot (Vehicle &vehicle, bool enabled=true) |
void | ShowVehicleDebugTelemetry (Vehicle &vehicle, bool enabled=true) |
void | SetLightsToVehicle (Vehicle &vehicle, const rpc::VehicleControl &control) |
void | ApplyControlToVehicle (Vehicle &vehicle, const rpc::VehicleControl &control) |
void | ApplyAckermannControlToVehicle (Vehicle &vehicle, const rpc::VehicleAckermannControl &control) |
rpc::AckermannControllerSettings | GetAckermannControllerSettings (const Vehicle &vehicle) const |
void | ApplyAckermannControllerSettings (Vehicle &vehicle, const rpc::AckermannControllerSettings &settings) |
void | ApplyControlToWalker (Walker &walker, const rpc::WalkerControl &control) |
rpc::WalkerBoneControlOut | GetBonesTransform (Walker &walker) |
void | SetBonesTransform (Walker &walker, const rpc::WalkerBoneControlIn &bones) |
void | BlendPose (Walker &walker, float blend) |
void | GetPoseFromAnimation (Walker &walker) |
void | ApplyPhysicsControlToVehicle (Vehicle &vehicle, const rpc::VehiclePhysicsControl &physicsControl) |
void | SetLightStateToVehicle (Vehicle &vehicle, const rpc::VehicleLightState light_state) |
void | OpenVehicleDoor (Vehicle &vehicle, const rpc::VehicleDoor door_idx) |
void | CloseVehicleDoor (Vehicle &vehicle, const rpc::VehicleDoor door_idx) |
void | SetWheelSteerDirection (Vehicle &vehicle, rpc::VehicleWheelLocation wheel_location, float angle_in_deg) |
float | GetWheelSteerAngle (Vehicle &vehicle, rpc::VehicleWheelLocation wheel_location) |
void | EnableCarSim (Vehicle &vehicle, std::string simfile_path) |
void | UseCarSimRoad (Vehicle &vehicle, bool enabled) |
void | EnableChronoPhysics (Vehicle &vehicle, uint64_t MaxSubsteps, float MaxSubstepDeltaTime, std::string VehicleJSON, std::string PowertrainJSON, std::string TireJSON, std::string BaseJSONPath) |
Operations with the recorder | |
std::string | StartRecorder (std::string name, bool additional_data) |
void | StopRecorder (void) |
std::string | ShowRecorderFileInfo (std::string name, bool show_all) |
std::string | ShowRecorderCollisions (std::string name, char type1, char type2) |
std::string | ShowRecorderActorsBlocked (std::string name, double min_time, double min_distance) |
std::string | ReplayFile (std::string name, double start, double duration, uint32_t follow_id, bool replay_sensors) |
void | SetReplayerTimeFactor (double time_factor) |
void | SetReplayerIgnoreHero (bool ignore_hero) |
void | SetReplayerIgnoreSpectator (bool ignore_spectator) |
void | StopReplayer (bool keep_actors) |
Operations with sensors | |
void | SubscribeToSensor (const Sensor &sensor, std::function< void(SharedPtr< sensor::SensorData >)> callback) |
void | UnSubscribeFromSensor (Actor &sensor) |
void | EnableForROS (const Sensor &sensor) |
void | DisableForROS (const Sensor &sensor) |
bool | IsEnabledForROS (const Sensor &sensor) |
void | SubscribeToGBuffer (Actor &sensor, uint32_t gbuffer_id, std::function< void(SharedPtr< sensor::SensorData >)> callback) |
void | UnSubscribeFromGBuffer (Actor &sensor, uint32_t gbuffer_id) |
Operations with traffic lights | |
void | SetTrafficLightState (TrafficLight &trafficLight, const rpc::TrafficLightState trafficLightState) |
void | SetTrafficLightGreenTime (TrafficLight &trafficLight, float greenTime) |
void | SetTrafficLightYellowTime (TrafficLight &trafficLight, float yellowTime) |
void | SetTrafficLightRedTime (TrafficLight &trafficLight, float redTime) |
void | FreezeTrafficLight (TrafficLight &trafficLight, bool freeze) |
void | ResetTrafficLightGroup (TrafficLight &trafficLight) |
void | ResetAllTrafficLights () |
std::vector< geom::BoundingBox > | GetLightBoxes (const TrafficLight &trafficLight) const |
std::vector< ActorId > | GetGroupTrafficLights (TrafficLight &trafficLight) |
Debug | |
void | DrawDebugShape (const rpc::DebugShape &shape) |
Apply commands in batch | |
void | ApplyBatch (std::vector< rpc::Command > commands, bool do_tick_cue) |
auto | ApplyBatchSync (std::vector< rpc::Command > commands, bool do_tick_cue) |
Operations lights | |
SharedPtr< LightManager > | GetLightManager () const |
std::vector< rpc::LightState > | QueryLightsStateToServer () const |
void | UpdateServerLightsState (std::vector< rpc::LightState > &lights, bool discard_client=false) const |
void | UpdateDayNightCycle (const bool active) const |
size_t | RegisterLightUpdateChangeEvent (std::function< void(WorldSnapshot)> callback) |
void | RemoveLightUpdateChangeEvent (size_t id) |
void | FreezeAllTrafficLights (bool frozen) |
Texture updating operations | |
void | ApplyColorTextureToObjects (const std::vector< std::string > &objects_name, const rpc::MaterialParameter ¶meter, const rpc::TextureColor &Texture) |
– Texture updating operations More... | |
void | ApplyColorTextureToObjects (const std::vector< std::string > &objects_name, const rpc::MaterialParameter ¶meter, const rpc::TextureFloatColor &Texture) |
std::vector< std::string > | GetNamesOfAllObjects () const |
Private Member Functions | |
bool | ShouldUpdateMap (rpc::MapInfo &map_info) |
Private Member Functions inherited from carla::profiler::LifetimeProfiled | |
LifetimeProfiled ()=default | |
Private Member Functions inherited from carla::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable (NonCopyable &&)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable & | operator= (NonCopyable &&)=delete |
Private Attributes | |
SharedPtr< Map > | _cached_map |
Client | _client |
std::shared_ptr< Episode > | _episode |
const GarbageCollectionPolicy | _gc_policy |
SharedPtr< LightManager > | _light_manager |
std::string | _open_drive_file |
Connects and controls a CARLA Simulator.
Definition at line 49 of file Simulator.h.
|
explicit |
Definition at line 72 of file Simulator.cpp.
References carla::client::Disabled, and carla::client::Enabled.
|
inline |
Definition at line 429 of file Simulator.h.
References _client, carla::client::detail::Client::AddActorAngularImpulse(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 421 of file Simulator.h.
References _client, carla::client::detail::Client::AddActorForce(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 425 of file Simulator.h.
References _client, carla::client::detail::Client::AddActorForce(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 413 of file Simulator.h.
References _client, carla::client::detail::Client::AddActorImpulse(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 417 of file Simulator.h.
References _client, carla::client::detail::Client::AddActorImpulse(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 433 of file Simulator.h.
References _client, carla::client::detail::Client::AddActorAngularImpulse(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 236 of file Simulator.h.
References _episode, GetBlueprintLibrary(), GetSpectator(), and GetVehiclesLightStates().
|
inline |
Informs that a Traffic Manager is running on <IP, port>
Definition at line 228 of file Simulator.h.
References _client, and carla::client::detail::Client::AddTrafficManagerRunning().
|
inline |
Definition at line 503 of file Simulator.h.
References _client, carla::client::detail::Client::ApplyAckermannControllerSettings(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 495 of file Simulator.h.
References _client, carla::client::detail::Client::ApplyAckermannControlToVehicle(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 707 of file Simulator.h.
References _client, and carla::client::detail::Client::ApplyBatch().
|
inline |
Definition at line 711 of file Simulator.h.
References _client, and carla::client::detail::Client::ApplyBatchSync().
void carla::client::detail::Simulator::ApplyColorTextureToObjects | ( | const std::vector< std::string > & | objects_name, |
const rpc::MaterialParameter & | parameter, | ||
const rpc::TextureColor & | Texture | ||
) |
– Texture updating operations
Definition at line 446 of file Simulator.cpp.
References _client, and carla::client::detail::Client::ApplyColorTextureToObjects().
Referenced by RemoveLightUpdateChangeEvent().
void carla::client::detail::Simulator::ApplyColorTextureToObjects | ( | const std::vector< std::string > & | objects_name, |
const rpc::MaterialParameter & | parameter, | ||
const rpc::TextureFloatColor & | Texture | ||
) |
Definition at line 453 of file Simulator.cpp.
References _client, and carla::client::detail::Client::ApplyColorTextureToObjects().
|
inline |
Definition at line 491 of file Simulator.h.
References _client, carla::client::detail::Client::ApplyControlToVehicle(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 507 of file Simulator.h.
References _client, carla::client::detail::Client::ApplyControlToWalker(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 527 of file Simulator.h.
References _client, carla::client::detail::Client::ApplyPhysicsControlToVehicle(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 519 of file Simulator.h.
References _client, carla::client::detail::Client::BlendPose(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 290 of file Simulator.h.
References _client, carla::client::detail::Client::CastRay(), GetNavigation(), GetRandomLocationFromNavigation(), NavigationTick(), RegisterAIController(), SetPedestriansCrossFactor(), SetPedestriansSeed(), and UnregisterAIController().
|
inline |
Definition at line 539 of file Simulator.h.
References _client, carla::client::detail::Client::CloseVehicleDoor(), and carla::client::detail::ActorState::GetId().
bool carla::client::detail::Simulator::DestroyActor | ( | Actor & | actor | ) |
Definition at line 375 of file Simulator.cpp.
References _client, carla::client::detail::EpisodeProxyImpl< PointerT >::Clear(), carla::client::detail::Client::DestroyActor(), carla::client::detail::ActorState::GetDisplayId(), carla::client::detail::ActorState::GetEpisode(), carla::client::detail::ActorState::GetId(), and carla::log_debug().
Referenced by MakeActor().
|
inline |
Definition at line 364 of file Simulator.h.
References _client, and carla::client::detail::Client::DestroyActor().
|
inline |
Definition at line 232 of file Simulator.h.
References _client, and carla::client::detail::Client::DestroyTrafficManager().
|
inline |
Definition at line 409 of file Simulator.h.
References _client, carla::client::detail::Client::DisableActorConstantVelocity(), and carla::client::detail::ActorState::GetId().
void carla::client::detail::Simulator::DisableForROS | ( | const Sensor & | sensor | ) |
Definition at line 414 of file Simulator.cpp.
References _client, carla::client::detail::Client::DisableForROS(), carla::client::detail::ActorState::GetActorDescription(), and carla::rpc::Actor::GetStreamToken().
Referenced by StopReplayer().
|
inline |
Definition at line 697 of file Simulator.h.
References _client, and carla::client::detail::Client::DrawDebugShape().
|
inline |
Definition at line 405 of file Simulator.h.
References _client, carla::client::detail::Client::EnableActorConstantVelocity(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 551 of file Simulator.h.
References _client, carla::client::detail::Client::EnableCarSim(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 559 of file Simulator.h.
References _client, carla::client::detail::Client::EnableChronoPhysics(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 279 of file Simulator.h.
References _client, and carla::client::detail::Client::EnableEnvironmentObjects().
void carla::client::detail::Simulator::EnableForROS | ( | const Sensor & | sensor | ) |
Definition at line 410 of file Simulator.cpp.
References _client, carla::client::detail::Client::EnableForROS(), carla::client::detail::ActorState::GetActorDescription(), and carla::rpc::Actor::GetStreamToken().
Referenced by StopReplayer().
void carla::client::detail::Simulator::FreezeAllTrafficLights | ( | bool | frozen | ) |
Definition at line 438 of file Simulator.cpp.
References _client, and carla::client::detail::Client::FreezeAllTrafficLights().
Referenced by RemoveLightUpdateChangeEvent().
|
inline |
Definition at line 671 of file Simulator.h.
References _client, carla::client::detail::Client::FreezeTrafficLight(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 499 of file Simulator.h.
References _client, carla::client::detail::Client::GetAckermannControllerSettings(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 437 of file Simulator.h.
References carla::client::ActorSnapshot::acceleration, and GetActorSnapshot().
|
inline |
Definition at line 398 of file Simulator.h.
References carla::client::ActorSnapshot::angular_velocity, and GetActorSnapshot().
|
inline |
Definition at line 321 of file Simulator.h.
References _episode, and DEBUG_ASSERT.
|
inline |
Definition at line 382 of file Simulator.h.
References GetActorSnapshot(), carla::geom::Transform::location, and carla::client::ActorSnapshot::transform.
|
inline |
Definition at line 326 of file Simulator.h.
References _episode, and DEBUG_ASSERT.
|
inline |
Definition at line 369 of file Simulator.h.
References _episode, and DEBUG_ASSERT.
Referenced by GetActorAcceleration(), GetActorAngularVelocity(), GetActorLocation(), GetActorSnapshot(), GetActorState(), GetActorTransform(), and GetActorVelocity().
|
inline |
Definition at line 374 of file Simulator.h.
References GetActorSnapshot(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 378 of file Simulator.h.
References carla::client::ActorSnapshot::actor_state, and GetActorSnapshot().
|
inline |
Definition at line 386 of file Simulator.h.
References GetActorSnapshot(), and carla::client::ActorSnapshot::transform.
|
inline |
Definition at line 390 of file Simulator.h.
References GetActorSnapshot(), and carla::client::ActorSnapshot::velocity.
|
inline |
Definition at line 331 of file Simulator.h.
References _episode, and DEBUG_ASSERT.
|
inline |
Definition at line 136 of file Simulator.h.
References _client, carla::client::detail::Client::GetAvailableMaps(), GetCacheFile(), GetRequiredFiles(), RequestFile(), and SetFilesBaseFolder().
SharedPtr< BlueprintLibrary > carla::client::detail::Simulator::GetBlueprintLibrary | ( | ) |
Definition at line 242 of file Simulator.cpp.
References _client, and carla::client::detail::Client::GetActorDefinitions().
Referenced by AddPendingException().
|
inline |
Definition at line 511 of file Simulator.h.
References _client, carla::client::detail::Client::GetBonesTransform(), and carla::client::detail::ActorState::GetId().
std::vector< uint8_t > carla::client::detail::Simulator::GetCacheFile | ( | const std::string & | name, |
const bool | request_otherwise | ||
) | const |
Definition at line 200 of file Simulator.cpp.
References _client, and carla::client::detail::Client::GetCacheFile().
Referenced by GetAvailableMaps().
|
inline |
Definition at line 178 of file Simulator.h.
References _client, and carla::client::detail::Client::GetClientVersion().
EpisodeProxy carla::client::detail::Simulator::GetCurrentEpisode | ( | ) |
Definition at line 141 of file Simulator.cpp.
References GetReadyCurrentEpisode().
Referenced by GetCurrentEpisodeId(), GetWorld(), LoadEpisode(), MakeActor(), and SpawnActor().
|
inline |
Definition at line 98 of file Simulator.h.
References _episode, DEBUG_ASSERT, GetCurrentEpisode(), and GetReadyCurrentEpisode().
Definition at line 157 of file Simulator.cpp.
References _cached_map, _client, _episode, _open_drive_file, DEBUG_ASSERT, carla::client::FileTransfer::FileExists(), carla::client::detail::Client::GetMapData(), carla::client::detail::Client::GetMapInfo(), carla::client::detail::Client::GetRequiredFiles(), carla::rpc::MapInfo::name, and reverse().
Referenced by GetWorldSnapshot().
|
inline |
Definition at line 212 of file Simulator.h.
References _client, and carla::client::detail::Client::GetEndpoint().
|
inline |
Definition at line 275 of file Simulator.h.
References _client, and carla::client::detail::Client::GetEnvironmentObjects().
|
inline |
Definition at line 248 of file Simulator.h.
References _client, carla::client::detail::Client::GetEpisodeSettings(), and SetEpisodeSettings().
Referenced by GetReadyCurrentEpisode().
|
inline |
Definition at line 160 of file Simulator.h.
References _gc_policy.
|
inline |
Definition at line 687 of file Simulator.h.
References _client, carla::client::detail::Client::GetGroupTrafficLights(), and carla::client::detail::ActorState::GetId().
|
inline |
Returns all the BBs of all the elements of the level.
Definition at line 271 of file Simulator.h.
References _client, and carla::client::detail::Client::GetLevelBBs().
|
inline |
Definition at line 683 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::GetLightBoxes().
|
inline |
Definition at line 721 of file Simulator.h.
References _light_manager.
std::vector< std::string > carla::client::detail::Simulator::GetNamesOfAllObjects | ( | ) | const |
Definition at line 460 of file Simulator.cpp.
References _client, and carla::client::detail::Client::GetNamesOfAllObjects().
Referenced by RemoveLightUpdateChangeEvent().
std::shared_ptr< WalkerNavigation > carla::client::detail::Simulator::GetNavigation | ( | ) |
Definition at line 288 of file Simulator.cpp.
References _episode, and DEBUG_ASSERT.
Referenced by CastRay().
|
inline |
Definition at line 174 of file Simulator.h.
References _client, and carla::client::detail::Client::GetTimeout().
|
inline |
Definition at line 523 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::GetPoseFromAnimation().
boost::optional< geom::Location > carla::client::detail::Simulator::GetRandomLocationFromNavigation | ( | ) |
Definition at line 323 of file Simulator.cpp.
References _episode, and DEBUG_ASSERT.
Referenced by CastRay().
void carla::client::detail::Simulator::GetReadyCurrentEpisode | ( | ) |
Definition at line 130 of file Simulator.cpp.
References _client, _episode, _light_manager, GetEpisodeSettings(), carla::client::detail::ValidateVersions(), and WaitForTick().
Referenced by GetCurrentEpisode(), and GetCurrentEpisodeId().
std::vector< std::string > carla::client::detail::Simulator::GetRequiredFiles | ( | const std::string & | folder = "" , |
const bool | download = true |
||
) | const |
Definition at line 192 of file Simulator.cpp.
References _client, and carla::client::detail::Client::GetRequiredFiles().
Referenced by GetAvailableMaps().
|
inline |
Definition at line 182 of file Simulator.h.
References _client, carla::client::detail::Client::GetServerVersion(), and WaitForTick().
Definition at line 251 of file Simulator.cpp.
References _client, carla::client::detail::Client::GetSpectator(), and MakeActor().
Referenced by AddPendingException().
|
inline |
Gets a pair filled with the <IP, port> of the Trafic Manager running on port.
If there is no Traffic Manager running the pair will be ("", 0)
Definition at line 223 of file Simulator.h.
References _client, and carla::client::detail::Client::GetTrafficManagerRunning().
|
inline |
Definition at line 266 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::GetVehicleLightState().
|
inline |
Definition at line 262 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::GetVehiclePhysicsControl().
rpc::VehicleLightStateList carla::client::detail::Simulator::GetVehiclesLightStates | ( | ) |
Returns a list of pairs where the firts element is the vehicle ID and the second one is the light state.
Definition at line 247 of file Simulator.cpp.
References _client, and carla::client::detail::Client::GetVehiclesLightStates().
Referenced by AddPendingException().
|
inline |
Definition at line 254 of file Simulator.h.
References _client, and carla::client::detail::Client::GetWeatherParameters().
|
inline |
Definition at line 547 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::GetWheelSteerAngle().
|
inline |
Definition at line 113 of file Simulator.h.
References GetCurrentEpisode().
|
inline |
Definition at line 123 of file Simulator.h.
References _episode, DEBUG_ASSERT, and GetCurrentMap().
bool carla::client::detail::Simulator::IsEnabledForROS | ( | const Sensor & | sensor | ) |
Definition at line 418 of file Simulator.cpp.
References _client, carla::client::detail::ActorState::GetActorDescription(), carla::rpc::Actor::GetStreamToken(), and carla::client::detail::Client::IsEnabledForROS().
Referenced by StopReplayer().
|
inline |
Query to know if a Traffic Manager is running on port.
Definition at line 217 of file Simulator.h.
References _client, and carla::client::detail::Client::IsTrafficManagerRunning().
EpisodeProxy carla::client::detail::Simulator::LoadEpisode | ( | std::string | map_name, |
bool | reset_settings = true , |
||
rpc::MapLayer | map_layers = rpc::MapLayer::All |
||
) |
Definition at line 87 of file Simulator.cpp.
References _client, _episode, GetCurrentEpisode(), carla::client::detail::Client::GetEpisodeSettings(), carla::client::detail::EpisodeProxyImpl< PointerT >::GetId(), carla::client::detail::Client::GetTimeout(), carla::client::detail::Client::LoadEpisode(), carla::time_duration::milliseconds(), carla::client::detail::Client::SendTickCue(), carla::rpc::EpisodeSettings::synchronous_mode, and carla::throw_exception().
Referenced by LoadOpenDriveEpisode(), and ReloadEpisode().
|
inline |
Definition at line 78 of file Simulator.h.
References _client, and carla::client::detail::Client::LoadLevelLayer().
EpisodeProxy carla::client::detail::Simulator::LoadOpenDriveEpisode | ( | std::string | opendrive, |
const rpc::OpendriveGenerationParameters & | params, | ||
bool | reset_settings = true |
||
) |
Definition at line 115 of file Simulator.cpp.
References _client, carla::client::detail::Client::CopyOpenDriveToServer(), and LoadEpisode().
Referenced by UnloadLevelLayer().
|
inline |
Creates an actor instance out of a description of an existing actor.
Note that this does not spawn an actor.
If gc is GarbageCollectionPolicy::Enabled, the shared pointer returned is provided with a custom deleter that calls Destroy() on the actor. This method does not support GarbageCollectionPolicy::Inherit.
Definition at line 342 of file Simulator.h.
References DestroyActor(), GetCurrentEpisode(), carla::client::Inherit, carla::client::detail::ActorFactory::MakeActor(), RELEASE_ASSERT, carla::rpc::Rigid, and SpawnActor().
Referenced by GetSpectator().
void carla::client::detail::Simulator::NavigationTick | ( | ) |
Definition at line 295 of file Simulator.cpp.
References _episode, and DEBUG_ASSERT.
Referenced by CastRay(), Tick(), and WaitForTick().
|
inline |
Definition at line 535 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::OpenVehicleDoor().
|
inline |
Definition at line 285 of file Simulator.h.
References _client, and carla::client::detail::Client::ProjectPoint().
|
inline |
Definition at line 725 of file Simulator.h.
References _client, and carla::client::detail::Client::QueryLightsStateToServer().
void carla::client::detail::Simulator::RegisterAIController | ( | const WalkerAIController & | controller | ) |
Definition at line 301 of file Simulator.cpp.
References _episode, DEBUG_ASSERT, carla::client::detail::ActorState::GetDisplayId(), carla::client::detail::ActorState::GetId(), carla::client::detail::ActorState::GetParent(), and carla::throw_exception().
Referenced by CastRay().
|
inline |
Definition at line 739 of file Simulator.h.
References _episode, and DEBUG_ASSERT.
|
inline |
Definition at line 194 of file Simulator.h.
References _episode, and DEBUG_ASSERT.
|
inline |
Definition at line 72 of file Simulator.h.
References carla::rpc::All, and LoadEpisode().
|
inline |
Definition at line 744 of file Simulator.h.
References _episode, ApplyColorTextureToObjects(), DEBUG_ASSERT, FreezeAllTrafficLights(), GetNamesOfAllObjects(), and ShouldUpdateMap().
|
inline |
Definition at line 199 of file Simulator.h.
References _episode, DEBUG_ASSERT, and Tick().
|
inline |
Definition at line 601 of file Simulator.h.
References _client, and carla::client::detail::Client::ReplayFile().
void carla::client::detail::Simulator::RequestFile | ( | const std::string & | name | ) | const |
Definition at line 196 of file Simulator.cpp.
References _client, and carla::client::detail::Client::RequestFile().
Referenced by GetAvailableMaps().
|
inline |
Definition at line 679 of file Simulator.h.
References _client, and carla::client::detail::Client::ResetAllTrafficLights().
|
inline |
Definition at line 675 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::ResetTrafficLightGroup().
|
inline |
Definition at line 453 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorCollisions().
|
inline |
Definition at line 457 of file Simulator.h.
References _client, and carla::client::detail::Client::SetActorCollisions().
|
inline |
Definition at line 461 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorDead().
|
inline |
Definition at line 465 of file Simulator.h.
References _client, and carla::client::detail::Client::SetActorDead().
|
inline |
Definition at line 469 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorEnableGravity().
|
inline |
Definition at line 441 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorLocation().
|
inline |
Definition at line 449 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorSimulatePhysics().
|
inline |
Definition at line 402 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorTargetAngularVelocity().
|
inline |
Definition at line 394 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorTargetVelocity().
|
inline |
Definition at line 445 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorTransform().
|
inline |
Definition at line 515 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetBonesTransform().
uint64_t carla::client::detail::Simulator::SetEpisodeSettings | ( | const rpc::EpisodeSettings & | settings | ) |
Definition at line 255 of file Simulator.cpp.
References _client, _episode, carla::rpc::EpisodeSettings::fixed_delta_seconds, carla::log_warning(), carla::rpc::EpisodeSettings::max_substep_delta_time, carla::rpc::EpisodeSettings::max_substeps, carla::client::detail::Client::SetEpisodeSettings(), carla::rpc::EpisodeSettings::substepping, carla::client::detail::SynchronizeFrame(), and carla::rpc::EpisodeSettings::synchronous_mode.
Referenced by GetEpisodeSettings().
bool carla::client::detail::Simulator::SetFilesBaseFolder | ( | const std::string & | path | ) |
Definition at line 188 of file Simulator.cpp.
References _client, and carla::client::detail::Client::SetFilesBaseFolder().
Referenced by GetAvailableMaps().
|
inline |
Definition at line 531 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetLightStateToVehicle().
|
inline |
Definition at line 487 of file Simulator.h.
References _client, carla::client::detail::Client::ApplyControlToVehicle(), and carla::client::detail::ActorState::GetId().
|
inline |
Definition at line 170 of file Simulator.h.
References _client, and carla::client::detail::Client::SetTimeout().
void carla::client::detail::Simulator::SetPedestriansCrossFactor | ( | float | percentage | ) |
Definition at line 329 of file Simulator.cpp.
References _episode, and DEBUG_ASSERT.
Referenced by CastRay().
void carla::client::detail::Simulator::SetPedestriansSeed | ( | unsigned int | seed | ) |
Definition at line 335 of file Simulator.cpp.
References _episode, and DEBUG_ASSERT.
Referenced by CastRay().
|
inline |
Definition at line 610 of file Simulator.h.
References _client, and carla::client::detail::Client::SetReplayerIgnoreHero().
|
inline |
Definition at line 614 of file Simulator.h.
References _client, and carla::client::detail::Client::SetReplayerIgnoreSpectator().
|
inline |
Definition at line 606 of file Simulator.h.
References _client, and carla::client::detail::Client::SetReplayerTimeFactor().
|
inline |
Definition at line 659 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetTrafficLightGreenTime().
|
inline |
Definition at line 667 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetTrafficLightRedTime().
|
inline |
Definition at line 655 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetTrafficLightState().
|
inline |
Definition at line 663 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetTrafficLightYellowTime().
|
inline |
Definition at line 479 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetActorAutopilot().
|
inline |
Definition at line 258 of file Simulator.h.
References _client, and carla::client::detail::Client::SetWeatherParameters().
|
inline |
Definition at line 543 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SetWheelSteerDirection().
|
private |
Definition at line 146 of file Simulator.cpp.
References _cached_map, _open_drive_file, and carla::rpc::MapInfo::name.
Referenced by RemoveLightUpdateChangeEvent().
|
inline |
Definition at line 597 of file Simulator.h.
References _client, and carla::client::detail::Client::ShowRecorderActorsBlocked().
|
inline |
Definition at line 593 of file Simulator.h.
References _client, and carla::client::detail::Client::ShowRecorderCollisions().
|
inline |
Definition at line 589 of file Simulator.h.
References _client, and carla::client::detail::Client::ShowRecorderFileInfo().
|
inline |
Definition at line 483 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::ShowVehicleDebugTelemetry().
SharedPtr< Actor > carla::client::detail::Simulator::SpawnActor | ( | const ActorBlueprint & | blueprint, |
const geom::Transform & | transform, | ||
Actor * | parent = nullptr , |
||
rpc::AttachmentType | attachment_type = rpc::AttachmentType::Rigid , |
||
GarbageCollectionPolicy | gc = GarbageCollectionPolicy::Inherit |
||
) |
Spawns an actor into the simulation.
If gc is GarbageCollectionPolicy::Enabled, the shared pointer returned is provided with a custom deleter that calls Destroy() on the actor. If is GarbageCollectionPolicy::Inherit, the default garbage collection policy is used.
Definition at line 345 of file Simulator.cpp.
References _client, _episode, _gc_policy, DEBUG_ASSERT, carla::client::Enabled, GetCurrentEpisode(), carla::client::detail::ActorState::GetId(), carla::client::Inherit, carla::log_debug(), carla::client::detail::ActorFactory::MakeActor(), carla::client::ActorBlueprint::MakeActorDescription(), carla::client::detail::Client::SpawnActor(), and carla::client::detail::Client::SpawnActorWithParent().
Referenced by MakeActor().
|
inline |
Definition at line 581 of file Simulator.h.
References _client, and carla::client::detail::Client::StartRecorder().
|
inline |
Definition at line 585 of file Simulator.h.
References _client, and carla::client::detail::Client::StopRecorder().
|
inline |
Definition at line 618 of file Simulator.h.
References _client, DisableForROS(), EnableForROS(), IsEnabledForROS(), carla::client::detail::Client::StopReplayer(), SubscribeToGBuffer(), SubscribeToSensor(), UnSubscribeFromGBuffer(), and UnSubscribeFromSensor().
void carla::client::detail::Simulator::SubscribeToGBuffer | ( | Actor & | sensor, |
uint32_t | gbuffer_id, | ||
std::function< void(SharedPtr< sensor::SensorData >)> | callback | ||
) |
Definition at line 422 of file Simulator.cpp.
References _client, carla::sensor::Deserializer::Deserialize(), carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::SubscribeToGBuffer().
Referenced by StopReplayer().
void carla::client::detail::Simulator::SubscribeToSensor | ( | const Sensor & | sensor, |
std::function< void(SharedPtr< sensor::SensorData >)> | callback | ||
) |
Definition at line 392 of file Simulator.cpp.
References _client, _episode, DEBUG_ASSERT, carla::sensor::Deserializer::Deserialize(), carla::client::detail::ActorState::GetActorDescription(), carla::rpc::Actor::GetStreamToken(), and carla::client::detail::Client::SubscribeToStream().
Referenced by StopReplayer().
uint64_t carla::client::detail::Simulator::Tick | ( | time_duration | timeout | ) |
Definition at line 221 of file Simulator.cpp.
References _client, _episode, DEBUG_ASSERT, carla::client::detail::Client::GetEndpoint(), NavigationTick(), carla::client::detail::Client::SendTickCue(), carla::client::detail::SynchronizeFrame(), and carla::throw_exception().
Referenced by RemoveOnTickEvent().
|
inline |
Definition at line 82 of file Simulator.h.
References _client, LoadOpenDriveEpisode(), and carla::client::detail::Client::UnloadLevelLayer().
void carla::client::detail::Simulator::UnregisterAIController | ( | const WalkerAIController & | controller | ) |
Definition at line 312 of file Simulator.cpp.
References _episode, DEBUG_ASSERT, carla::client::detail::ActorState::GetDisplayId(), carla::client::detail::ActorState::GetId(), carla::client::detail::ActorState::GetParent(), and carla::throw_exception().
Referenced by CastRay().
void carla::client::detail::Simulator::UnSubscribeFromGBuffer | ( | Actor & | sensor, |
uint32_t | gbuffer_id | ||
) |
Definition at line 434 of file Simulator.cpp.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::UnSubscribeFromGBuffer().
Referenced by StopReplayer().
void carla::client::detail::Simulator::UnSubscribeFromSensor | ( | Actor & | sensor | ) |
Definition at line 405 of file Simulator.cpp.
References _client, carla::client::detail::ActorState::GetActorDescription(), carla::rpc::Actor::GetStreamToken(), and carla::client::detail::Client::UnSubscribeFromStream().
Referenced by StopReplayer().
|
inline |
Definition at line 735 of file Simulator.h.
References _client, and carla::client::detail::Client::UpdateDayNightCycle().
|
inline |
Definition at line 729 of file Simulator.h.
References _client, and carla::client::detail::Client::UpdateServerLightsState().
|
inline |
Definition at line 555 of file Simulator.h.
References _client, carla::client::detail::ActorState::GetId(), and carla::client::detail::Client::UseCarSimRoad().
WorldSnapshot carla::client::detail::Simulator::WaitForTick | ( | time_duration | timeout | ) |
Definition at line 208 of file Simulator.cpp.
References _client, _episode, DEBUG_ASSERT, carla::client::detail::Client::GetEndpoint(), NavigationTick(), and carla::throw_exception().
Referenced by GetReadyCurrentEpisode(), and GetServerVersion().
Definition at line 783 of file Simulator.h.
Referenced by GetCurrentMap(), and ShouldUpdateMap().
|
private |
Definition at line 775 of file Simulator.h.
Referenced by AddActorAngularImpulse(), AddActorForce(), AddActorImpulse(), AddActorTorque(), AddTrafficManagerRunning(), ApplyAckermannControllerSettings(), ApplyAckermannControlToVehicle(), ApplyBatch(), ApplyBatchSync(), ApplyColorTextureToObjects(), ApplyControlToVehicle(), ApplyControlToWalker(), ApplyPhysicsControlToVehicle(), BlendPose(), CastRay(), CloseVehicleDoor(), DestroyActor(), DestroyTrafficManager(), DisableActorConstantVelocity(), DisableForROS(), DrawDebugShape(), EnableActorConstantVelocity(), EnableCarSim(), EnableChronoPhysics(), EnableEnvironmentObjects(), EnableForROS(), FreezeAllTrafficLights(), FreezeTrafficLight(), GetAckermannControllerSettings(), GetAvailableMaps(), GetBlueprintLibrary(), GetBonesTransform(), GetCacheFile(), GetClientVersion(), GetCurrentMap(), GetEndpoint(), GetEnvironmentObjects(), GetEpisodeSettings(), GetGroupTrafficLights(), GetLevelBBs(), GetLightBoxes(), GetNamesOfAllObjects(), GetNetworkingTimeout(), GetPoseFromAnimation(), GetReadyCurrentEpisode(), GetRequiredFiles(), GetServerVersion(), GetSpectator(), GetTrafficManagerRunning(), GetVehicleLightState(), GetVehiclePhysicsControl(), GetVehiclesLightStates(), GetWeatherParameters(), GetWheelSteerAngle(), IsEnabledForROS(), IsTrafficManagerRunning(), LoadEpisode(), LoadLevelLayer(), LoadOpenDriveEpisode(), OpenVehicleDoor(), ProjectPoint(), QueryLightsStateToServer(), ReplayFile(), RequestFile(), ResetAllTrafficLights(), ResetTrafficLightGroup(), SetActorCollisions(), SetActorDead(), SetActorEnableGravity(), SetActorLocation(), SetActorSimulatePhysics(), SetActorTargetAngularVelocity(), SetActorTargetVelocity(), SetActorTransform(), SetBonesTransform(), SetEpisodeSettings(), SetFilesBaseFolder(), SetLightStateToVehicle(), SetLightsToVehicle(), SetNetworkingTimeout(), SetReplayerIgnoreHero(), SetReplayerIgnoreSpectator(), SetReplayerTimeFactor(), SetTrafficLightGreenTime(), SetTrafficLightRedTime(), SetTrafficLightState(), SetTrafficLightYellowTime(), SetVehicleAutopilot(), SetWeatherParameters(), SetWheelSteerDirection(), ShowRecorderActorsBlocked(), ShowRecorderCollisions(), ShowRecorderFileInfo(), ShowVehicleDebugTelemetry(), SpawnActor(), StartRecorder(), StopRecorder(), StopReplayer(), SubscribeToGBuffer(), SubscribeToSensor(), Tick(), UnloadLevelLayer(), UnSubscribeFromGBuffer(), UnSubscribeFromSensor(), UpdateDayNightCycle(), UpdateServerLightsState(), UseCarSimRoad(), and WaitForTick().
|
private |
Definition at line 779 of file Simulator.h.
Referenced by AddPendingException(), GetActorById(), GetActorsById(), GetActorSnapshot(), GetAllTheActorsInTheEpisode(), GetCurrentEpisodeId(), GetCurrentMap(), GetNavigation(), GetRandomLocationFromNavigation(), GetReadyCurrentEpisode(), GetWorldSnapshot(), LoadEpisode(), NavigationTick(), RegisterAIController(), RegisterLightUpdateChangeEvent(), RegisterOnTickEvent(), RemoveLightUpdateChangeEvent(), RemoveOnTickEvent(), SetEpisodeSettings(), SetPedestriansCrossFactor(), SetPedestriansSeed(), SpawnActor(), SubscribeToSensor(), Tick(), UnregisterAIController(), and WaitForTick().
|
private |
Definition at line 781 of file Simulator.h.
Referenced by GetGarbageCollectionPolicy(), and SpawnActor().
|
private |
Definition at line 777 of file Simulator.h.
Referenced by GetLightManager(), and GetReadyCurrentEpisode().
|
private |
Definition at line 785 of file Simulator.h.
Referenced by GetCurrentMap(), and ShouldUpdateMap().