12#include <unordered_map>
23namespace traffic_manager {
29using Path = std::vector<cg::Location>;
30using Route = std::vector<uint8_t>;
132 const bool detect_collision);
float GetRandomLeftLaneChangePercentage(const ActorId &actor_id)
Method to query percentage probability of a random right lane change for a vehicle.
std::atomic< float > respawn_lower_bound
Minimum distance to respawn vehicles with respect to the hero vehicle.
float GetPercentageIgnoreWalkers(const ActorId &actor_id) const
Method to get % to ignore any walker.
AtomicMap< ActorId, ChangeLaneInfo > force_lane_change
Map containing force lane change commands.
ChangeLaneInfo GetForceLaneChange(const ActorId &actor_id)
Method to query lane change command for a vehicle.
AtomicMap< ActorId, bool > auto_lane_change
Map containing auto lane change commands.
float GetLaneOffset(const ActorId &actor_id) const
Method to query lane offset for a vehicle.
AtomicMap< ActorId, bool > upload_path
Parameter specifying if importing a custom path.
void SetLaneOffset(const ActorPtr &actor, const float offset)
Method to set a lane offset displacement from the center line.
float GetDistanceToLeadingVehicle(const ActorId &actor_id) const
Method to query distance to leading vehicle for a given vehicle.
void SetImportedRoute(const ActorPtr &actor, const Route route, const bool empty_buffer)
Method to set our own imported route.
bool GetCollisionDetection(const ActorId &reference_actor_id, const ActorId &other_actor_id) const
Method to query collision avoidance rule between a pair of vehicles.
void SetHybridPhysicsRadius(const float radius)
Method to set hybrid physics radius.
Route GetImportedRoute(const ActorId &actor_id) const
Method to get a custom route.
float global_lane_offset
Global lane offset
float global_percentage_difference_from_limit
Global target velocity limit % difference.
std::atomic< bool > synchronous_mode
Synchronous mode switch.
double GetSynchronousModeTimeOutInMiliSecond() const
Get synchronous mode time out
std::atomic< float > distance_margin
Distance margin
std::chrono::duration< double, std::milli > synchronous_time_out
Synchronous mode time out variable.
std::atomic< float > hybrid_physics_radius
Hybrid physics radius.
bool GetUploadRoute(const ActorId &actor_id) const
Method to get if we are uploading a route.
void UpdateUploadPath(const ActorId &actor_id, const Path path)
Method to update an already set list of points.
float GetKeepRightPercentage(const ActorId &actor_id)
Method to query percentage probability of keep right rule for a vehicle.
bool GetOSMMode() const
Method to get Open Street Map mode.
void SetRandomLeftLaneChangePercentage(const ActorPtr &actor, const float percentage)
Method to set % to randomly do a left lane change.
void SetGlobalDistanceToLeadingVehicle(const float dist)
Method to set the distance to leading vehicle for all registered vehicles.
AtomicMap< ActorId, float > perc_random_left
Map containing % of random left lane change.
AtomicMap< ActorId, float > perc_keep_right
Map containing % of keep right rule.
AtomicMap< ActorId, float > perc_ignore_walkers
Map containing % of ignoring walkers.
float GetHybridPhysicsRadius() const
Method to retrieve hybrid physics radius.
void UpdateImportedRoute(const ActorId &actor_id, const Route route)
Method to update an already set route.
float GetVehicleTargetVelocity(const ActorId &actor_id, const float speed_limit) const
Method to query target velocity for a vehicle.
void SetGlobalLaneOffset(float const offset)
Method to set a global lane offset displacement from the center line.
AtomicMap< ActorId, float > exact_desired_speed
Target velocity map for individual vehicles, based on a desired velocity.
AtomicMap< ActorId, bool > upload_route
Parameter specifying if importing a custom route.
bool GetUploadPath(const ActorId &actor_id) const
Method to get if we are uploading a path.
float min_lower_bound
Minimum possible distance to respawn vehicles with respect to the hero vehicle.
void SetDistanceToLeadingVehicle(const ActorPtr &actor, const float distance)
Method to specify how much distance a vehicle should maintain to the leading vehicle.
float GetUpperBoundaryRespawnDormantVehicles() const
Method to retrieve maximum distance from hero vehicle when respawning vehicles.
float GetRandomRightLaneChangePercentage(const ActorId &actor_id)
Method to query percentage probability of a random left lane change for a vehicle.
void SetForceLaneChange(const ActorPtr &actor, const bool direction)
Method to force lane change on a vehicle.
AtomicMap< ActorId, float > perc_run_traffic_light
Map containing % of running a traffic light.
float GetLowerBoundaryRespawnDormantVehicles() const
Method to retrieve minimum distance from hero vehicle when respawning vehicles.
void SetPercentageRunningSign(const ActorPtr &actor, const float perc)
Method to set % to run any traffic sign.
void SetCustomPath(const ActorPtr &actor, const Path path, const bool empty_buffer)
Method to set our own imported path.
std::atomic< bool > hybrid_physics_mode
Hybrid physics mode switch.
void RemoveImportedRoute(const ActorId &actor_id, const bool remove_path)
Method to remove a route.
bool GetAutoLaneChange(const ActorId &actor_id) const
Method to query auto lane change rule for a vehicle.
void SetPercentageIgnoreVehicles(const ActorPtr &actor, const float perc)
Method to set % to ignore any vehicle.
void SetKeepRightPercentage(const ActorPtr &actor, const float percentage)
Method to set % to keep on the right lane.
void SetMaxBoundaries(const float lower, const float upper)
Method to set limits for boundaries when respawning vehicles.
void SetSynchronousModeTimeOutInMiliSecond(const double time)
Set Synchronous mode time out.
void SetHybridPhysicsMode(const bool mode_switch)
Method to set hybrid physics mode.
AtomicMap< ActorId, float > perc_random_right
Map containing % of random right lane change.
float GetPercentageRunningSign(const ActorId &actor_id) const
Method to get % to run any traffic light.
void SetCollisionDetection(const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision)
Method to set collision detection rules between vehicles.
bool GetRespawnDormantVehicles() const
Method to retrieve if we are automatically respawning vehicles.
AtomicMap< ActorId, std::shared_ptr< AtomicActorSet > > ignore_collision
Map containing a set of actors to be ignored during collision detection.
void SetPercentageRunningLight(const ActorPtr &actor, const float perc)
Method to set % to run any traffic light.
AtomicMap< ActorId, float > perc_run_traffic_sign
Map containing % of running a traffic sign.
void SetRespawnDormantVehicles(const bool mode_switch)
Method to set if we are automatically respawning vehicles.
std::atomic< bool > osm_mode
Parameter specifying Open Street Map mode.
Path GetCustomPath(const ActorId &actor_id) const
Method to get a custom path.
void SetAutoLaneChange(const ActorPtr &actor, const bool enable)
Enable/disable automatic lane change on a vehicle.
AtomicMap< ActorId, float > distance_to_leading_vehicle
Map containing distance to leading vehicle command.
float GetPercentageIgnoreVehicles(const ActorId &actor_id) const
Method to get % to ignore any vehicle.
void SetDesiredSpeed(const ActorPtr &actor, const float value)
Set a vehicle's exact desired velocity.
void RemoveUploadPath(const ActorId &actor_id, const bool remove_path)
Method to remove a list of points.
bool GetSynchronousMode() const
Method to get synchronous mode.
void SetGlobalPercentageSpeedDifference(float const percentage)
Set a global % decrease in velocity with respect to the speed limit.
std::atomic< bool > respawn_dormant_vehicles
Automatic respawn mode switch.
AtomicMap< ActorId, float > lane_offset
Lane offset map for individual vehicles.
void SetPercentageIgnoreWalkers(const ActorPtr &actor, const float perc)
Method to set % to ignore any vehicle.
float GetPercentageRunningLight(const ActorId &actor_id) const
Method to get % to run any traffic light.
void SetBoundariesRespawnDormantVehicles(const float lower_bound, const float upper_bound)
Method to set boundaries for respawning vehicles.
bool GetUpdateVehicleLights(const ActorId &actor_id) const
Method to get if the vehicle lights should be updates automatically
void SetRandomRightLaneChangePercentage(const ActorPtr &actor, const float percentage)
Method to set % to randomly do a right lane change.
void SetPercentageSpeedDifference(const ActorPtr &actor, const float percentage)
Set a vehicle's % decrease in velocity with respect to the speed limit.
AtomicMap< ActorId, bool > auto_update_vehicle_lights
Map containing the automatic vehicle lights update flag
std::atomic< float > respawn_upper_bound
Maximum distance to respawn vehicles with respect to the hero vehicle.
AtomicMap< ActorId, Route > custom_route
Structure to hold all custom routes.
AtomicMap< ActorId, float > perc_ignore_vehicles
Map containing % of ignoring vehicles.
AtomicMap< ActorId, float > percentage_difference_from_speed_limit
Target velocity map for individual vehicles, based on a % diffrerence from speed limit.
void SetOSMMode(const bool mode_switch)
Method to set Open Street Map mode.
AtomicMap< ActorId, Path > custom_path
Structure to hold all custom paths.
bool GetHybridPhysicsMode() const
Method to retrieve hybrid physics mode.
void SetSynchronousMode(const bool mode_switch=true)
Method to set synchronous mode.
void SetUpdateVehicleLights(const ActorPtr &actor, const bool do_update)
Method to set the automatic vehicle light state update flag.
float max_upper_bound
Maximum possible distance to respawn vehicles with respect to the hero vehicle.
carla::SharedPtr< cc::Actor > ActorPtr
std::vector< uint8_t > Route
std::vector< cg::Location > Path
This file contains definitions of common data structures used in traffic manager.
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...