CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
client
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
9
#include "
carla/client/detail/EpisodeProxy.h
"
10
#include "
carla/geom/BoundingBox.h
"
11
#include "
carla/geom/Location.h
"
12
#include "
carla/geom/Rotation.h
"
13
#include "
carla/sensor/data/Color.h
"
14
15
namespace
carla
{
16
namespace
client
{
17
18
class
DebugHelper
{
19
public
:
20
21
using
Color
=
sensor::data::Color
;
22
23
explicit
DebugHelper
(
detail::EpisodeProxy
episode)
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
75
detail::EpisodeProxy
_episode
;
76
};
77
78
}
// namespace client
79
}
// namespace carla
EpisodeProxy.h
BoundingBox.h
Rotation.h
carla::client::DebugHelper::ClearDebugString
void ClearDebugString()
Clear every persistent debug string currently shown in the HUD.
Definition
DebugHelper.cpp:88
carla::client::DebugHelper::DrawString
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)
Definition
DebugHelper.cpp:73
carla::client::DebugHelper::DrawLine
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)
Definition
DebugHelper.cpp:38
carla::client::DebugHelper::_episode
detail::EpisodeProxy _episode
Definition
DebugHelper.h:75
carla::client::DebugHelper::DrawArrow
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)
Definition
DebugHelper.cpp:49
carla::client::DebugHelper::ClearDebugShape
void ClearDebugShape()
Clear every persistent debug shape (lines, points, boxes, arrows) previously drawn from this world.
Definition
DebugHelper.cpp:84
carla::client::DebugHelper::Color
sensor::data::Color Color
Definition
DebugHelper.h:21
carla::client::DebugHelper::DrawPoint
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)
Definition
DebugHelper.cpp:28
carla::client::DebugHelper::DebugHelper
DebugHelper(detail::EpisodeProxy episode)
Definition
DebugHelper.h:23
carla::client::DebugHelper::DrawBox
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)
Definition
DebugHelper.cpp:62
Location.h
carla::client::detail::EpisodeProxy
EpisodeProxyImpl< EpisodeProxyPointerType::Strong > EpisodeProxy
Definition
EpisodeProxy.h:69
carla::client
Definition
BasicAgent.h:24
carla::client::Color
sensor::data::Color Color
Definition
client/LightState.h:15
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
std
Definition
CarlaRecorderCollision.h:31
Color.h
carla::geom::Location
Definition
geom/Location.h:23
carla::sensor::data::Color
A 32-bit BGRA color.
Definition
sensor/data/Color.h:20
Generated by
1.18.0