CARLA
Public Member Functions | Private Attributes | List of all members
carla::traffic_manager::TrafficManagerRemote Class Reference

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:
+ Collaboration diagram for carla::traffic_manager::TrafficManagerRemote:

Public Member Functions

carla::client::detail::EpisodeProxyGetEpisodeProxy ()
 Get CARLA episode information. More...
 
void HealthCheckRemoteTM ()
 Method to check server is alive or not. More...
 
void RegisterVehicles (const std::vector< ActorPtr > &actor_list)
 This method registers a vehicle with the traffic manager. More...
 
void Release ()
 To release the traffic manager. More...
 
void Reset ()
 To reset the traffic manager. More...
 
void SetAutoLaneChange (const ActorPtr &actor, const bool enable)
 Enable/disable automatic lane change on a vehicle. More...
 
void SetCollisionDetection (const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision)
 Method to set collision detection rules between vehicles. More...
 
void SetDistanceToLeadingVehicle (const ActorPtr &actor, const float distance)
 Method to specify how much distance a vehicle should maintain to the leading vehicle. More...
 
void SetForceLaneChange (const ActorPtr &actor, const bool direction)
 Method to force lane change on a vehicle. More...
 
void SetGlobalDistanceToLeadingVehicle (const float distance)
 Method to specify Global Distance. More...
 
void SetGlobalPercentageSpeedDifference (float const percentage)
 Method to set a global % decrease in velocity with respect to the speed limit. More...
 
void SetHybridPhysicsMode (const bool mode_switch)
 Method to set hybrid physics mode. More...
 
void SetHybridPhysicsRadius (const float radius)
 Method to set hybrid physics radius. More...
 
void SetKeepRightPercentage (const ActorPtr &actor, const float percentage)
 Method to set probabilistic preference to keep on the right lane. More...
 
void SetOSMMode (const bool mode_switch)
 Method to set Open Street Map mode. More...
 
void SetPercentageIgnoreVehicles (const ActorPtr &actor, const float perc)
 Method to specify the % chance of ignoring collisions with any vehicle. More...
 
void SetPercentageIgnoreWalkers (const ActorPtr &actor, const float perc)
 Method to specify the % chance of ignoring collisions with any walker. More...
 
void SetPercentageRunningLight (const ActorPtr &actor, const float perc)
 Method to specify the % chance of running any traffic light. More...
 
void SetPercentageRunningSign (const ActorPtr &actor, const float perc)
 Method to specify the % chance of running any traffic sign. More...
 
void SetPercentageSpeedDifference (const ActorPtr &actor, const float percentage)
 Method to set a vehicle's % decrease in velocity with respect to the speed limit. More...
 
void SetRandomDeviceSeed (const uint64_t seed)
 Method to set randomization seed. More...
 
void SetSynchronousMode (bool mode)
 Method to switch traffic manager into synchronous execution. More...
 
void SetSynchronousModeTimeOutInMiliSecond (double time)
 Method to set Tick timeout for synchronous execution. More...
 
void Start ()
 To start the TrafficManager. More...
 
void Stop ()
 To stop the TrafficManager. More...
 
bool SynchronousTick ()
 Method to provide synchronous tick. More...
 
 TrafficManagerRemote (const std::pair< std::string, uint16_t > &_serverTM, carla::client::detail::EpisodeProxy &episodeProxy)
 Constructor store remote location information. More...
 
void UnregisterVehicles (const std::vector< ActorPtr > &actor_list)
 This method unregisters a vehicle from traffic manager. More...
 
virtual ~TrafficManagerRemote ()
 Destructor. More...
 
- Public Member Functions inherited from carla::traffic_manager::TrafficManagerBase
 TrafficManagerBase ()
 Protected constructor for singleton lifecycle management. More...
 
virtual ~TrafficManagerBase ()
 Destructor. More...
 

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. More...
 
carla::client::detail::EpisodeProxy episodeProxyTM
 CARLA client connection object. More...
 

Detailed Description

The function of this class is to integrate all the various stages of the traffic manager appropriately using messengers.

Definition at line 25 of file TrafficManagerRemote.h.

Constructor & Destructor Documentation

◆ TrafficManagerRemote()

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 14 of file TrafficManagerRemote.cpp.

References Start().

+ Here is the call graph for this function:

◆ ~TrafficManagerRemote()

carla::traffic_manager::TrafficManagerRemote::~TrafficManagerRemote ( )
virtual

Destructor.

Definition at line 25 of file TrafficManagerRemote.cpp.

References Release().

+ Here is the call graph for this function:

Member Function Documentation

◆ GetEpisodeProxy()

carla::client::detail::EpisodeProxy & carla::traffic_manager::TrafficManagerRemote::GetEpisodeProxy ( )
virtual

Get CARLA episode information.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 204 of file TrafficManagerRemote.cpp.

References episodeProxyTM.

◆ HealthCheckRemoteTM()

void carla::traffic_manager::TrafficManagerRemote::HealthCheckRemoteTM ( )

Method to check server is alive or not.

Definition at line 200 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::HealthCheckRemoteTM().

Referenced by carla::traffic_manager::TrafficManager::CreateTrafficManagerClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterVehicles()

void carla::traffic_manager::TrafficManagerRemote::RegisterVehicles ( const std::vector< ActorPtr > &  actor_list)
virtual

This method registers a vehicle with the traffic manager.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 90 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::RegisterVehicle().

+ Here is the call graph for this function:

◆ Release()

void carla::traffic_manager::TrafficManagerRemote::Release ( )
virtual

To release the traffic manager.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 77 of file TrafficManagerRemote.cpp.

References Stop().

Referenced by ~TrafficManagerRemote().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Reset()

void carla::traffic_manager::TrafficManagerRemote::Reset ( void  )
virtual

To reset the traffic manager.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 81 of file TrafficManagerRemote.cpp.

References episodeProxyTM, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), Start(), and Stop().

+ Here is the call graph for this function:

◆ SetAutoLaneChange()

void carla::traffic_manager::TrafficManagerRemote::SetAutoLaneChange ( const ActorPtr actor,
const bool  enable 
)
virtual

Enable/disable automatic lane change on a vehicle.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 129 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetAutoLaneChange().

+ Here is the call graph for this function:

◆ SetCollisionDetection()

void carla::traffic_manager::TrafficManagerRemote::SetCollisionDetection ( const ActorPtr reference_actor,
const ActorPtr other_actor,
const bool  detect_collision 
)
virtual

Method to set collision detection rules between vehicles.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 116 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetCollisionDetection().

+ Here is the call graph for this function:

◆ SetDistanceToLeadingVehicle()

void carla::traffic_manager::TrafficManagerRemote::SetDistanceToLeadingVehicle ( const ActorPtr actor,
const float  distance 
)
virtual

Method to specify how much distance a vehicle should maintain to the leading vehicle.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 135 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetDistanceToLeadingVehicle().

+ Here is the call graph for this function:

◆ SetForceLaneChange()

void carla::traffic_manager::TrafficManagerRemote::SetForceLaneChange ( const ActorPtr actor,
const bool  direction 
)
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 123 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetForceLaneChange().

+ Here is the call graph for this function:

◆ SetGlobalDistanceToLeadingVehicle()

void carla::traffic_manager::TrafficManagerRemote::SetGlobalDistanceToLeadingVehicle ( const float  distance)
virtual

Method to specify Global Distance.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 141 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetGlobalDistanceToLeadingVehicle().

+ Here is the call graph for this function:

◆ SetGlobalPercentageSpeedDifference()

void carla::traffic_manager::TrafficManagerRemote::SetGlobalPercentageSpeedDifference ( float const  percentage)
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 112 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetGlobalPercentageSpeedDifference().

+ Here is the call graph for this function:

◆ SetHybridPhysicsMode()

void carla::traffic_manager::TrafficManagerRemote::SetHybridPhysicsMode ( const bool  mode_switch)
virtual

Method to set hybrid physics mode.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 176 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetHybridPhysicsMode().

+ Here is the call graph for this function:

◆ SetHybridPhysicsRadius()

void carla::traffic_manager::TrafficManagerRemote::SetHybridPhysicsRadius ( const float  radius)
virtual

Method to set hybrid physics radius.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 180 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetHybridPhysicsRadius().

+ Here is the call graph for this function:

◆ SetKeepRightPercentage()

void carla::traffic_manager::TrafficManagerRemote::SetKeepRightPercentage ( const ActorPtr actor,
const float  percentage 
)
virtual

Method to set probabilistic preference to keep on the right lane.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 170 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetKeepRightPercentage().

+ Here is the call graph for this function:

◆ SetOSMMode()

void carla::traffic_manager::TrafficManagerRemote::SetOSMMode ( const bool  mode_switch)
virtual

Method to set Open Street Map mode.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 184 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetOSMMode().

+ Here is the call graph for this function:

◆ SetPercentageIgnoreVehicles()

void carla::traffic_manager::TrafficManagerRemote::SetPercentageIgnoreVehicles ( const ActorPtr actor,
const float  perc 
)
virtual

Method to specify the % chance of ignoring collisions with any vehicle.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 152 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageIgnoreVehicles().

+ Here is the call graph for this function:

◆ SetPercentageIgnoreWalkers()

void carla::traffic_manager::TrafficManagerRemote::SetPercentageIgnoreWalkers ( const ActorPtr actor,
const float  perc 
)
virtual

Method to specify the % chance of ignoring collisions with any walker.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 146 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageIgnoreWalkers().

+ Here is the call graph for this function:

◆ SetPercentageRunningLight()

void carla::traffic_manager::TrafficManagerRemote::SetPercentageRunningLight ( const ActorPtr actor,
const float  perc 
)
virtual

Method to specify the % chance of running any traffic light.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 158 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageRunningLight().

+ Here is the call graph for this function:

◆ SetPercentageRunningSign()

void carla::traffic_manager::TrafficManagerRemote::SetPercentageRunningSign ( const ActorPtr actor,
const float  perc 
)
virtual

Method to specify the % chance of running any traffic sign.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 164 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageRunningSign().

+ Here is the call graph for this function:

◆ SetPercentageSpeedDifference()

void carla::traffic_manager::TrafficManagerRemote::SetPercentageSpeedDifference ( const ActorPtr actor,
const float  percentage 
)
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 106 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetPercentageSpeedDifference().

+ Here is the call graph for this function:

◆ SetRandomDeviceSeed()

void carla::traffic_manager::TrafficManagerRemote::SetRandomDeviceSeed ( const uint64_t  seed)
virtual

Method to set randomization seed.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 208 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetRandomDeviceSeed().

+ Here is the call graph for this function:

◆ SetSynchronousMode()

void carla::traffic_manager::TrafficManagerRemote::SetSynchronousMode ( bool  mode)
virtual

Method to switch traffic manager into synchronous execution.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 188 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetSynchronousMode().

+ Here is the call graph for this function:

◆ SetSynchronousModeTimeOutInMiliSecond()

void carla::traffic_manager::TrafficManagerRemote::SetSynchronousModeTimeOutInMiliSecond ( double  time)
virtual

Method to set Tick timeout for synchronous execution.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 192 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::SetSynchronousModeTimeOutInMiliSecond().

+ Here is the call graph for this function:

◆ Start()

void carla::traffic_manager::TrafficManagerRemote::Start ( )
virtual

To start the TrafficManager.

Until connection active

Create error msg

TSet the error message

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 29 of file TrafficManagerRemote.cpp.

References _cv, _keep_alive, client, episodeProxyTM, carla::traffic_manager::TrafficManagerClient::getServerDetails(), carla::traffic_manager::TrafficManagerClient::HealthCheckRemoteTM(), carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), and carla::traffic_manager::constants::Networking::TM_TIMEOUT.

Referenced by Reset(), and TrafficManagerRemote().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stop()

void carla::traffic_manager::TrafficManagerRemote::Stop ( void  )
virtual

To stop the TrafficManager.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 68 of file TrafficManagerRemote.cpp.

References _cv, _keep_alive, _mutex, and carla::traffic_manager::constants::Networking::TM_TIMEOUT.

Referenced by Release(), and Reset().

+ Here is the caller graph for this function:

◆ SynchronousTick()

bool carla::traffic_manager::TrafficManagerRemote::SynchronousTick ( )
virtual

Method to provide synchronous tick.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 196 of file TrafficManagerRemote.cpp.

◆ UnregisterVehicles()

void carla::traffic_manager::TrafficManagerRemote::UnregisterVehicles ( const std::vector< ActorPtr > &  actor_list)
virtual

This method unregisters a vehicle from traffic manager.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 98 of file TrafficManagerRemote.cpp.

References client, and carla::traffic_manager::TrafficManagerClient::UnregisterVehicle().

+ Here is the call graph for this function:

Member Data Documentation

◆ _cv

std::condition_variable carla::traffic_manager::TrafficManagerRemote::_cv
private

Definition at line 129 of file TrafficManagerRemote.h.

Referenced by Start(), and Stop().

◆ _keep_alive

bool carla::traffic_manager::TrafficManagerRemote::_keep_alive = true
private

Definition at line 133 of file TrafficManagerRemote.h.

Referenced by Start(), and Stop().

◆ _mutex

std::mutex carla::traffic_manager::TrafficManagerRemote::_mutex
private

Definition at line 131 of file TrafficManagerRemote.h.

Referenced by Stop().

◆ client

TrafficManagerClient carla::traffic_manager::TrafficManagerRemote::client
private

◆ episodeProxyTM

carla::client::detail::EpisodeProxy carla::traffic_manager::TrafficManagerRemote::episodeProxyTM
private

CARLA client connection object.

Definition at line 127 of file TrafficManagerRemote.h.

Referenced by GetEpisodeProxy(), Reset(), and Start().


The documentation for this class was generated from the following files: