CARLA
 
载入中...
搜索中...
未找到
SimulationState.h
浏览该文件的文档.
1
2#pragma once
3
4#include <unordered_set>
5
7
8namespace carla {
9namespace traffic_manager {
10
16
26using KinematicStateMap = std::unordered_map<ActorId, KinematicState>;
27
32using TrafficLightStateMap = std::unordered_map<ActorId, TrafficLightState>;
33
40using StaticAttributeMap = std::unordered_map<ActorId, StaticAttributes>;
41
42/// This class holds the state of all the vehicles in the simlation.
44
45private:
46 // Structure to hold ids of all actors in the simulation.
47 std::unordered_set<ActorId> actor_set;
48 // Structure containing dynamic motion related state of actors.
50 // Structure containing static attributes of actors.
52 // Structure containing dynamic traffic light related state of actors.
54
55public :
57
58 // Method to add an actor to the simulation state.
59 void AddActor(ActorId actor_id,
60 KinematicState kinematic_state,
61 StaticAttributes attributes,
62 TrafficLightState tl_state);
63
64 // Method to verify if an actor is present currently present in the simulation state.
65 bool ContainsActor(ActorId actor_id) const;
66
67 // Method to remove an actor from simulation state.
68 void RemoveActor(ActorId actor_id);
69
70 // Method to flush all states and actors.
71 void Reset();
72
73 void UpdateKinematicState(ActorId actor_id, KinematicState state);
74
76
78
79 cg::Location GetLocation(const ActorId actor_id) const;
80
81 cg::Location GetHybridEndLocation(const ActorId actor_id) const;
82
83 cg::Rotation GetRotation(const ActorId actor_id) const;
84
85 cg::Vector3D GetHeading(const ActorId actor_id) const;
86
87 cg::Vector3D GetVelocity(const ActorId actor_id) const;
88
89 float GetSpeedLimit(const ActorId actor_id) const;
90
91 bool IsPhysicsEnabled(const ActorId actor_id) const;
92
93 bool IsDormant(const ActorId actor_id) const;
94
95 cg::Location GetHeroLocation(const ActorId actor_id) const;
96
97 TrafficLightState GetTLS(const ActorId actor_id) const;
98
99 ActorType GetType(const ActorId actor_id) const;
100
101 cg::Vector3D GetDimensions(const ActorId actor_id) const;
102
103};
104
105} // namespace traffic_manager
106} // namespace carla
This class holds the state of all the vehicles in the simlation.
cg::Location GetHeroLocation(const ActorId actor_id) const
bool ContainsActor(ActorId actor_id) const
cg::Location GetLocation(const ActorId actor_id) const
void UpdateKinematicHybridEndLocation(ActorId actor_id, cg::Location location)
cg::Vector3D GetHeading(const ActorId actor_id) const
cg::Location GetHybridEndLocation(const ActorId actor_id) const
void UpdateKinematicState(ActorId actor_id, KinematicState state)
void AddActor(ActorId actor_id, KinematicState kinematic_state, StaticAttributes attributes, TrafficLightState tl_state)
void UpdateTrafficLightState(ActorId actor_id, TrafficLightState state)
float GetSpeedLimit(const ActorId actor_id) const
cg::Rotation GetRotation(const ActorId actor_id) const
cg::Vector3D GetVelocity(const ActorId actor_id) const
bool IsPhysicsEnabled(const ActorId actor_id) const
std::unordered_set< ActorId > actor_set
ActorType GetType(const ActorId actor_id) const
cg::Vector3D GetDimensions(const ActorId actor_id) const
TrafficLightState GetTLS(const ActorId actor_id) const
bool IsDormant(const ActorId actor_id) const
std::unordered_map< ActorId, TrafficLightState > TrafficLightStateMap
std::unordered_map< ActorId, StaticAttributes > StaticAttributeMap
std::unordered_map< ActorId, KinematicState > KinematicStateMap
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133