|
CARLA
|
The function of this class is to integrate all the various stages of the traffic manager appropriately using messengers. More...
#include <TrafficManagerRemote.h>
Inheritance diagram for carla::traffic_manager::TrafficManagerRemote:Public Member Functions | |
| ActionBuffer | GetActionBuffer (const ActorId &actor_id) |
| Method to get the vehicle's action buffer. | |
| carla::client::detail::EpisodeProxy & | GetEpisodeProxy () |
| Get CARLA episode information. | |
| Action | GetNextAction (const ActorId &actor_id) |
| Method to get the vehicle's next action. | |
| void | HealthCheckRemoteTM () |
| Method to check server is alive or not. | |
| void | RegisterVehicles (const std::vector< ActorPtr > &actor_list) |
| This method registers a vehicle with the traffic manager. | |
| void | Release () |
| To release the traffic manager. | |
| void | RemoveImportedRoute (const ActorId &actor_id, const bool remove_path) |
| Method to remove a route. | |
| void | RemoveUploadPath (const ActorId &actor_id, const bool remove_path) |
| Method to remove a path. | |
| void | Reset (uint64_t episode_id) |
| To reset the traffic manager for the episode episode_id. | |
| void | SetAutoLaneChange (const ActorPtr &actor, const bool enable) |
| Enable/disable automatic lane change on a vehicle. | |
| void | SetBoundariesRespawnDormantVehicles (const float lower_bound, const float upper_bound) |
| Method to set boundaries for respawning vehicles. | |
| void | SetCollisionDetection (const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision) |
| Method to set collision detection rules between vehicles. | |
| void | SetCustomPath (const ActorPtr &actor, const Path path, const bool empty_buffer) |
| Method to set our own imported path. | |
| void | SetDesiredSpeed (const ActorPtr &actor, const float value) |
| Set a vehicle's exact desired velocity. | |
| void | SetDistanceToLeadingVehicle (const ActorPtr &actor, const float distance) |
| Method to specify how much distance a vehicle should maintain to the leading vehicle. | |
| void | SetForceLaneChange (const ActorPtr &actor, const bool direction) |
| Method to force lane change on a vehicle. | |
| void | SetGlobalDistanceToLeadingVehicle (const float distance) |
| Method to specify Global Distance. | |
| void | SetGlobalLaneOffset (float const offset) |
| Method to set a global lane offset displacement from the center line. | |
| void | SetGlobalLargeVehicleWideTurn (const bool enable) |
| Method to enable/disable the wide-turn manoeuvre globally for large vehicles. | |
| void | SetGlobalPercentageSpeedDifference (float const percentage) |
| Method to set a global % decrease in velocity with respect to the speed limit. | |
| void | SetHybridPhysicsMode (const bool mode_switch) |
| Method to set hybrid physics mode. | |
| void | SetHybridPhysicsRadius (const float radius) |
| Method to set hybrid physics radius. | |
| void | SetImportedRoute (const ActorPtr &actor, const Route route, const bool empty_buffer) |
| Method to set our own imported route. | |
| void | SetKeepSlowLanePercentage (const ActorPtr &actor, const float percentage) |
| Method to set % to keep on the slow lane. | |
| void | SetLaneOffset (const ActorPtr &actor, const float offset) |
| Method to set a lane offset displacement from the center line. | |
| void | SetLargeVehicleWideTurn (const ActorPtr &actor, const bool enable) |
| Method to enable/disable the wide-turn manoeuvre for a single large vehicle. | |
| void | SetMaxBoundaries (const float lower, const float upper) |
| Method to set limits for boundaries when respawning vehicles. | |
| void | SetOSMMode (const bool mode_switch) |
| Method to set Open Street Map mode. | |
| void | SetPercentageIgnoreVehicles (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of ignoring collisions with any vehicle. | |
| void | SetPercentageIgnoreWalkers (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of ignoring collisions with any walker. | |
| void | SetPercentageRunningLight (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of running any traffic light. | |
| void | SetPercentageRunningSign (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of running any traffic sign. | |
| void | SetPercentageSpeedDifference (const ActorPtr &actor, const float percentage) |
| Method to set a vehicle's % decrease in velocity with respect to the speed limit. | |
| void | SetRandomDeviceSeed (const uint64_t seed) |
| Method to set randomization seed. | |
| void | SetRandomLeftLaneChangePercentage (const ActorPtr &actor, const float percentage) |
| Method to set % to randomly do a left lane change. | |
| void | SetRandomRightLaneChangePercentage (const ActorPtr &actor, const float percentage) |
| Method to set % to randomly do a right lane change. | |
| void | SetRespawnDormantVehicles (const bool mode_switch) |
| Method to set automatic respawn of dormant vehicles. | |
| void | SetSynchronousMode (bool mode) |
| Method to switch traffic manager into synchronous execution. | |
| void | SetSynchronousModeTimeOutInMiliSecond (double time) |
| Method to set Tick timeout for synchronous execution. | |
| void | SetUpdateVehicleLights (const ActorPtr &actor, const bool do_update) |
| Method to set the automatic management of the vehicle lights. | |
| virtual void | ShutDown () |
| void | Start () |
| To start the TrafficManager. | |
| void | Stop () |
| To stop the TrafficManager. | |
| bool | SynchronousTick () |
| Method to provide synchronous tick. | |
| TrafficManagerRemote (const std::pair< std::string, uint16_t > &_serverTM, carla::client::detail::EpisodeProxy &episodeProxy) | |
| Constructor store remote location information. | |
| void | UnregisterVehicles (const std::vector< ActorPtr > &actor_list) |
| This method unregisters a vehicle from traffic manager. | |
| void | UpdateImportedRoute (const ActorId &actor_id, const Route route) |
| Method to update an already set route. | |
| void | UpdateUploadPath (const ActorId &actor_id, const Path path) |
| Method to update an already set path. | |
| virtual | ~TrafficManagerRemote () |
| Destructor. | |
Public Member Functions inherited from carla::traffic_manager::TrafficManagerBase | |
| TrafficManagerBase () | |
| Protected constructor for singleton lifecycle management. | |
| virtual | ~TrafficManagerBase () |
| Destructor. | |
Private Attributes | |
| std::condition_variable | _cv |
| bool | _keep_alive = true |
| std::mutex | _mutex |
| TrafficManagerClient | client |
| Remote client using the IP and port information it connects to as remote RPC traffic manager server. | |
| carla::client::detail::EpisodeProxy | episodeProxyTM |
| CARLA client connection object. | |
The function of this class is to integrate all the various stages of the traffic manager appropriately using messengers.
Definition at line 28 of file TrafficManagerRemote.h.
| carla::traffic_manager::TrafficManagerRemote::TrafficManagerRemote | ( | const std::pair< std::string, uint16_t > & | _serverTM, |
| carla::client::detail::EpisodeProxy & | episodeProxy | ||
| ) |
Constructor store remote location information.
Definition at line 16 of file TrafficManagerRemote.cpp.
References Start().
|
virtual |
|
virtual |
Method to get the vehicle's action buffer.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 294 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::GetActionBuffer().
|
virtual |
Get CARLA episode information.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 306 of file TrafficManagerRemote.cpp.
References episodeProxyTM.
|
virtual |
Method to get the vehicle's next action.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 290 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::GetNextAction().
| void carla::traffic_manager::TrafficManagerRemote::HealthCheckRemoteTM | ( | ) |
Method to check server is alive or not.
Definition at line 302 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::HealthCheckRemoteTM().
Referenced by carla::traffic_manager::TrafficManager::CreateTrafficManagerClient().
|
virtual |
This method registers a vehicle with the traffic manager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 96 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::RegisterVehicle().
|
virtual |
To release the traffic manager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 79 of file TrafficManagerRemote.cpp.
References Stop().
Referenced by ~TrafficManagerRemote().
|
virtual |
Method to remove a route.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 258 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::RemoveImportedRoute().
|
virtual |
Method to remove a path.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 244 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::RemoveUploadPath().
|
virtual |
To reset the traffic manager for the episode episode_id.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 83 of file TrafficManagerRemote.cpp.
References episodeProxyTM, carla::client::detail::EpisodeProxyImpl< PointerT >::GetId(), carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), Start(), and Stop().
|
virtual |
Enable/disable automatic lane change on a vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 167 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetAutoLaneChange().
|
virtual |
Method to set boundaries for respawning vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 270 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetBoundariesRespawnDormantVehicles().
|
virtual |
Method to set collision detection rules between vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 154 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetCollisionDetection().
|
virtual |
Method to set our own imported path.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 238 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetCustomPath().
|
virtual |
Set a vehicle's exact desired velocity.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 118 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetDesiredSpeed().
|
virtual |
Method to specify how much distance a vehicle should maintain to the leading vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 173 of file TrafficManagerRemote.cpp.
References client, distance, and carla::traffic_manager::TrafficManagerClient::SetDistanceToLeadingVehicle().
|
virtual |
Method to force lane change on a vehicle.
Direction flag can be set to true for left and false for right.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 161 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetForceLaneChange().
|
virtual |
Method to specify Global Distance.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 179 of file TrafficManagerRemote.cpp.
References client, distance, and carla::traffic_manager::TrafficManagerClient::SetGlobalDistanceToLeadingVehicle().
|
virtual |
Method to set a global lane offset displacement from the center line.
Positive values imply a right offset while negative ones mean a left one.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 134 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetGlobalLaneOffset().
|
virtual |
Method to enable/disable the wide-turn manoeuvre globally for large vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 144 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetGlobalLargeVehicleWideTurn().
|
virtual |
Method to set a global % decrease in velocity with respect to the speed limit.
If less than 0, it's a % increase.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 124 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetGlobalPercentageSpeedDifference().
|
virtual |
Method to set hybrid physics mode.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 226 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetHybridPhysicsMode().
|
virtual |
Method to set hybrid physics radius.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 230 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetHybridPhysicsRadius().
|
virtual |
Method to set our own imported route.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 252 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetImportedRoute().
|
virtual |
Method to set % to keep on the slow lane.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 208 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetKeepSlowLanePercentage().
|
virtual |
Method to set a lane offset displacement from the center line.
Positive values imply a right offset while negative ones mean a left one.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 128 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetLaneOffset().
|
virtual |
Method to enable/disable the wide-turn manoeuvre for a single large vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 138 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetLargeVehicleWideTurn().
|
virtual |
Method to set limits for boundaries when respawning vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 274 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetMaxBoundaries().
|
virtual |
Method to set Open Street Map mode.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 234 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetOSMMode().
|
virtual |
Method to specify the % chance of ignoring collisions with any vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 190 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageIgnoreVehicles().
|
virtual |
Method to specify the % chance of ignoring collisions with any walker.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 184 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageIgnoreWalkers().
|
virtual |
Method to specify the % chance of running any traffic light.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 196 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageRunningLight().
|
virtual |
Method to specify the % chance of running any traffic sign.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 202 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageRunningSign().
|
virtual |
Method to set a vehicle's % decrease in velocity with respect to the speed limit.
If less than 0, it's a % increase.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 112 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageSpeedDifference().
|
virtual |
Method to set randomization seed.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 310 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetRandomDeviceSeed().
|
virtual |
Method to set % to randomly do a left lane change.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 214 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetRandomLeftLaneChangePercentage().
|
virtual |
Method to set % to randomly do a right lane change.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 220 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetRandomRightLaneChangePercentage().
|
virtual |
Method to set automatic respawn of dormant vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 266 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetRespawnDormantVehicles().
|
virtual |
Method to switch traffic manager into synchronous execution.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 282 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetSynchronousMode().
|
virtual |
Method to set Tick timeout for synchronous execution.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 286 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetSynchronousModeTimeOutInMiliSecond().
|
virtual |
Method to set the automatic management of the vehicle lights.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 148 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::SetUpdateVehicleLights().
|
virtual |
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 278 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::ShutDown().
|
virtual |
To start the TrafficManager.
Until connection active
Create error msg
TSet the error message
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 31 of file TrafficManagerRemote.cpp.
References _cv, _keep_alive, client, episodeProxyTM, carla::traffic_manager::TrafficManagerClient::getServerDetails(), carla::traffic_manager::TrafficManagerClient::HealthCheckRemoteTM(), and carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
Referenced by Reset(), and TrafficManagerRemote().
|
virtual |
To stop the TrafficManager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 70 of file TrafficManagerRemote.cpp.
References _cv, _keep_alive, and _mutex.
|
virtual |
Method to provide synchronous tick.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 298 of file TrafficManagerRemote.cpp.
|
virtual |
This method unregisters a vehicle from traffic manager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 104 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::UnregisterVehicle().
|
virtual |
Method to update an already set route.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 262 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::UpdateImportedRoute().
|
virtual |
Method to update an already set path.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 248 of file TrafficManagerRemote.cpp.
References client, and carla::traffic_manager::TrafficManagerClient::UpdateUploadPath().
|
private |
Definition at line 193 of file TrafficManagerRemote.h.
|
private |
Definition at line 197 of file TrafficManagerRemote.h.
|
private |
Definition at line 195 of file TrafficManagerRemote.h.
Referenced by Stop().
|
private |
Remote client using the IP and port information it connects to as remote RPC traffic manager server.
Definition at line 188 of file TrafficManagerRemote.h.
Referenced by GetActionBuffer(), GetNextAction(), HealthCheckRemoteTM(), RegisterVehicles(), RemoveImportedRoute(), RemoveUploadPath(), SetAutoLaneChange(), SetBoundariesRespawnDormantVehicles(), SetCollisionDetection(), SetCustomPath(), SetDesiredSpeed(), SetDistanceToLeadingVehicle(), SetForceLaneChange(), SetGlobalDistanceToLeadingVehicle(), SetGlobalLaneOffset(), SetGlobalLargeVehicleWideTurn(), SetGlobalPercentageSpeedDifference(), SetHybridPhysicsMode(), SetHybridPhysicsRadius(), SetImportedRoute(), SetKeepSlowLanePercentage(), SetLaneOffset(), SetLargeVehicleWideTurn(), SetMaxBoundaries(), SetOSMMode(), SetPercentageIgnoreVehicles(), SetPercentageIgnoreWalkers(), SetPercentageRunningLight(), SetPercentageRunningSign(), SetPercentageSpeedDifference(), SetRandomDeviceSeed(), SetRandomLeftLaneChangePercentage(), SetRandomRightLaneChangePercentage(), SetRespawnDormantVehicles(), SetSynchronousMode(), SetSynchronousModeTimeOutInMiliSecond(), SetUpdateVehicleLights(), ShutDown(), Start(), UnregisterVehicles(), UpdateImportedRoute(), and UpdateUploadPath().
|
private |
CARLA client connection object.
Definition at line 191 of file TrafficManagerRemote.h.
Referenced by GetEpisodeProxy(), Reset(), and Start().