14 namespace traffic_manager {
17 using Path = std::vector<cg::Location>;
18 using Route = std::vector<uint8_t>;
20 using Action = std::pair<RoadOption, WaypointPtr>;
30 virtual void Start() = 0;
33 virtual void Stop() = 0;
39 virtual void Reset() = 0;
135 virtual void SetOSMMode(
const bool mode_switch) = 0;
virtual void SetHybridPhysicsMode(const bool mode_switch)=0
Method to set hybrid physics mode.
virtual void SetAutoLaneChange(const ActorPtr &actor, const bool enable)=0
Enable/disable automatic lane change on a vehicle.
virtual void Start()=0
To start the traffic manager.
virtual void SetForceLaneChange(const ActorPtr &actor, const bool direction)=0
Method to force lane change on a vehicle.
virtual bool SynchronousTick()=0
Method to provide synchronous tick.
TrafficManagerBase()
Protected constructor for singleton lifecycle management.
carla::SharedPtr< cc::Actor > ActorPtr
virtual void SetGlobalDistanceToLeadingVehicle(const float dist)=0
Method to set Global Distance to Leading Vehicle.
virtual void SetPercentageIgnoreWalkers(const ActorPtr &actor, const float perc)=0
Method to specify the % chance of ignoring collisions with any walker.
virtual void Release()=0
To release the traffic manager.
std::vector< cg::Location > Path
virtual void SetMaxBoundaries(const float lower, const float upper)=0
Method to set limits for boundaries when respawning vehicles.
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. ...
virtual void SetPercentageSpeedDifference(const ActorPtr &actor, const float percentage)=0
Set a vehicle's % decrease in velocity with respect to the speed limit.
virtual void UnregisterVehicles(const std::vector< ActorPtr > &actor_list)=0
This method unregisters a vehicle from traffic manager.
virtual Action GetNextAction(const ActorId &actor_id)=0
Method to get the vehicle's next action.
virtual void SetRandomLeftLaneChangePercentage(const ActorPtr &actor, const float percentage)=0
Method to set % to randomly do a left lane change.
virtual void RemoveImportedRoute(const ActorId &actor_id, const bool remove_path)=0
Method to remove a route.
virtual void SetImportedRoute(const ActorPtr &actor, const Route route, const bool empty_buffer)=0
Method to set our own imported route.
virtual ~TrafficManagerBase()
Destructor.
std::pair< RoadOption, WaypointPtr > Action
virtual void SetOSMMode(const bool mode_switch)=0
Method to set Open Street Map mode.
virtual void RemoveUploadPath(const ActorId &actor_id, const bool remove_path)=0
Method to remove a path.
virtual void SetGlobalPercentageSpeedDifference(float const percentage)=0
Set a global % decrease in velocity with respect to the speed limit.
virtual void SetKeepRightPercentage(const ActorPtr &actor, const float percentage)=0
Method to set % to keep on the right lane.
carla::SharedPtr< cc::Waypoint > WaypointPtr
The function of this class is to integrate all the various stages of the traffic manager appropriatel...
virtual void SetDistanceToLeadingVehicle(const ActorPtr &actor, const float distance)=0
Method to specify how much distance a vehicle should maintain to the leading vehicle.
virtual void SetUpdateVehicleLights(const ActorPtr &actor, const bool do_update)=0
Method to set the automatic management of the vehicle lights.
virtual void Stop()=0
To stop the traffic manager.
virtual void SetPercentageIgnoreVehicles(const ActorPtr &actor, const float perc)=0
Method to specify the % chance of ignoring collisions with any vehicle.
virtual void SetCustomPath(const ActorPtr &actor, const Path path, const bool empty_buffer)=0
Method to set our own imported path.
virtual void SetGlobalLaneOffset(float const offset)=0
Method to set a global lane offset displacement from the center line.
std::vector< uint8_t > Route
virtual void Reset()=0
To reset the traffic manager.
virtual void SetRespawnDormantVehicles(const bool mode_switch)=0
Method to set automatic respawn of dormant vehicles.
virtual void UpdateUploadPath(const ActorId &actor_id, const Path path)=0
Method to update an already set path.
virtual void SetCollisionDetection(const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision)=0
Method to set collision detection rules between vehicles.
virtual void SetPercentageRunningLight(const ActorPtr &actor, const float perc)=0
Method to specify the % chance of running any traffic light.
virtual void UpdateImportedRoute(const ActorId &actor_id, const Route route)=0
Method to update an already set route.
virtual void SetHybridPhysicsRadius(const float radius)=0
Method to set hybrid physics radius.
virtual void SetLaneOffset(const ActorPtr &actor, const float offset)=0
Method to set a lane offset displacement from the center line.
virtual void SetRandomDeviceSeed(const uint64_t seed)=0
Method to set randomization seed.
virtual void SetDesiredSpeed(const ActorPtr &actor, const float value)=0
Set a vehicle's exact desired velocity.
std::vector< Action > ActionBuffer
virtual void SetSynchronousModeTimeOutInMiliSecond(double time)=0
Method to set Tick timeout for synchronous execution.
virtual void SetBoundariesRespawnDormantVehicles(const float lower_bound, const float upper_bound)=0
Method to set boundaries for respawning vehicles.
virtual void SetPercentageRunningSign(const ActorPtr &actor, const float perc)=0
Method to specify the % chance of running any traffic sign.
virtual void ShutDown()=0
virtual ActionBuffer GetActionBuffer(const ActorId &actor_id)=0
Method to get the vehicle's action buffer.
virtual void SetSynchronousMode(bool mode)=0
Method to switch traffic manager into synchronous execution.
virtual void RegisterVehicles(const std::vector< ActorPtr > &actor_list)=0
This method registers a vehicle with the traffic manager.
virtual void SetRandomRightLaneChangePercentage(const ActorPtr &actor, const float percentage)=0
Method to set % to randomly do a right lane change.
virtual carla::client::detail::EpisodeProxy & GetEpisodeProxy()=0
Get carla episode information.