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 #ifdef _MSC_VER
17 #pragma warning(push)
18 #pragma warning(disable:4583)
19 #pragma warning(disable:4582)
20 #include <boost/variant2/variant.hpp>
21 #pragma warning(pop)
22 #else
23 #include <boost/variant2/variant.hpp>
24 #endif
25 
26 namespace carla {
27 namespace rpc {
28 
29  class DebugShape {
30  public:
31 
32  struct Point {
34  float size;
35  MSGPACK_DEFINE_ARRAY(location, size);
36  };
37 
38  struct Line {
41  float thickness;
42  MSGPACK_DEFINE_ARRAY(begin, end, thickness);
43  };
44 
45  struct Arrow {
47  float arrow_size;
48  MSGPACK_DEFINE_ARRAY(line, arrow_size);
49  };
50 
51  struct Box {
54  float thickness;
55  MSGPACK_DEFINE_ARRAY(box, rotation, thickness);
56  };
57 
58  struct String {
60  std::string text;
62  MSGPACK_DEFINE_ARRAY(location, text, draw_shadow);
63  };
64 
65  boost::variant2::variant<Point, Line, Arrow, Box, String> primitive;
66 
67  Color color = {255u, 0u, 0u};
68 
69  float life_time = -1.0f;
70 
71  bool persistent_lines = true;
72 
73  MSGPACK_DEFINE_ARRAY(primitive, color, life_time, persistent_lines);
74  };
75 
76 } // namespace rpc
77 } // namespace carla
geom::BoundingBox box
Definition: DebugShape.h:52
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
MSGPACK_DEFINE_ARRAY(location, size)
boost::variant2::variant< Point, Line, Arrow, Box, String > primitive
Definition: DebugShape.h:65
geom::Rotation rotation
Definition: DebugShape.h:53