CARLA
Light.h
Go to the documentation of this file.
1 // Copyright (c) 2020 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/Memory.h"
10 
12 #include "carla/geom/Location.h"
13 #include "carla/geom/Rotation.h"
14 #include "carla/rpc/LightState.h"
15 
16 namespace carla {
17 namespace client {
18 
19 class LightManager;
20 
21 class Light {
22 
24 
25 public:
26 
27  Light() {}
28 
29  Color GetColor() const;
30 
31  LightId GetId() const {
32  return _id;
33  }
34 
35  float GetIntensity() const;
36 
37  const geom::Location GetLocation() const {
38  return _location;
39  }
40 
41  LightGroup GetLightGroup() const;
42 
43  LightState GetLightState() const;
44 
45  bool IsOn() const;
46 
47  bool IsOff() const;
48 
49  void SetColor(Color color);
50 
51  void SetIntensity(float intensity);
52 
53  void SetLightGroup(LightGroup group);
54 
55  void SetLightState(const LightState& state);
56 
57  void TurnOn();
58 
59  void TurnOff();
60 
61 private:
62 
63  friend class LightManager;
64 
66  geom::Location location,
67  LightId id)
68  : _light_manager(light_manager),
69  _location (location),
70  _id (id) {}
71 
74 
76 
77 };
78 
79 } // namespace client
80 } // namespace carla
bool IsOff() const
Definition: Light.cpp:48
LightState GetLightState() const
Definition: Light.cpp:36
void SetLightGroup(LightGroup group)
Definition: Light.cpp:66
geom::Location _location
Definition: Light.h:73
void SetLightState(const LightState &state)
Definition: Light.cpp:72
void SetColor(Color color)
Definition: Light.cpp:54
A 32-bit BGRA color.
LightId GetId() const
Definition: Light.h:31
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
void SetIntensity(float intensity)
Definition: Light.cpp:60
bool IsOn() const
Definition: Light.cpp:42
WeakPtr< LightManager > _light_manager
Definition: Light.h:72
const geom::Location GetLocation() const
Definition: Light.h:37
float GetIntensity() const
Definition: Light.cpp:24
Light(WeakPtr< LightManager > light_manager, geom::Location location, LightId id)
Definition: Light.h:65
Color GetColor() const
Definition: Light.cpp:18
boost::weak_ptr< T > WeakPtr
Definition: Memory.h:23
LightGroup GetLightGroup() const
Definition: Light.cpp:30