CARLA
Loading...
Searching...
No Matches
DataStructures.h
Go to the documentation of this file.
1
2/// This file contains definitions of common data structures used in traffic manager.
3
4#pragma once
5
6#include <chrono>
7#include <deque>
8#include <vector>
9
10#include "carla/client/Actor.h"
11#include "carla/geom/Location.h"
12#include "carla/geom/Rotation.h"
13#include "carla/geom/Vector3D.h"
14#include "carla/rpc/ActorId.h"
15#include "carla/rpc/Command.h"
17
19
20namespace carla {
21namespace traffic_manager {
22
23namespace chr = std::chrono;
24namespace cc = carla::client;
25namespace cg = carla::geom;
26
31using SimpleWaypointPtr = std::shared_ptr<SimpleWaypoint>;
32using Buffer = std::deque<SimpleWaypointPtr>;
33using BufferMap = std::unordered_map<carla::ActorId, Buffer>;
34using TimeInstance = chr::time_point<chr::system_clock, chr::nanoseconds>;
36
41 /// False when the localization stage could not place the vehicle on the map
42 /// -- a map without a single drivable waypoint (EmptyMap, an OpenDRIVE file
43 /// with no road). Every later stage assumes a non-empty waypoint buffer, so
44 /// TrafficManagerLocal::Step skips such a vehicle for this cycle.
45 bool localized = false;
46};
47using LocalizationFrame = std::vector<LocalizationData>;
48
54using CollisionFrame = std::vector<CollisionHazardData>;
55
56using ControlFrame = std::vector<carla::rpc::Command>;
57
58using TLFrame = std::vector<bool>;
59
60/// Structure to hold the actuation signals.
62 float throttle;
63 float brake;
64 float steer;
65};
66
67/// Structure to hold the controller state.
68struct StateEntry {
72 float steer;
73 float throttle {0.0f};
74 float brake {0.0f};
75 /// Zero is a safe initial value: the shaping raises it to the current speed.
76 float reference_velocity {0.0f};
77};
78
79} // namespace traffic_manager
80} // namespace carla
int32_t JuncId
Definition RoadTypes.h:17
carla::road::JuncId JunctionID
std::deque< std::shared_ptr< SimpleWaypoint > > Buffer
std::unordered_map< carla::ActorId, Buffer > BufferMap
std::vector< CollisionHazardData > CollisionFrame
std::vector< bool > TLFrame
chr::time_point< chr::system_clock, chr::nanoseconds > TimeInstance
std::vector< carla::rpc::Command > ControlFrame
carla::SharedPtr< cc::Actor > ActorPtr
std::vector< LocalizationData > LocalizationFrame
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
carla::SharedPtr< carla::client::Junction > Junction
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr
Definition Memory.h:15
rpc::ActorId ActorId
Definition ActorId.h:18
Structure to hold the actuation signals.
bool localized
False when the localization stage could not place the vehicle on the map – a map without a single dri...
Structure to hold the controller state.
float reference_velocity
Zero is a safe initial value: the shaping raises it to the current speed.