LibMultiSense
LibMultiSense Documentation
LedStatusMessage.hh
Go to the documentation of this file.
1 
40 #ifndef LibMultiSense_LedStatusMessage
41 #define LibMultiSense_LedStatusMessage
42 
43 #include "utility/Portability.hh"
44 
45 namespace crl {
46 namespace multisense {
47 namespace details {
48 namespace wire {
49 
50 class LedStatus {
51 public:
54 
55  //
56  // Bit mask indicating which LEDs are implemented
57 
58  uint8_t available;
59 
60  //
61  // Current 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  // The status of the rolling shutter led enable flag, can be used confirm that
91  // the LED synchronization technique, can be used with a rolling shutter imager.
92 
94 
95  //
96  // Constructors
97 
101 
102  //
103  // Serialization routine
104 
105  template<class Archive>
106  void serialize(Archive& message,
107  const VersionType version)
108  {
109  (void) version;
110  message & available;
111  for(uint32_t i=0; i<MAX_LIGHTS; i++)
112  message & intensity[i];
113  message & flash;
114 
115  if (version >= 2)
116  {
117  message & led_delay_us;
118  message & 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  message & invert_pulse;
129  }
130  else
131  {
132  invert_pulse = 0;
133  }
134 
135  if (version >= 4)
136  {
137  message & rolling_shutter_led;
138  }
139  else
140  {
142  }
143  }
144 };
145 
146 }}}} // namespaces
147 
148 #endif
crl::multisense::details::wire::LedStatus
Definition: LedStatusMessage.hh:50
crl::multisense::details::wire::MAX_LIGHTS
static CRL_CONSTEXPR uint32_t MAX_LIGHTS
Definition: Protocol.hh:337
crl::multisense::details::wire::LedStatus::ID
static CRL_CONSTEXPR IdType ID
Definition: LedStatusMessage.hh:52
crl::multisense::details::wire::LedStatus::VERSION
static CRL_CONSTEXPR VersionType VERSION
Definition: LedStatusMessage.hh:53
Portability.hh
CRL_CONSTEXPR
#define CRL_CONSTEXPR
Definition: Portability.hh:49
crl::multisense::details::wire::LedStatus::LedStatus
LedStatus(utility::BufferStreamReader &r, VersionType v)
Definition: LedStatusMessage.hh:98
crl::multisense::details::wire::LedStatus::serialize
void serialize(Archive &message, const VersionType version)
Definition: LedStatusMessage.hh:106
crl::multisense::details::wire::LedStatus::number_of_pulses
uint32_t number_of_pulses
Definition: LedStatusMessage.hh:80
crl::multisense::details::wire::LedStatus::available
uint8_t available
Definition: LedStatusMessage.hh:58
crl
Definition: BufferStream.hh:51
crl::multisense::details::wire::LedStatus::intensity
uint8_t intensity[MAX_LIGHTS]
Definition: LedStatusMessage.hh:63
crl::multisense::details::wire::LedStatus::flash
uint8_t flash
Definition: LedStatusMessage.hh:68
crl::multisense::details::wire::LedStatus::invert_pulse
uint8_t invert_pulse
Definition: LedStatusMessage.hh:87
crl::multisense::details::wire::LedStatus::LedStatus
LedStatus()
Definition: LedStatusMessage.hh:99
crl::multisense::details::wire::VersionType
uint16_t VersionType
Definition: Protocol.hh:137
crl::multisense::details::utility::BufferStreamReader
Definition: BufferStream.hh:192
multisense
Definition: MultiSenseChannel.hh:44
crl::multisense::details::wire::LedStatus::rolling_shutter_led
uint8_t rolling_shutter_led
Definition: LedStatusMessage.hh:93
crl::multisense::details::wire::LedStatus::led_delay_us
uint32_t led_delay_us
Definition: LedStatusMessage.hh:74
crl::multisense::details::wire::ID_DATA_LED_STATUS
static CRL_CONSTEXPR IdType ID_DATA_LED_STATUS
Definition: Protocol.hh:211
crl::multisense::details::wire::IdType
uint16_t IdType
Definition: Protocol.hh:136