LedStatusMessage.hh
Go to the documentation of this file.
1 
40 #ifndef LibMultiSense_LedStatusMessage
41 #define LibMultiSense_LedStatusMessage
42 
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 
99  LedStatus() : available(0), flash(0), led_delay_us(0), number_of_pulses(1),
100  invert_pulse(0), rolling_shutter_led(0) {};
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<lighting::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  {
141  rolling_shutter_led = 0;
142  }
143  }
144 };
145 
146 }}}} // namespaces
147 
148 #endif
static CRL_CONSTEXPR IdType ID_DATA_LED_STATUS
Definition: Protocol.hh:203
uint8_t intensity[lighting::MAX_LIGHTS]
static CRL_CONSTEXPR VersionType VERSION
void serialize(Archive &message, const VersionType version)
Definition: channel.cc:58
static CRL_CONSTEXPR uint32_t MAX_LIGHTS
LedStatus(utility::BufferStreamReader &r, VersionType v)
#define CRL_CONSTEXPR
Definition: Portability.hh:49


multisense_lib
Author(s):
autogenerated on Sat Jun 24 2023 03:01:21