24namespace traffic_manager {
26using namespace constants::HybridMode;
27using namespace constants::VehicleRemoval;
29namespace chr = std::chrono;
34using ParticipantMap = std::unordered_map<ActorId, ActorPtr>;
35using IdleTimeMap = std::unordered_map<ActorId, double>;
44 AtomicActorSet ®istered_vehicles;
45 ParticipantMap unregistered_participants;
47 IdleTimeMap idle_time;
48 ParticipantMap hero_participants;
49 TrackTraffic &track_traffic;
50 std::vector<ActorId>& marked_for_removal;
51 const Parameters ¶meters;
54 SimulationState &simulation_state;
55 LocalizationStage &localization_stage;
56 CollisionStage &collision_stage;
57 TrafficLightStage &traffic_light_stage;
58 MotionPlanStage &motion_plan_stage;
59 VehicleLightStage &vehicle_light_stage;
60 double elapsed_last_participant_destruction {0.0};
62 std::unordered_map<ActorId, bool> has_physics_enabled;
65 void UpdateIdleTime(std::pair<ActorId, double>& max_idle_time,
const ActorId& actor_id);
68 bool IsVehicleStuck(
const ActorId& actor_id);
71 void IdentifyNewParticipants(
const ParticipantList &participant_list);
73 using DestroyeddParticipants = std::pair<ActorIdSet, ActorIdSet>;
76 DestroyeddParticipants IdentifyDestroyedParticipants(
const ParticipantList &participant_list);
78 using IdleInfo = std::pair<ActorId, double>;
79 void UpdateRegisteredParticipantsData(
const bool hybrid_physics_mode, IdleInfo &max_idle_time);
82 void UpdateData(
const bool hybrid_physics_mode,
const Actor &vehicle,
83 const bool hero_actor_present,
const float physics_radius_square);
86 void UpdateUnregisteredParticipantsData();
90 ALSM(AtomicActorSet ®istered_vehicles,
91 BufferMap &buffer_map,
92 TrackTraffic &track_traffic,
93 std::vector<ActorId>& marked_for_removal,
94 const Parameters ¶meters,
96 const LocalMapPtr &local_map,
97 SimulationState &simulation_state,
98 LocalizationStage &localization_stage,
99 CollisionStage &collision_stage,
100 TrafficLightStage &traffic_light_stage,
101 MotionPlanStage &motion_plan_stage,
102 VehicleLightStage &vehicle_light_stage);
108 void RemoveParticipant(
const ActorId actor_id,
const bool registered_actor);
TSharedPtr< const FActorInfo > carla::rpc::ActorState UWorld Actor
std::shared_ptr< InMemoryMap > LocalMapPtr
本地地图指针类型,使用智能指针管理InMemoryMap对象
std::unordered_map< carla::ActorId, Buffer > BufferMap
boost::shared_ptr< T > SharedPtr
使用这个SharedPtr(boost::shared_ptr)以保持与boost::python的兼容性, 但未来如果可能的话,我们希望能为std::shared_ptr制作一个Python适配器。