LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
LedSetMessage.hh
Go to the documentation of this file.
1
40#ifndef LibMultiSense_LedSetMessage
41#define LibMultiSense_LedSetMessage
42
44
45namespace crl {
46namespace multisense {
47namespace details {
48namespace wire {
49
50class LedSet {
51public:
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
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;
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
Macros and symbols to help portability between different compiler versions.
#define CRL_CONSTEXPR
void serialize(Archiver &archive, const VersionType version)
LedSet(utility::BufferStreamReader &r, VersionType v)
static CRL_CONSTEXPR VersionType VERSION
static CRL_CONSTEXPR IdType ID
static CRL_CONSTEXPR uint32_t MAX_LIGHTS
Definition Protocol.hh:337
static CRL_CONSTEXPR IdType ID_CMD_LED_SET
Definition Protocol.hh:167