CARLA
Loading...
Searching...
No Matches
DebugHelper.h
Go to the documentation of this file.
1// Copyright (c) 2026 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
7#pragma once
8
11#include "carla/geom/Location.h"
12#include "carla/geom/Rotation.h"
14
15namespace carla {
16namespace client {
17
19 public:
20
22
24 : _episode(std::move(episode)) {}
25
26 void DrawPoint(
27 const geom::Location &location,
28 float size = 0.1f,
29 Color color = Color{255u, 0u, 0u},
30 float life_time = -1.0f,
31 bool persistent_lines = true);
32
33 void DrawLine(
34 const geom::Location &begin,
35 const geom::Location &end,
36 float thickness = 0.1f,
37 Color color = Color{255u, 0u, 0u},
38 float life_time = -1.0f,
39 bool persistent_lines = true);
40
41 void DrawArrow(
42 const geom::Location &begin,
43 const geom::Location &end,
44 float thickness = 0.1f,
45 float arrow_size = 0.1f,
46 Color color = Color{255u, 0u, 0u},
47 float life_time = -1.0f,
48 bool persistent_lines = true);
49
50 void DrawBox(
51 const geom::BoundingBox &box,
52 const geom::Rotation &rotation,
53 float thickness = 0.1f,
54 Color color = Color{255u, 0u, 0u},
55 float life_time = -1.0f,
56 bool persistent_lines = true);
57
58 void DrawString(
59 const geom::Location &location,
60 const std::string &text,
61 bool draw_shadow = false,
62 Color color = Color{255u, 0u, 0u},
63 float life_time = -1.0f,
64 bool persistent_lines = true);
65
66 /// Clear every persistent debug shape (lines, points, boxes, arrows)
67 /// previously drawn from this world.
68 void ClearDebugShape();
69
70 /// Clear every persistent debug string currently shown in the HUD.
71 void ClearDebugString();
72
73 private:
74
76 };
77
78} // namespace client
79} // namespace carla
void ClearDebugString()
Clear every persistent debug string currently shown in the HUD.
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
Definition DebugHelper.h:75
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 ClearDebugShape()
Clear every persistent debug shape (lines, points, boxes, arrows) previously drawn from this world.
sensor::data::Color Color
Definition DebugHelper.h:21
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)
DebugHelper(detail::EpisodeProxy episode)
Definition DebugHelper.h:23
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)
This file contains definitions of common data structures used in traffic manager.