This class integrates all the various stages of the traffic manager appropriately using messengers. 更多...
#include <TrafficManager.h>
Public 成员函数 | |
ActionBuffer | GetActionBuffer (const ActorId &actor_id) |
Method to get the action buffer. | |
Action | GetNextAction (const ActorId &actor_id) |
Method to get the next action. | |
bool | IsValidPort () const |
TrafficManager & | operator= (const TrafficManager &)=default |
TrafficManager & | operator= (TrafficManager &&)=default |
uint16_t | Port () const |
void | RegisterVehicles (const std::vector< ActorPtr > &actor_list) |
This method registers a vehicle with 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 | 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 Set Global distance to Leading vehicle | |
void | SetGlobalLaneOffset (float const offset) |
Method to set a global lane offset displacement from the center line. | |
void | SetGlobalPercentageSpeedDifference (float const percentage) |
Set a global % decrease in velocity with respect to the speed limit. | |
void | SetHybridPhysicsMode (const bool mode_switch) |
This method sets the hybrid physics mode. | |
void | SetHybridPhysicsRadius (const float radius) |
This method sets the hybrid physics radius. | |
void | SetImportedRoute (const ActorPtr &actor, const Route route, const bool empty_buffer) |
Method to set our own imported route. | |
void | SetKeepRightPercentage (const ActorPtr &actor, const float percentage) |
Method to set % to keep on the right lane. | |
void | SetLaneOffset (const ActorPtr &actor, const float offset) |
Method to set a lane offset displacement from the center line. | |
void | SetMaxBoundaries (const float lower, const float upper) |
Method to set boundaries for 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 a light. | |
void | SetPercentageRunningSign (const ActorPtr &actor, const float perc) |
Method to specify the % chance of running a sign. | |
void | SetPercentageSpeedDifference (const ActorPtr &actor, const float percentage) |
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 if we are automatically respawning 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) |
Set the automatic management of the vehicle lights | |
void | ShutDown () |
bool | SynchronousTick () |
Method to provide synchronous tick. | |
TrafficManager () | |
TrafficManager (carla::client::detail::EpisodeProxy episode_proxy, uint16_t port=TM_DEFAULT_PORT) | |
Public constructor for singleton life cycle management. | |
TrafficManager (const TrafficManager &other) | |
TrafficManager (TrafficManager &&)=default | |
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. | |
静态 Public 成员函数 | |
static void | Release () |
static void | Reset () |
static void | Tick () |
Private 成员函数 | |
bool | CreateTrafficManagerClient (carla::client::detail::EpisodeProxy episode_proxy, uint16_t port) |
void | CreateTrafficManagerServer (carla::client::detail::EpisodeProxy episode_proxy, uint16_t port) |
TrafficManagerBase * | GetTM (uint16_t port) const |
Private 属性 | |
uint16_t | _port = 0 |
静态 Private 属性 | |
static std::mutex | _mutex |
static std::map< uint16_t, TrafficManagerBase * > | _tm_map |
This class integrates all the various stages of the traffic manager appropriately using messengers.
在文件 TrafficManager.h 第 26 行定义.
|
explicit |
Public constructor for singleton life cycle management.
在文件 TrafficManager.cpp 第 31 行定义.
引用了 _port, CreateTrafficManagerClient(), CreateTrafficManagerServer() , 以及 GetTM().
|
inline |
在文件 TrafficManager.h 第 34 行定义.
引用了 _port.
|
inline |
在文件 TrafficManager.h 第 38 行定义.
|
default |
|
private |
Get TM server info (Remote IP & PORT)
Set remote TM server IP and port
Try to connect to remote TM server
Check memory allocated or not
Try to reset all traffic lights
Set the pointer of the instance
If Connection error occurred
Clear previously allocated memory
在文件 TrafficManager.cpp 第 176 行定义.
引用了 _tm_map, carla::traffic_manager::TrafficManagerRemote::HealthCheckRemoteTM() , 以及 carla::client::detail::EpisodeProxyImpl< PointerT >::Lock().
被这些函数引用 TrafficManager().
|
private |
Define local constants
Create local instance of TM
Get TM server info (Local IP & PORT)
Set this client as the TM to server
Set the pointer of the instance
在文件 TrafficManager.cpp 第 82 行定义.
引用了 _tm_map, carla::traffic_manager::constants::SpeedThreshold::INITIAL_PERCENTAGE_SPEED_DIFFERENCE, IP_DATA_BUFFER_SIZE, carla::traffic_manager::constants::PID::LATERAL_HIGHWAY_PARAM, carla::traffic_manager::constants::PID::LATERAL_PARAM, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), carla::traffic_manager::constants::PID::LONGITUDIAL_HIGHWAY_PARAM, carla::traffic_manager::constants::PID::LONGITUDIAL_PARAM , 以及 SOCK_INVALID_INDEX.
被这些函数引用 TrafficManager().
|
inline |
Method to get the action buffer.
在文件 TrafficManager.h 第 368 行定义.
引用了 _port, carla::traffic_manager::TrafficManagerBase::GetActionBuffer() , 以及 GetTM().
Method to get the next action.
在文件 TrafficManager.h 第 357 行定义.
引用了 _port, carla::traffic_manager::TrafficManagerBase::GetNextAction() , 以及 GetTM().
|
inlineprivate |
在文件 TrafficManager.h 第 389 行定义.
被这些函数引用 GetActionBuffer(), GetNextAction(), RegisterVehicles(), 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(), TrafficManager(), UnregisterVehicles(), UpdateImportedRoute() , 以及 UpdateUploadPath().
|
inline |
在文件 TrafficManager.h 第 55 行定义.
引用了 _port.
|
default |
|
default |
|
inline |
在文件 TrafficManager.h 第 51 行定义.
引用了 _port.
|
inline |
This method registers a vehicle with the traffic manager.
在文件 TrafficManager.h 第 156 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::RegisterVehicles().
被这些函数引用 carla::client::Vehicle::SetAutopilot().
|
static |
在文件 TrafficManager.cpp 第 45 行定义.
被这些函数引用 carla::client::detail::Episode::OnEpisodeStarted().
|
inline |
Method to remove a route.
在文件 TrafficManager.h 第 101 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::RemoveImportedRoute().
|
inline |
Method to remove a path.
在文件 TrafficManager.h 第 77 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::RemoveUploadPath().
|
static |
在文件 TrafficManager.cpp 第 55 行定义.
被这些函数引用 carla::client::detail::Episode::OnEpisodeChanged().
|
inline |
Enable/disable automatic lane change on a vehicle.
在文件 TrafficManager.h 第 241 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetAutoLaneChange().
|
inline |
Method to set boundaries for respawning vehicles.
在文件 TrafficManager.h 第 124 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetBoundariesRespawnDormantVehicles().
|
inline |
Method to set collision detection rules between vehicles.
在文件 TrafficManager.h 第 224 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetCollisionDetection().
|
inline |
Method to set our own imported path.
在文件 TrafficManager.h 第 69 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetCustomPath().
|
inline |
Set a vehicle's exact desired velocity.
在文件 TrafficManager.h 第 190 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetDesiredSpeed().
|
inline |
Method to specify how much distance a vehicle should maintain to the leading vehicle.
在文件 TrafficManager.h 第 250 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetDistanceToLeadingVehicle().
|
inline |
Method to force lane change on a vehicle.
Direction flag can be set to true for left and false for right.
在文件 TrafficManager.h 第 233 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetForceLaneChange().
|
inline |
Method to Set Global distance to Leading vehicle
在文件 TrafficManager.h 第 315 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::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.
在文件 TrafficManager.h 第 208 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetGlobalLaneOffset().
|
inline |
Set a global % decrease in velocity with respect to the speed limit.
If less than 0, it's a % increase.
在文件 TrafficManager.h 第 199 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetGlobalPercentageSpeedDifference().
|
inline |
This method sets the hybrid physics mode.
在文件 TrafficManager.h 第 140 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetHybridPhysicsMode().
|
inline |
This method sets the hybrid physics radius.
在文件 TrafficManager.h 第 148 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetHybridPhysicsRadius().
|
inline |
Method to set our own imported route.
在文件 TrafficManager.h 第 93 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetImportedRoute().
|
inline |
Method to set % to keep on the right lane.
在文件 TrafficManager.h 第 323 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::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.
在文件 TrafficManager.h 第 182 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetLaneOffset().
|
inline |
Method to set boundaries for respawning vehicles.
在文件 TrafficManager.h 第 132 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetMaxBoundaries().
|
inline |
Method to set Open Street Map mode.
在文件 TrafficManager.h 第 61 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetOSMMode().
|
inline |
Method to specify the % chance of ignoring collisions with any vehicle.
在文件 TrafficManager.h 第 266 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetPercentageIgnoreVehicles().
|
inline |
Method to specify the % chance of ignoring collisions with any walker.
在文件 TrafficManager.h 第 258 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetPercentageIgnoreWalkers().
|
inline |
Method to specify the % chance of running a light.
在文件 TrafficManager.h 第 282 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetPercentageRunningLight().
|
inline |
Method to specify the % chance of running a sign.
在文件 TrafficManager.h 第 274 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetPercentageRunningSign().
|
inline |
Set a vehicle's % decrease in velocity with respect to the speed limit.
If less than 0, it's a % increase.
在文件 TrafficManager.h 第 173 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetPercentageSpeedDifference().
|
inline |
Method to set randomization seed.
在文件 TrafficManager.h 第 347 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetRandomDeviceSeed().
|
inline |
Method to set % to randomly do a left lane change.
在文件 TrafficManager.h 第 331 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetRandomLeftLaneChangePercentage().
|
inline |
Method to set % to randomly do a right lane change.
在文件 TrafficManager.h 第 339 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetRandomRightLaneChangePercentage().
|
inline |
Method to set if we are automatically respawning vehicles.
在文件 TrafficManager.h 第 117 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetRespawnDormantVehicles().
|
inline |
Method to switch traffic manager into synchronous execution.
在文件 TrafficManager.h 第 290 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetSynchronousMode().
|
inline |
Method to set tick timeout for synchronous execution.
在文件 TrafficManager.h 第 298 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetSynchronousModeTimeOutInMiliSecond().
|
inline |
Set the automatic management of the vehicle lights
在文件 TrafficManager.h 第 216 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SetUpdateVehicleLights().
void carla::traffic_manager::TrafficManager::ShutDown | ( | ) |
在文件 TrafficManager.cpp 第 69 行定义.
引用了 _mutex, _port, _tm_map, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::ShutDown().
|
inline |
Method to provide synchronous tick.
在文件 TrafficManager.h 第 306 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::SynchronousTick().
|
static |
|
inline |
This method unregisters a vehicle from traffic manager.
在文件 TrafficManager.h 第 164 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::UnregisterVehicles().
被这些函数引用 carla::client::Vehicle::SetAutopilot().
|
inline |
Method to update an already set route.
在文件 TrafficManager.h 第 109 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::UpdateImportedRoute().
|
inline |
Method to update an already set path.
在文件 TrafficManager.h 第 85 行定义.
引用了 _port, GetTM() , 以及 carla::traffic_manager::TrafficManagerBase::UpdateUploadPath().
|
staticprivate |
在文件 TrafficManager.h 第 399 行定义.
被这些函数引用 GetTM(), Release(), Reset(), ShutDown() , 以及 Tick().
|
private |
在文件 TrafficManager.h 第 401 行定义.
被这些函数引用 GetActionBuffer(), GetNextAction(), IsValidPort(), Port(), RegisterVehicles(), 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(), TrafficManager(), TrafficManager(), UnregisterVehicles(), UpdateImportedRoute() , 以及 UpdateUploadPath().
|
staticprivate |
在文件 TrafficManager.h 第 398 行定义.
被这些函数引用 CreateTrafficManagerClient(), CreateTrafficManagerServer(), GetTM(), Release(), Reset(), ShutDown() , 以及 Tick().