CARLA
DebugHelper.h
Go to the documentation of this file.
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 
7 #pragma once
8 
10 #include "carla/geom/BoundingBox.h"
11 #include "carla/geom/Location.h"
12 #include "carla/geom/Rotation.h"
14 
15 namespace carla {
16 namespace client {
17 
18  class DebugHelper {
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  private:
67 
69  };
70 
71 } // namespace client
72 } // namespace carla
sensor::data::Color Color
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
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
A 32-bit BGRA color.
DebugHelper(detail::EpisodeProxy episode)
Definition: DebugHelper.h:23
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
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
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
detail::EpisodeProxy _episode
Definition: DebugHelper.h:68
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