12#include <unordered_map>
23 namespace traffic_manager {
29 using Path = std::vector<cg::Location>;
30 using Route = std::vector<uint8_t>;
134 const bool detect_collision);
一个线程安全的、基于unordered_map的原子映射类。
float GetRandomLeftLaneChangePercentage(const ActorId &actor_id)
查询车辆随机右变道百分比概率的方法
std::atomic< float > respawn_lower_bound
相对于主角车辆的最小重生距离
float GetPercentageIgnoreWalkers(const ActorId &actor_id) const
获取百分比以忽略任何步行者的方法
AtomicMap< ActorId, ChangeLaneInfo > force_lane_change
强制换道命令映射
ChangeLaneInfo GetForceLaneChange(const ActorId &actor_id)
查询车辆变道指令的方法
AtomicMap< ActorId, bool > auto_lane_change
自动换道命令映射
float GetLaneOffset(const ActorId &actor_id) const
查询车辆车道偏移量的方法
AtomicMap< ActorId, bool > upload_path
是否导入自定义路径的参数映射
void SetLaneOffset(const ActorPtr &actor, const float offset)
设置车道偏移量,从中心线开始的位移 正值表示向右偏移,负值表示向左偏移
float GetDistanceToLeadingVehicle(const ActorId &actor_id) const
查询给定车辆与前方车辆之间距离的方法
void SetImportedRoute(const ActorPtr &actor, const Route route, const bool empty_buffer)
设置自定义路线的方法
bool GetCollisionDetection(const ActorId &reference_actor_id, const ActorId &other_actor_id) const
查询一对车辆之间避碰规则的方法
void SetHybridPhysicsRadius(const float radius)
设置混合物理半径的方法
Route GetImportedRoute(const ActorId &actor_id) const
获取自定义路由的方法
float global_lane_offset
全局车道偏移
float global_percentage_difference_from_limit
全局目标速度限制差异百分比
std::atomic< bool > synchronous_mode
同步开关
double GetSynchronousModeTimeOutInMiliSecond() const
获取同步模式超时
std::atomic< float > distance_margin
距离边距
std::chrono::duration< double, std::milli > synchronous_time_out
同步模式超时变量
std::atomic< float > hybrid_physics_radius
混合物理半径
bool GetUploadRoute(const ActorId &actor_id) const
获取是否正在上传路线的方法
void UpdateUploadPath(const ActorId &actor_id, const Path path)
更新已设置的点列表的方法
float GetKeepRightPercentage(const ActorId &actor_id)
查询车辆保持右侧规则的百分比概率的方法
bool GetOSMMode() const
获取Open Street Map模式的方法
void SetRandomLeftLaneChangePercentage(const ActorPtr &actor, const float percentage)
设置随机向左换道的概率的方法
void SetGlobalDistanceToLeadingVehicle(const float dist)
设置所有注册车辆应保持与前车的距离的方法
AtomicMap< ActorId, float > perc_random_left
随机左换道百分比映射
AtomicMap< ActorId, float > perc_keep_right
靠右行驶规则百分比映射
AtomicMap< ActorId, float > perc_ignore_walkers
忽略行人百分比映射
float GetHybridPhysicsRadius() const
获取混合物理半径的方法
void UpdateImportedRoute(const ActorId &actor_id, const Route route)
更新已设置路线的方法
float GetVehicleTargetVelocity(const ActorId &actor_id, const float speed_limit) const
查询车辆目标速度的方法
void SetGlobalLaneOffset(float const offset)
设置全局车道偏移量,从中心线开始的位移 正值表示向右偏移,负值表示向左偏移
AtomicMap< ActorId, float > exact_desired_speed
基于期望速度的单个车辆目标速度映射
AtomicMap< ActorId, bool > upload_route
是否导入自定义路线的参数映射
bool GetUploadPath(const ActorId &actor_id) const
获取是否正在上传路径的方法
float min_lower_bound
相对于主角车辆的最小可能重生距离
void SetDistanceToLeadingVehicle(const ActorPtr &actor, const float distance)
设置车辆应保持与前车距离的方法
float GetUpperBoundaryRespawnDormantVehicles() const
获取车辆重生时与英雄车辆之间最大距离的方法
float GetRandomRightLaneChangePercentage(const ActorId &actor_id)
查询车辆随机向左变道百分比概率的方法
void SetForceLaneChange(const ActorPtr &actor, const bool direction)
强制车辆换道的方法 方向标志可以设置为true表示向左,false表示向右
AtomicMap< ActorId, float > perc_run_traffic_light
闯交通信号灯百分比映射
float GetLowerBoundaryRespawnDormantVehicles() const
获取车辆重生时与英雄车辆之间最小距离的方法
void SetPercentageRunningSign(const ActorPtr &actor, const float perc)
设置无视交通标志的概率的方法
void SetCustomPath(const ActorPtr &actor, const Path path, const bool empty_buffer)
设置自定义路径的方法
std::atomic< bool > hybrid_physics_mode
混合物理模式开关
void RemoveImportedRoute(const ActorId &actor_id, const bool remove_path)
移除路线的方法
bool GetAutoLaneChange(const ActorId &actor_id) const
查询车辆自动变道规则的方法
void SetPercentageIgnoreVehicles(const ActorPtr &actor, const float perc)
设置无视其他车辆的概率的方法
void SetKeepRightPercentage(const ActorPtr &actor, const float percentage)
设置强制靠右行驶的概率的方法
void SetMaxBoundaries(const float lower, const float upper)
设置重生休眠车辆时的边界限制的方法
void SetSynchronousModeTimeOutInMiliSecond(const double time)
设置同步模式超时时间
void SetHybridPhysicsMode(const bool mode_switch)
设置混合物理模式的方法
AtomicMap< ActorId, float > perc_random_right
随机右换道百分比映射
float GetPercentageRunningSign(const ActorId &actor_id) const
获取百分比以运行任何交通灯的方法
void SetCollisionDetection(const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision)
设置车辆之间的碰撞检测规则的方法
bool GetRespawnDormantVehicles() const
获取是否自动重生载具的方法
AtomicMap< ActorId, std::shared_ptr< AtomicActorSet > > ignore_collision
在碰撞检测期间要忽略的演员集合映射
void SetPercentageRunningLight(const ActorPtr &actor, const float perc)
设置无视交通信号灯的概率的方法
AtomicMap< ActorId, float > perc_run_traffic_sign
闯交通标志百分比映射
void SetRespawnDormantVehicles(const bool mode_switch)
设置是否自动重生休眠车辆的方法
std::atomic< bool > osm_mode
Open Street Map模式参数
Path GetCustomPath(const ActorId &actor_id) const
获取自定义路径的方法
void SetAutoLaneChange(const ActorPtr &actor, const bool enable)
启用/禁用车辆的自动换道功能
AtomicMap< ActorId, float > distance_to_leading_vehicle
到前导车辆的距离映射
float GetPercentageIgnoreVehicles(const ActorId &actor_id) const
方法获取百分比以忽略任何车辆
void SetDesiredSpeed(const ActorPtr &actor, const float value)
设置车辆的精确期望速度
void RemoveUploadPath(const ActorId &actor_id, const bool remove_path)
移除一组点的方法
bool GetSynchronousMode() const
获取同步模式的方法
void SetGlobalPercentageSpeedDifference(float const percentage)
设置全局相对于速度限制的速度降低百分比 如果小于0,则表示速度增加百分比
std::atomic< bool > respawn_dormant_vehicles
自动重生模式开关
AtomicMap< ActorId, float > lane_offset
单个车辆的车道偏移映射
void SetPercentageIgnoreWalkers(const ActorPtr &actor, const float perc)
设置无视其他车辆的概率的方法
float GetPercentageRunningLight(const ActorId &actor_id) const
获取百分比以运行任何交通灯的方法
void SetBoundariesRespawnDormantVehicles(const float lower_bound, const float upper_bound)
设置重生休眠车辆的边界的方法
bool GetUpdateVehicleLights(const ActorId &actor_id) const
获取车辆灯光是否应自动更新的方法
void SetRandomRightLaneChangePercentage(const ActorPtr &actor, const float percentage)
设置随机向右换道的概率的方法
void SetPercentageSpeedDifference(const ActorPtr &actor, const float percentage)
设置车辆相对于速度限制的速度降低百分比 如果小于0,则表示速度增加百分比
AtomicMap< ActorId, bool > auto_update_vehicle_lights
车辆灯光自动更新标志映射
std::atomic< float > respawn_upper_bound
相对于主角车辆的最大重生距离
AtomicMap< ActorId, Route > custom_route
存储所有自定义路线的结构
AtomicMap< ActorId, float > perc_ignore_vehicles
忽略车辆百分比映射
AtomicMap< ActorId, float > percentage_difference_from_speed_limit
基于速度限制差异的单个车辆目标速度映射
void SetOSMMode(const bool mode_switch)
设置Open Street Map模式的方法
AtomicMap< ActorId, Path > custom_path
存储所有自定义路径的结构
bool GetHybridPhysicsMode() const
获取混合物理模式的方法
void SetSynchronousMode(const bool mode_switch=true)
设置同步模式的方法
void SetUpdateVehicleLights(const ActorPtr &actor, const bool do_update)
设置是否自动更新车辆灯光状态的方法
float max_upper_bound
相对于主角车辆的最大可能重生距离
carla::SharedPtr< cc::Actor > ActorPtr
使用别名简化代码中的命名
std::vector< uint8_t > Route
路线类型,由一系列地理位置组成
std::vector< cg::Location > Path
参与者的唯一标识符类型
carla::ActorId ActorId
参与者的智能指针类型
boost::shared_ptr< T > SharedPtr
使用这个SharedPtr(boost::shared_ptr)以保持与boost::python的兼容性, 但未来如果可能的话,我们希望能为std::shared_ptr制作一个Python适配器。