LibMultiSense
LibMultiSense Documentation
LedSetMessage.hh
Go to the documentation of this file.
1 
40 #ifndef LibMultiSense_LedSetMessage
41 #define LibMultiSense_LedSetMessage
42 
43 #include "utility/Portability.hh"
44 
45 namespace crl {
46 namespace multisense {
47 namespace details {
48 namespace wire {
49 
50 class LedSet {
51 public:
54 
55  //
56  // Bit mask selecting which LEDs to update
57 
58  uint8_t mask;
59 
60  //
61  // LED duty cycles; 0 = off; 255 = 100%
62 
64 
65  //
66  // If non-zero, LEDs are only on while sensors are exposing
67 
68  uint8_t flash;
69 
70  //
71  // The delay of the LED from turning on to visible light seen in microseconds.
72  // Should be measured and specific to the LED in question.
73 
74  uint32_t led_delay_us;
75 
76  //
77  // For LED synchronized to shutter the number of pulses is how many pulses
78  // per exposure of an image.
79 
80  uint32_t number_of_pulses;
81 
82  //
83  // Invert the output signal that drives lighting. 1 means the output
84  // will be low during the exposure. 0 means the output will be high
85  // during the exposure.
86 
87  uint8_t invert_pulse;
88 
89  //
90  // Used to enable the rolling shutter led feature, applicable for cameras
91  // with a rolling shutter imager.
92 
94 
95  //
96  // Constructors
97 
101 
102  //
103  // Serialization routine
104 
105  template <class Archiver>
106  void serialize(Archiver& archive,
107  const VersionType version)
108  {
109  (void) version;
110  archive & mask;
111  for(uint32_t i=0; i<MAX_LIGHTS; i++)
112  archive & intensity[i];
113  archive & flash;
114 
115  if (version >= 2)
116  {
117  archive & led_delay_us;
118  archive & number_of_pulses;
119  }
120  else
121  {
122  led_delay_us = 0;
123  number_of_pulses = 1;
124  }
125 
126  if (version >= 3)
127  {
128  archive & invert_pulse;
129  }
130  else
131  {
132  invert_pulse = 0;
133  }
134 
135  if (version >= 4)
136  {
137  archive & rolling_shutter_led;
138  }
139  else
140  {
142  }
143  }
144 };
145 
146 }}}} // namespaces
147 
148 #endif
crl::multisense::details::wire::LedSet::LedSet
LedSet(utility::BufferStreamReader &r, VersionType v)
Definition: LedSetMessage.hh:98
crl::multisense::details::wire::LedSet::flash
uint8_t flash
Definition: LedSetMessage.hh:68
crl::multisense::details::wire::MAX_LIGHTS
static CRL_CONSTEXPR uint32_t MAX_LIGHTS
Definition: Protocol.hh:337
Portability.hh
crl::multisense::details::wire::ID_CMD_LED_SET
static CRL_CONSTEXPR IdType ID_CMD_LED_SET
Definition: Protocol.hh:167
CRL_CONSTEXPR
#define CRL_CONSTEXPR
Definition: Portability.hh:49
crl
Definition: BufferStream.hh:51
crl::multisense::details::wire::LedSet::serialize
void serialize(Archiver &archive, const VersionType version)
Definition: LedSetMessage.hh:106
crl::multisense::details::wire::LedSet::led_delay_us
uint32_t led_delay_us
Definition: LedSetMessage.hh:74
crl::multisense::details::wire::LedSet::intensity
uint8_t intensity[MAX_LIGHTS]
Definition: LedSetMessage.hh:63
crl::multisense::details::wire::VersionType
uint16_t VersionType
Definition: Protocol.hh:137
crl::multisense::details::wire::LedSet
Definition: LedSetMessage.hh:50
crl::multisense::details::wire::LedSet::invert_pulse
uint8_t invert_pulse
Definition: LedSetMessage.hh:87
crl::multisense::details::utility::BufferStreamReader
Definition: BufferStream.hh:192
multisense
Definition: MultiSenseChannel.hh:44
crl::multisense::details::wire::LedSet::VERSION
static CRL_CONSTEXPR VersionType VERSION
Definition: LedSetMessage.hh:53
crl::multisense::details::wire::LedSet::number_of_pulses
uint32_t number_of_pulses
Definition: LedSetMessage.hh:80
crl::multisense::details::wire::LedSet::mask
uint8_t mask
Definition: LedSetMessage.hh:58
crl::multisense::details::wire::LedSet::rolling_shutter_led
uint8_t rolling_shutter_led
Definition: LedSetMessage.hh:93
crl::multisense::details::wire::LedSet::LedSet
LedSet()
Definition: LedSetMessage.hh:99
crl::multisense::details::wire::LedSet::ID
static CRL_CONSTEXPR IdType ID
Definition: LedSetMessage.hh:52
crl::multisense::details::wire::IdType
uint16_t IdType
Definition: Protocol.hh:136