9 #include <condition_variable> 19 namespace traffic_manager {
22 using Path = std::vector<cg::Location>;
23 using Route = std::vector<uint8_t>;
187 std::condition_variable
_cv;
TrafficManagerClient client
Remote client using the IP and port information it connects to as remote RPC traffic manager server...
void SetForceLaneChange(const ActorPtr &actor, const bool direction)
Method to force lane change on a vehicle.
void SetPercentageIgnoreVehicles(const ActorPtr &actor, const float perc)
Method to specify the % chance of ignoring collisions with any vehicle.
void SetAutoLaneChange(const ActorPtr &actor, const bool enable)
Enable/disable automatic lane change on a vehicle.
void SetPercentageRunningSign(const ActorPtr &actor, const float perc)
Method to specify the % chance of running any traffic sign.
std::condition_variable _cv
void SetHybridPhysicsMode(const bool mode_switch)
Method to set hybrid physics mode.
carla::client::detail::EpisodeProxy episodeProxyTM
CARLA client connection object.
void SetSynchronousModeTimeOutInMiliSecond(double time)
Method to set Tick timeout for synchronous execution.
void UpdateImportedRoute(const ActorId &actor_id, const Route route)
Method to update an already set route.
void Stop()
To stop the TrafficManager.
void SetGlobalDistanceToLeadingVehicle(const float distance)
Method to specify Global Distance.
void Reset()
To reset the traffic manager.
carla::SharedPtr< cc::Actor > ActorPtr
void SetHybridPhysicsRadius(const float radius)
Method to set hybrid physics radius.
void UnregisterVehicles(const std::vector< ActorPtr > &actor_list)
This method unregisters a vehicle from traffic manager.
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.
bool SynchronousTick()
Method to provide synchronous tick.
ActionBuffer GetActionBuffer(const ActorId &actor_id)
Method to get the vehicle's action buffer.
std::vector< cg::Location > Path
void SetCollisionDetection(const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision)
Method to set collision detection rules between vehicles.
Action GetNextAction(const ActorId &actor_id)
Method to get the vehicle's next action.
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
This file contains definitions of common data structures used in traffic manager. ...
void RegisterVehicles(const std::vector< ActorPtr > &actor_list)
This method registers a vehicle with the traffic manager.
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 SetGlobalPercentageSpeedDifference(float const percentage)
Method to set a global % decrease in velocity with respect to the speed limit.
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 SetPercentageSpeedDifference(const ActorPtr &actor, const float percentage)
Method to set a vehicle's % decrease in velocity with respect to the speed limit. ...
void SetUpdateVehicleLights(const ActorPtr &actor, const bool do_update)
Method to set the automatic management of the vehicle lights.
void SetLaneOffset(const ActorPtr &actor, const float offset)
Method to set a lane offset displacement from the center line.
void RemoveUploadPath(const ActorId &actor_id, const bool remove_path)
Method to remove a path.
void SetBoundariesRespawnDormantVehicles(const float lower_bound, const float upper_bound)
Method to set boundaries for respawning vehicles.
void SetImportedRoute(const ActorPtr &actor, const Route route, const bool empty_buffer)
Method to set our own imported route.
void Start()
To start the TrafficManager.
void SetRandomRightLaneChangePercentage(const ActorPtr &actor, const float percentage)
Method to set % to randomly do a right lane change.
std::pair< RoadOption, WaypointPtr > Action
virtual ~TrafficManagerRemote()
Destructor.
void SetOSMMode(const bool mode_switch)
Method to set Open Street Map mode.
void UpdateUploadPath(const ActorId &actor_id, const Path path)
Method to update an already set path.
The function of this class is to integrate all the various stages of the traffic manager appropriatel...
std::vector< uint8_t > Route
Provides communication with the rpc of TrafficManagerServer.
void SetMaxBoundaries(const float lower, const float upper)
Method to set limits for boundaries when respawning vehicles.
TrafficManagerRemote(const std::pair< std::string, uint16_t > &_serverTM, carla::client::detail::EpisodeProxy &episodeProxy)
Constructor store remote location information.
void SetDistanceToLeadingVehicle(const ActorPtr &actor, const float distance)
Method to specify how much distance a vehicle should maintain to the leading vehicle.
void Release()
To release the traffic manager.
void RemoveImportedRoute(const ActorId &actor_id, const bool remove_path)
Method to remove a route.
void SetGlobalLaneOffset(float const offset)
Method to set a global lane offset displacement from the center line.
The function of this class is to integrate all the various stages of the traffic manager appropriatel...
void SetKeepRightPercentage(const ActorPtr &actor, const float percentage)
Method to set % to keep on the right lane.
void HealthCheckRemoteTM()
Method to check server is alive or not.
std::vector< Action > ActionBuffer
void SetRandomDeviceSeed(const uint64_t seed)
Method to set randomization seed.
carla::client::detail::EpisodeProxy & GetEpisodeProxy()
Get CARLA episode information.
void SetRandomLeftLaneChangePercentage(const ActorPtr &actor, const float percentage)
Method to set % to randomly do a left lane change.