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

Provides communication with the rpc of TrafficManagerServer. More...

#include <TrafficManagerClient.h>

+ Collaboration diagram for carla::traffic_manager::TrafficManagerClient:

Public Member Functions

void getServerDetails (std::string &_host, uint16_t &_port)
 Get parameters. More...
 
void HealthCheckRemoteTM ()
 Check if remote traffic manager is alive. More...
 
TrafficManagerClientoperator= (const TrafficManagerClient &)=default
 
TrafficManagerClientoperator= (TrafficManagerClient &&)=default
 
void RegisterVehicle (const std::vector< carla::rpc::Actor > &actor_list)
 Register vehicles to remote traffic manager server via RPC client. More...
 
void SetAutoLaneChange (const carla::rpc::Actor &actor, const bool enable)
 Enable/disable automatic lane change on a vehicle. More...
 
void SetCollisionDetection (const carla::rpc::Actor &reference_actor, const carla::rpc::Actor &other_actor, const bool detect_collision)
 Method to set collision detection rules between vehicles. More...
 
void SetDistanceToLeadingVehicle (const carla::rpc::Actor &actor, const float distance)
 Method to specify how much distance a vehicle should maintain to the leading vehicle. More...
 
void SetForceLaneChange (const carla::rpc::Actor &actor, const bool direction)
 Method to force lane change on a vehicle. More...
 
void SetGlobalDistanceToLeadingVehicle (const float distance)
 Method to specify how much distance a vehicle should maintain to the Global leading vehicle. More...
 
void SetGlobalPercentageSpeedDifference (const float 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 mode. More...
 
void SetKeepRightPercentage (const carla::rpc::Actor &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 carla::rpc::Actor &actor, const float percentage)
 Method to specify the % chance of ignoring collisions with any vehicle. More...
 
void SetPercentageIgnoreWalkers (const carla::rpc::Actor &actor, const float percentage)
 Method to specify the % chance of ignoring collisions with any walker. More...
 
void SetPercentageRunningLight (const carla::rpc::Actor &actor, const float percentage)
 Method to specify the % chance of running a traffic sign. More...
 
void SetPercentageRunningSign (const carla::rpc::Actor &actor, const float percentage)
 Method to specify the % chance of running any traffic sign. More...
 
void SetPercentageSpeedDifference (const carla::rpc::Actor &_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 setServerDetails (const std::string &_host, const uint16_t &_port)
 Set parameters. More...
 
void SetSynchronousMode (const bool mode)
 Method to switch traffic manager into synchronous execution. More...
 
void SetSynchronousModeTimeOutInMiliSecond (const double time)
 Method to set tick timeout for synchronous execution. More...
 
bool SynchronousTick ()
 Method to provide synchronous tick. More...
 
 TrafficManagerClient (const TrafficManagerClient &)=default
 
 TrafficManagerClient (TrafficManagerClient &&)=default
 
 TrafficManagerClient (const std::string &_host, const uint16_t &_port)
 Parametric constructor to initialize the parameters. More...
 
void UnregisterVehicle (const std::vector< carla::rpc::Actor > &actor_list)
 Unregister vehicles to remote traffic manager server via RPC client. More...
 
 ~TrafficManagerClient ()
 Destructor method. More...
 

Private Attributes

::rpc::client * _client = nullptr
 RPC client. More...
 
std::string tmhost
 Server port and host. More...
 
uint16_t tmport
 

Detailed Description

Provides communication with the rpc of TrafficManagerServer.

Definition at line 21 of file TrafficManagerClient.h.

Constructor & Destructor Documentation

◆ TrafficManagerClient() [1/3]

carla::traffic_manager::TrafficManagerClient::TrafficManagerClient ( const TrafficManagerClient )
default

◆ TrafficManagerClient() [2/3]

carla::traffic_manager::TrafficManagerClient::TrafficManagerClient ( TrafficManagerClient &&  )
default

◆ TrafficManagerClient() [3/3]

carla::traffic_manager::TrafficManagerClient::TrafficManagerClient ( const std::string &  _host,
const uint16_t &  _port 
)
inline

Parametric constructor to initialize the parameters.

Create client instance.

Definition at line 32 of file TrafficManagerClient.h.

References _client, carla::traffic_manager::constants::Networking::TM_TIMEOUT, tmhost, and tmport.

◆ ~TrafficManagerClient()

carla::traffic_manager::TrafficManagerClient::~TrafficManagerClient ( )
inline

Destructor method.

Definition at line 46 of file TrafficManagerClient.h.

References _client.

Member Function Documentation

◆ getServerDetails()

void carla::traffic_manager::TrafficManagerClient::getServerDetails ( std::string &  _host,
uint16_t &  _port 
)
inline

Get parameters.

Definition at line 60 of file TrafficManagerClient.h.

References tmhost, and tmport.

Referenced by carla::traffic_manager::TrafficManagerRemote::Start().

+ Here is the caller graph for this function:

◆ HealthCheckRemoteTM()

void carla::traffic_manager::TrafficManagerClient::HealthCheckRemoteTM ( )
inline

Check if remote traffic manager is alive.

Definition at line 160 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::HealthCheckRemoteTM(), and carla::traffic_manager::TrafficManagerRemote::Start().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

TrafficManagerClient& carla::traffic_manager::TrafficManagerClient::operator= ( const TrafficManagerClient )
default

◆ operator=() [2/2]

TrafficManagerClient& carla::traffic_manager::TrafficManagerClient::operator= ( TrafficManagerClient &&  )
default

◆ RegisterVehicle()

void carla::traffic_manager::TrafficManagerClient::RegisterVehicle ( const std::vector< carla::rpc::Actor > &  actor_list)
inline

Register vehicles to remote traffic manager server via RPC client.

Definition at line 66 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::RegisterVehicles().

+ Here is the caller graph for this function:

◆ SetAutoLaneChange()

void carla::traffic_manager::TrafficManagerClient::SetAutoLaneChange ( const carla::rpc::Actor actor,
const bool  enable 
)
inline

Enable/disable automatic lane change on a vehicle.

Definition at line 105 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetAutoLaneChange().

+ Here is the caller graph for this function:

◆ SetCollisionDetection()

void carla::traffic_manager::TrafficManagerClient::SetCollisionDetection ( const carla::rpc::Actor reference_actor,
const carla::rpc::Actor other_actor,
const bool  detect_collision 
)
inline

Method to set collision detection rules between vehicles.

Definition at line 92 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetCollisionDetection().

+ Here is the caller graph for this function:

◆ SetDistanceToLeadingVehicle()

void carla::traffic_manager::TrafficManagerClient::SetDistanceToLeadingVehicle ( const carla::rpc::Actor actor,
const float  distance 
)
inline

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

Definition at line 112 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetDistanceToLeadingVehicle().

+ Here is the caller graph for this function:

◆ SetForceLaneChange()

void carla::traffic_manager::TrafficManagerClient::SetForceLaneChange ( const carla::rpc::Actor actor,
const bool  direction 
)
inline

Method to force lane change on a vehicle.

Direction flag can be set to true for left and false for right.

Definition at line 99 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetForceLaneChange().

+ Here is the caller graph for this function:

◆ SetGlobalDistanceToLeadingVehicle()

void carla::traffic_manager::TrafficManagerClient::SetGlobalDistanceToLeadingVehicle ( const float  distance)
inline

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

Definition at line 167 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetGlobalDistanceToLeadingVehicle().

+ Here is the caller graph for this function:

◆ SetGlobalPercentageSpeedDifference()

void carla::traffic_manager::TrafficManagerClient::SetGlobalPercentageSpeedDifference ( const float  percentage)
inline

Method to set a global % decrease in velocity with respect to the speed limit.

If less than 0, it's a % increase.

Definition at line 86 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetGlobalPercentageSpeedDifference().

+ Here is the caller graph for this function:

◆ SetHybridPhysicsMode()

void carla::traffic_manager::TrafficManagerClient::SetHybridPhysicsMode ( const bool  mode_switch)
inline

Method to set hybrid physics mode.

Definition at line 179 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetHybridPhysicsMode().

+ Here is the caller graph for this function:

◆ SetHybridPhysicsRadius()

void carla::traffic_manager::TrafficManagerClient::SetHybridPhysicsRadius ( const float  radius)
inline

Method to set hybrid physics mode.

Definition at line 185 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetHybridPhysicsRadius().

+ Here is the caller graph for this function:

◆ SetKeepRightPercentage()

void carla::traffic_manager::TrafficManagerClient::SetKeepRightPercentage ( const carla::rpc::Actor actor,
const float  percentage 
)
inline

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

Definition at line 173 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetKeepRightPercentage().

+ Here is the caller graph for this function:

◆ SetOSMMode()

void carla::traffic_manager::TrafficManagerClient::SetOSMMode ( const bool  mode_switch)
inline

Method to set Open Street Map mode.

Definition at line 197 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetOSMMode().

+ Here is the caller graph for this function:

◆ SetPercentageIgnoreVehicles()

void carla::traffic_manager::TrafficManagerClient::SetPercentageIgnoreVehicles ( const carla::rpc::Actor actor,
const float  percentage 
)
inline

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

Definition at line 124 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageIgnoreVehicles().

+ Here is the caller graph for this function:

◆ SetPercentageIgnoreWalkers()

void carla::traffic_manager::TrafficManagerClient::SetPercentageIgnoreWalkers ( const carla::rpc::Actor actor,
const float  percentage 
)
inline

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

Definition at line 118 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageIgnoreWalkers().

+ Here is the caller graph for this function:

◆ SetPercentageRunningLight()

void carla::traffic_manager::TrafficManagerClient::SetPercentageRunningLight ( const carla::rpc::Actor actor,
const float  percentage 
)
inline

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

Definition at line 130 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageRunningLight().

+ Here is the caller graph for this function:

◆ SetPercentageRunningSign()

void carla::traffic_manager::TrafficManagerClient::SetPercentageRunningSign ( const carla::rpc::Actor actor,
const float  percentage 
)
inline

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

Definition at line 136 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageRunningSign().

+ Here is the caller graph for this function:

◆ SetPercentageSpeedDifference()

void carla::traffic_manager::TrafficManagerClient::SetPercentageSpeedDifference ( const carla::rpc::Actor _actor,
const float  percentage 
)
inline

Method to set a vehicle's % decrease in velocity with respect to the speed limit.

If less than 0, it's a % increase.

Definition at line 79 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageSpeedDifference().

+ Here is the caller graph for this function:

◆ SetRandomDeviceSeed()

void carla::traffic_manager::TrafficManagerClient::SetRandomDeviceSeed ( const uint64_t  seed)
inline

Method to set randomization seed.

Definition at line 191 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetRandomDeviceSeed().

+ Here is the caller graph for this function:

◆ setServerDetails()

void carla::traffic_manager::TrafficManagerClient::setServerDetails ( const std::string &  _host,
const uint16_t &  _port 
)
inline

Set parameters.

Definition at line 54 of file TrafficManagerClient.h.

References tmhost, and tmport.

◆ SetSynchronousMode()

void carla::traffic_manager::TrafficManagerClient::SetSynchronousMode ( const bool  mode)
inline

Method to switch traffic manager into synchronous execution.

Definition at line 142 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetSynchronousMode().

+ Here is the caller graph for this function:

◆ SetSynchronousModeTimeOutInMiliSecond()

void carla::traffic_manager::TrafficManagerClient::SetSynchronousModeTimeOutInMiliSecond ( const double  time)
inline

Method to set tick timeout for synchronous execution.

Definition at line 148 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::SetSynchronousModeTimeOutInMiliSecond().

+ Here is the caller graph for this function:

◆ SynchronousTick()

bool carla::traffic_manager::TrafficManagerClient::SynchronousTick ( )
inline

Method to provide synchronous tick.

Definition at line 154 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

◆ UnregisterVehicle()

void carla::traffic_manager::TrafficManagerClient::UnregisterVehicle ( const std::vector< carla::rpc::Actor > &  actor_list)
inline

Unregister vehicles to remote traffic manager server via RPC client.

Definition at line 72 of file TrafficManagerClient.h.

References _client, and DEBUG_ASSERT.

Referenced by carla::traffic_manager::TrafficManagerRemote::UnregisterVehicles().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _client

::rpc::client* carla::traffic_manager::TrafficManagerClient::_client = nullptr
private

◆ tmhost

std::string carla::traffic_manager::TrafficManagerClient::tmhost
private

Server port and host.

Definition at line 208 of file TrafficManagerClient.h.

Referenced by getServerDetails(), setServerDetails(), and TrafficManagerClient().

◆ tmport

uint16_t carla::traffic_manager::TrafficManagerClient::tmport
private

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