Provides communication with the rpc of TrafficManagerServer. More...
#include <TrafficManagerClient.h>
Public Member Functions | |
ActionBuffer | GetActionBuffer (const ActorId &actor_id) |
Method to get the vehicle's action buffer. More... | |
Action | GetNextAction (const ActorId &actor_id) |
Method to get the vehicle's next action. More... | |
void | getServerDetails (std::string &_host, uint16_t &_port) |
Get parameters. More... | |
void | HealthCheckRemoteTM () |
Check if remote traffic manager is alive. More... | |
TrafficManagerClient & | operator= (const TrafficManagerClient &)=default |
TrafficManagerClient & | operator= (TrafficManagerClient &&)=default |
void | RegisterVehicle (const std::vector< carla::rpc::Actor > &actor_list) |
Register vehicles to remote traffic manager server via RPC client. More... | |
void | RemoveImportedRoute (const ActorId &actor_id, const bool remove_path) |
Method to remove a route. More... | |
void | RemoveUploadPath (const ActorId &actor_id, const bool remove_path) |
Method to remove a list of points. More... | |
void | SetAutoLaneChange (const carla::rpc::Actor &actor, const bool enable) |
Enable/disable automatic lane change on a vehicle. More... | |
void | SetBoundariesRespawnDormantVehicles (const float lower_bound, const float upper_bound) |
Method to set boundaries for respawning vehicles. 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 | SetCustomPath (const carla::rpc::Actor &actor, const Path path, const bool empty_buffer) |
Method to set our own imported path. More... | |
void | SetDesiredSpeed (const carla::rpc::Actor &_actor, const float value) |
Set a vehicle's exact desired velocity. 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 | SetGlobalLaneOffset (const float offset) |
Method to set a global lane offset displacement from the center line. 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 | SetImportedRoute (const carla::rpc::Actor &actor, const Route route, const bool empty_buffer) |
Method to set our own imported route. More... | |
void | SetKeepRightPercentage (const carla::rpc::Actor &actor, const float percentage) |
Method to set % to keep on the right lane. More... | |
void | SetLaneOffset (const carla::rpc::Actor &_actor, const float offset) |
Method to set a lane offset displacement from the center line. More... | |
void | SetMaxBoundaries (const float lower, const float upper) |
Method to set boundaries for respawning vehicles. 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 | SetRandomLeftLaneChangePercentage (const carla::rpc::Actor &actor, const float percentage) |
Method to set % to randomly do a left lane change. More... | |
void | SetRandomRightLaneChangePercentage (const carla::rpc::Actor &actor, const float percentage) |
Method to set % to randomly do a right lane change. More... | |
void | SetRespawnDormantVehicles (const bool mode_switch) |
Method to set automatic respawn of dormant vehicles. 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... | |
void | SetUpdateVehicleLights (const carla::rpc::Actor &_actor, const bool do_update) |
Method to set the automatic management of the vehicle lights. More... | |
void | ShutDown () |
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... | |
void | UpdateImportedRoute (const ActorId &actor_id, const Route route) |
Method to update an already set list of points. More... | |
void | UpdateUploadPath (const ActorId &actor_id, const Path path) |
Method to update an already set list of points. 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 |
Provides communication with the rpc of TrafficManagerServer.
Definition at line 21 of file TrafficManagerClient.h.
|
default |
|
default |
|
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.
|
inline |
|
inline |
Method to get the vehicle's action buffer.
Definition at line 302 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::GetActionBuffer().
|
inline |
Method to get the vehicle's next action.
Definition at line 295 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::GetNextAction().
|
inline |
Get parameters.
Definition at line 60 of file TrafficManagerClient.h.
References tmhost, and tmport.
Referenced by carla::traffic_manager::TrafficManagerRemote::Start().
|
inline |
Check if remote traffic manager is alive.
Definition at line 186 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::HealthCheckRemoteTM(), and carla::traffic_manager::TrafficManagerRemote::Start().
|
default |
|
default |
|
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().
|
inline |
Method to remove a route.
Definition at line 265 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::RemoveImportedRoute().
|
inline |
Method to remove a list of points.
Definition at line 247 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::RemoveUploadPath().
|
inline |
Enable/disable automatic lane change on a vehicle.
Definition at line 131 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetAutoLaneChange().
|
inline |
Method to set boundaries for respawning vehicles.
Definition at line 283 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetBoundariesRespawnDormantVehicles().
|
inline |
Method to set collision detection rules between vehicles.
Definition at line 118 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetCollisionDetection().
|
inline |
Method to set our own imported path.
Definition at line 241 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetCustomPath().
|
inline |
Set a vehicle's exact desired velocity.
Definition at line 92 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetDesiredSpeed().
|
inline |
Method to specify how much distance a vehicle should maintain to the leading vehicle.
Definition at line 138 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetDistanceToLeadingVehicle().
|
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 125 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetForceLaneChange().
|
inline |
Method to specify how much distance a vehicle should maintain to the Global leading vehicle.
Definition at line 193 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetGlobalDistanceToLeadingVehicle().
|
inline |
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.
Definition at line 106 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetGlobalLaneOffset().
|
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 99 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetGlobalPercentageSpeedDifference().
|
inline |
Method to set hybrid physics mode.
Definition at line 217 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetHybridPhysicsMode().
|
inline |
Method to set hybrid physics mode.
Definition at line 223 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetHybridPhysicsRadius().
|
inline |
Method to set our own imported route.
Definition at line 259 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetImportedRoute().
|
inline |
Method to set % to keep on the right lane.
Definition at line 199 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetKeepRightPercentage().
|
inline |
Method to set a lane offset displacement from the center line.
Positive values imply a right offset while negative ones mean a left one.
Definition at line 86 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetLaneOffset().
|
inline |
Method to set boundaries for respawning vehicles.
Definition at line 289 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetMaxBoundaries().
|
inline |
Method to set Open Street Map mode.
Definition at line 235 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetOSMMode().
|
inline |
Method to specify the % chance of ignoring collisions with any vehicle.
Definition at line 150 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageIgnoreVehicles().
|
inline |
Method to specify the % chance of ignoring collisions with any walker.
Definition at line 144 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageIgnoreWalkers().
|
inline |
Method to specify the % chance of running a traffic sign.
Definition at line 156 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageRunningLight().
|
inline |
Method to specify the % chance of running any traffic sign.
Definition at line 162 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetPercentageRunningSign().
|
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().
|
inline |
Method to set randomization seed.
Definition at line 229 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetRandomDeviceSeed().
|
inline |
Method to set % to randomly do a left lane change.
Definition at line 205 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetRandomLeftLaneChangePercentage().
|
inline |
Method to set % to randomly do a right lane change.
Definition at line 211 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetRandomRightLaneChangePercentage().
|
inline |
Method to set automatic respawn of dormant vehicles.
Definition at line 277 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetRespawnDormantVehicles().
|
inline |
Set parameters.
Definition at line 54 of file TrafficManagerClient.h.
|
inline |
Method to switch traffic manager into synchronous execution.
Definition at line 168 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetSynchronousMode().
|
inline |
Method to set tick timeout for synchronous execution.
Definition at line 174 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetSynchronousModeTimeOutInMiliSecond().
|
inline |
Method to set the automatic management of the vehicle lights.
Definition at line 112 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::SetUpdateVehicleLights().
|
inline |
Definition at line 308 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::ShutDown().
|
inline |
Method to provide synchronous tick.
Definition at line 180 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
|
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().
|
inline |
Method to update an already set list of points.
Definition at line 271 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::UpdateImportedRoute().
|
inline |
Method to update an already set list of points.
Definition at line 253 of file TrafficManagerClient.h.
References _client, and DEBUG_ASSERT.
Referenced by carla::traffic_manager::TrafficManagerRemote::UpdateUploadPath().
|
private |
RPC client.
Definition at line 316 of file TrafficManagerClient.h.
Referenced by GetActionBuffer(), GetNextAction(), HealthCheckRemoteTM(), RegisterVehicle(), RemoveImportedRoute(), RemoveUploadPath(), SetAutoLaneChange(), SetBoundariesRespawnDormantVehicles(), SetCollisionDetection(), SetCustomPath(), SetDesiredSpeed(), SetDistanceToLeadingVehicle(), SetForceLaneChange(), SetGlobalDistanceToLeadingVehicle(), SetGlobalLaneOffset(), SetGlobalPercentageSpeedDifference(), SetHybridPhysicsMode(), SetHybridPhysicsRadius(), SetImportedRoute(), SetKeepRightPercentage(), SetLaneOffset(), SetMaxBoundaries(), SetOSMMode(), SetPercentageIgnoreVehicles(), SetPercentageIgnoreWalkers(), SetPercentageRunningLight(), SetPercentageRunningSign(), SetPercentageSpeedDifference(), SetRandomDeviceSeed(), SetRandomLeftLaneChangePercentage(), SetRandomRightLaneChangePercentage(), SetRespawnDormantVehicles(), SetSynchronousMode(), SetSynchronousModeTimeOutInMiliSecond(), SetUpdateVehicleLights(), ShutDown(), SynchronousTick(), TrafficManagerClient(), UnregisterVehicle(), UpdateImportedRoute(), UpdateUploadPath(), and ~TrafficManagerClient().
|
private |
Server port and host.
Definition at line 319 of file TrafficManagerClient.h.
Referenced by getServerDetails(), setServerDetails(), and TrafficManagerClient().
|
private |
Definition at line 320 of file TrafficManagerClient.h.
Referenced by getServerDetails(), setServerDetails(), and TrafficManagerClient().