CARLA
rpc/LightState.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/geom/Location.h"
10 #include "carla/geom/Rotation.h"
11 #include "carla/rpc/Color.h"
12 
13 namespace carla {
14 namespace rpc {
15 
16 using LightId = uint32_t;
17 
18 class LightState {
19 public:
20 
21  using flag_type = uint8_t;
22 
23  enum class LightGroup : flag_type {
24  None = 0,
25  Vehicle,
26  Street,
27  Building,
28  Other
29  };
30 
32 
34  geom::Location location,
35  float intensity,
36  LightGroup group,
37  Color color,
38  bool active)
39  : _location(location),
40  _intensity(intensity),
41  _group(static_cast<flag_type>(group)),
42  _color(color),
43  _active(active) {}
44 
46  float _intensity = 0.0f;
50  bool _active = false;
51 
52  MSGPACK_DEFINE_ARRAY(_id, _location, _intensity, _group, _color, _active);
53 
54 };
55 
56 } // namespace rpc
57 } // namespace carla
MSGPACK_DEFINE_ARRAY(_id, _location, _intensity, _group, _color, _active)
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
LightState(geom::Location location, float intensity, LightGroup group, Color color, bool active)
uint32_t LightId
geom::Location _location