CARLA
DebugShape.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 
9 #include "carla/MsgPack.h"
10 #include "carla/MsgPackAdaptors.h"
11 #include "carla/geom/BoundingBox.h"
12 #include "carla/geom/Location.h"
13 #include "carla/geom/Rotation.h"
14 #include "carla/rpc/Color.h"
15 
16 #include <boost/variant.hpp>
17 
18 namespace carla {
19 namespace rpc {
20 
21  class DebugShape {
22  public:
23 
24  struct Point {
26  float size;
27  MSGPACK_DEFINE_ARRAY(location, size);
28  };
29 
30  struct Line {
33  float thickness;
34  MSGPACK_DEFINE_ARRAY(begin, end, thickness);
35  };
36 
37  struct Arrow {
39  float arrow_size;
40  MSGPACK_DEFINE_ARRAY(line, arrow_size);
41  };
42 
43  struct Box {
46  float thickness;
47  MSGPACK_DEFINE_ARRAY(box, rotation, thickness);
48  };
49 
50  struct String {
52  std::string text;
54  MSGPACK_DEFINE_ARRAY(location, text, draw_shadow);
55  };
56 
57  boost::variant<Point, Line, Arrow, Box, String> primitive;
58 
59  Color color = {255u, 0u, 0u};
60 
61  float life_time = -1.0f;
62 
63  bool persistent_lines = true;
64 
65  MSGPACK_DEFINE_ARRAY(primitive, color, life_time, persistent_lines);
66  };
67 
68 } // namespace rpc
69 } // namespace carla
geom::BoundingBox box
Definition: DebugShape.h:44
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
boost::variant< Point, Line, Arrow, Box, String > primitive
Definition: DebugShape.h:57
MSGPACK_DEFINE_ARRAY(location, size)
geom::Rotation rotation
Definition: DebugShape.h:45