CARLA
 
载入中...
搜索中...
未找到
DebugHelper.cpp
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
8
11
12namespace carla {
13namespace client {
14
16
17 template <typename T>
18 static void DrawShape(
19 detail::EpisodeProxy &episode,
20 const T &primitive,
21 rpc::Color color,
22 float life_time,
23 bool persistent_lines) {
24 const Shape shape{primitive, color, life_time, persistent_lines};
25 episode.Lock()->DrawDebugShape(shape);
26 }
27
29 const geom::Location &location,
30 float size,
32 float life_time,
33 bool persistent_lines) {
34 Shape::Point point{location, size};
35 DrawShape(_episode, point, color, life_time, persistent_lines);
36 }
37
39 const geom::Location &location,
40 float size,
42 float life_time,
43 bool persistent_lines) {
44 Shape::HUDPoint point{location, size};
45 DrawShape(_episode, point, color, life_time, persistent_lines);
46 }
47
49 const geom::Location &begin,
50 const geom::Location &end,
51 float thickness,
53 float life_time,
54 bool persistent_lines) {
55 Shape::Line line{begin, end, thickness};
56 DrawShape(_episode, line, color, life_time, persistent_lines);
57 }
58
60 const geom::Location &begin,
61 const geom::Location &end,
62 float thickness,
63 Color color,
64 float life_time,
65 bool persistent_lines) {
66 Shape::HUDLine line{begin, end, thickness};
67 DrawShape(_episode, line, color, life_time, persistent_lines);
68 }
69
71 const geom::Location &begin,
72 const geom::Location &end,
73 float thickness,
74 float arrow_size,
76 float life_time,
77 bool persistent_lines) {
78 Shape::Line line{begin, end, thickness};
79 Shape::Arrow arrow{line, arrow_size};
80 DrawShape(_episode, arrow, color, life_time, persistent_lines);
81 }
82
84 const geom::Location &begin,
85 const geom::Location &end,
86 float thickness,
87 float arrow_size,
89 float life_time,
90 bool persistent_lines) {
91 Shape::HUDLine line{begin, end, thickness};
92 Shape::HUDArrow arrow{line, arrow_size};
93 DrawShape(_episode, arrow, color, life_time, persistent_lines);
94 }
95
97 const geom::BoundingBox &box,
98 const geom::Rotation &rotation,
99 float thickness,
101 float life_time,
102 bool persistent_lines) {
103 Shape::Box the_box{box, rotation, thickness};
104 DrawShape(_episode, the_box, color, life_time, persistent_lines);
105 }
106
108 const geom::BoundingBox &box,
109 const geom::Rotation &rotation,
110 float thickness,
112 float life_time,
113 bool persistent_lines) {
114 Shape::HUDBox the_box{box, rotation, thickness};
115 DrawShape(_episode, the_box, color, life_time, persistent_lines);
116 }
117
119 const geom::Location &location,
120 const std::string &text,
121 bool draw_shadow,
123 float life_time,
124 bool persistent_lines) {
125 Shape::String string{location, text, draw_shadow};
126 DrawShape(_episode, string, color, life_time, persistent_lines);
127 }
128
129} // namespace client
130} // namespace carla
void DrawHUDArrow(const geom::Location &begin, const geom::Location &end, float thickness=0.1f, float arrow_size=0.1f, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
void DrawString(const geom::Location &location, const std::string &text, bool draw_shadow=false, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
void DrawLine(const geom::Location &begin, const geom::Location &end, float thickness=0.1f, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
detail::EpisodeProxy _episode
void DrawHUDPoint(const geom::Location &location, float size=0.1f, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
void DrawHUDLine(const geom::Location &begin, const geom::Location &end, float thickness=1.0f, Color color=Color{225u, 0u, 0u}, float life_time=-1.0f, bool presistent_lines=true)
void DrawHUDBox(const geom::BoundingBox &box, const geom::Rotation &rotation, float thickness=0.1f, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
void DrawArrow(const geom::Location &begin, const geom::Location &end, float thickness=0.1f, float arrow_size=0.1f, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
void DrawPoint(const geom::Location &location, float size=0.1f, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
void DrawBox(const geom::BoundingBox &box, const geom::Rotation &rotation, float thickness=0.1f, Color color=Color{255u, 0u, 0u}, float life_time=-1.0f, bool persistent_lines=true)
SharedPtrType Lock() const
Same as TryLock but never return nullptr.
static void DrawShape(detail::EpisodeProxy &episode, const T &primitive, rpc::Color color, float life_time, bool persistent_lines)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133