Time-of-Flight Library(ToF) 4.0.2
 
camera.hpp
1#ifndef _CHRONOPTICS_TOF_CAMERA_HPP_
2#define _CHRONOPTICS_TOF_CAMERA_HPP_
3
4#include <chronoptics/tof/camera.h>
5
6#include <chronoptics/tof/stream.hpp>
7#include <chronoptics/tof/processing_config.hpp>
8#include <chronoptics/tof/data.hpp>
9#include <chronoptics/tof/camera_config.hpp>
10#include <chronoptics/tof/calibration.hpp>
11
12namespace chronoptics {
13namespace tof {
14
15/** The main interface to the depth cameras
16*/
17class Camera : public detail::Base<tof_camera, tof_camera_delete> {
18 public:
19 /** Construct from pointer */
20 Camera(tof_camera_t ptr = nullptr) {
21 this->ptr_ = ptr;
22 }
23
24 /** Start streaming of the camera
25 */
26 void start() {
27 return tof_camera_start(this->ptr_, TOF_ERROR_HANDLER{});
28 }
29
30 /** Stop streaming of the camera
31 */
32 void stop() {
33 return tof_camera_stop(this->ptr_, TOF_ERROR_HANDLER{});
34 }
35
36 /** Check whether the camera is streaming
37 * @return Is streaming
38 */
39 bool is_streaming() const {
40 return tof_camera_is_streaming(this->ptr_, TOF_ERROR_HANDLER{});
41 }
42
43 /** Check whether the camera is still connected
44 * @return Is connected
45 */
46 bool is_connected() const {
47 return tof_camera_is_connected(this->ptr_, TOF_ERROR_HANDLER{});
48 }
49
50 /** Get the different output streams the camera can provide
51 * @return The streams
52 */
53 std::vector<Stream> get_stream_list() const {
54 size_t size = tof_camera_get_stream_list(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
55 std::vector<Stream> vec;
56 vec.reserve(size);
57 for (size_t i = 0; i < size; i++)
58 vec.emplace_back(static_cast<tof_stream_t>(nullptr));
59 auto data = reinterpret_cast<tof_stream_t*>(vec.data());
60 size = tof_camera_get_stream_list(this->ptr_, data, vec.size(), TOF_ERROR_HANDLER{});
61 return vec;
62 }
63
64 /** the processing config of the camera
65 * @return The processing config
66 */
68 ProcessingConfig new_processing_config(static_cast<tof_processing_config_t>(nullptr));
69 auto ptr = reinterpret_cast<tof_processing_config_t*>(&new_processing_config);
70 *ptr = tof_camera_get_process_config(this->ptr_, TOF_ERROR_HANDLER{});
71 return new_processing_config;
72 }
73
74 /** Check if the camera has frames available
75 * @return Has frames available
76 */
77 bool has_frames() const {
78 return tof_camera_has_frames(this->ptr_, TOF_ERROR_HANDLER{});
79 }
80
81 /** Get data frames from camera
82 * @return Data frames
83 */
84 std::vector<Data> get_frames() {
85 size_t size = tof_camera_get_frames(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
86 std::vector<Data> vec;
87 vec.reserve(size);
88 for (size_t i = 0; i < size; i++)
89 vec.emplace_back(static_cast<tof_data_t>(nullptr));
90 auto data = reinterpret_cast<tof_data_t*>(vec.data());
91 size = tof_camera_get_frames(this->ptr_, data, vec.size(), TOF_ERROR_HANDLER{});
92 return vec;
93 }
94
95 /** Clear the circular buffer used to store frames
96 */
97 void clear_buffer() {
98 return tof_camera_clear_buffer(this->ptr_, TOF_ERROR_HANDLER{});
99 }
100
101 /** Get the circular buffer size
102 * @return The maximum number of sets of frames that is stored before the
103 * oldest is overwritten
104 */
105 size_t get_buffer_size() const {
106 return tof_camera_get_buffer_size(this->ptr_, TOF_ERROR_HANDLER{});
107 }
108
109 /** Set the circular buffer size
110 * @param size The maximum number of sets of frames that is stored before the
111 * oldest is overwritten
112 */
113 void set_buffer_size(size_t size) {
114 return tof_camera_set_buffer_size(this->ptr_, size, TOF_ERROR_HANDLER{});
115 }
116
117 /** Get the currently active camera config
118 * @return The camera config
119 */
121 CameraConfig new_camera_config(static_cast<tof_camera_config_t>(nullptr));
122 auto ptr = reinterpret_cast<tof_camera_config_t*>(&new_camera_config);
123 *ptr = tof_camera_get_camera_config(this->ptr_, TOF_ERROR_HANDLER{});
124 return new_camera_config;
125 }
126
127 /** Get the serial number of the current camera
128 * @return The serial
129 */
130 const char* get_serial() const {
131 return tof_camera_get_serial(this->ptr_, TOF_ERROR_HANDLER{});
132 }
133
134 /** Get calibration from the camera
135 * @return The calibration
136 */
138 Calibration new_calibration(static_cast<tof_calibration_t>(nullptr));
139 auto ptr = reinterpret_cast<tof_calibration_t*>(&new_calibration);
140 *ptr = tof_camera_get_calibration(this->ptr_, TOF_ERROR_HANDLER{});
141 return new_calibration;
142 }
143
144 /** Get the amount of user pointers that can be stored
145 * @return The capacity
146 */
148 return tof_camera_get_user_pointer_capacity(this->ptr_, TOF_ERROR_HANDLER{});
149 }
150
151 /** Set the amount of user pointers that can be stored
152 * @param capacity The capacity
153 */
154 void set_user_pointer_capacity(size_t capacity) {
155 return tof_camera_set_user_pointer_capacity(this->ptr_, capacity, TOF_ERROR_HANDLER{});
156 }
157
158 /** Add a pointer that will be filled with the specified data type. This
159 * method allows you to fill data straight into your own data type without any
160 * additional copying.
161 * @param pointer The pointer to the data to write into
162 * @param capacity The amount of data the pointer can hold
163 * @param callback Callback that will be called when pointer is no longer in
164 * use
165 * @param frame_type The frame type that will be filled into the pointer
166 */
167 void add_user_pointer(uint8_t* pointer, size_t capacity, user_pointer_destructed_fn &callback, FrameType frame_type) {
168 return tof_camera_add_user_pointer(this->ptr_, pointer, capacity, user_pointer_destructed_cb_handler, &callback, static_cast<tof_frame_type>(frame_type), TOF_ERROR_HANDLER{});
169 }
170
171 /** Add a pointer that will be filled with the specified data type. This
172 * method allows you to fill data straight into your own data type without any
173 * additional copying.
174 * @param pointer The pointer to the data to write into
175 * @param capacity The amount of data the pointer can hold
176 * @param callback Callback that will be called when pointer is no longer in
177 * use
178 * @param callback_user_data User data that will be passed back when the function pointer is called
179 * @param frame_type The frame type that will be filled into the pointer
180 */
181 void add_user_pointer(uint8_t* pointer, size_t capacity, tof_user_pointer_destructed_t callback, void* callback_user_data, FrameType frame_type) {
182 return tof_camera_add_user_pointer(this->ptr_, pointer, capacity, callback, callback_user_data, static_cast<tof_frame_type>(frame_type), TOF_ERROR_HANDLER{});
183 }
184
185 /** Clear all user pointers in memory
186 */
188 return tof_camera_clear_user_pointers(this->ptr_, TOF_ERROR_HANDLER{});
189 }
190
191 /** Get the currently set configuration index
192 * @return config index
193 */
194 uint32_t config_index() const {
195 return tof_camera_config_index(this->ptr_, TOF_ERROR_HANDLER{});
196 }
197
198 /** Switch to a different config in real time, depending on configuration and
199 * camera, this can take 100-300ms
200 * @param config_index Config index to switch to
201 */
203 return tof_camera_switch_config(this->ptr_, config_index, TOF_ERROR_HANDLER{});
204 }
205
206 /** Get the frame types that this camera can output
207 * @return Possible frame types
208 */
209 std::vector<FrameType> possible_frame_types() const {
210 size_t size = tof_camera_possible_frame_types(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
211 std::vector<FrameType> vec(size);
212 size = tof_camera_possible_frame_types(this->ptr_, reinterpret_cast<tof_frame_type*>(vec.data()), vec.size(), TOF_ERROR_HANDLER{});
213 return vec;
214 }
215
216 /** Whether output frame types have been set
217 * @return Output frame types set
218 */
220 return tof_camera_output_frame_types_set(this->ptr_, TOF_ERROR_HANDLER{});
221 }
222
223 /** Get the frame types the camera should output
224 * @return Output frame types
225 */
226 std::vector<FrameType> get_output_frame_types() const {
227 size_t size = tof_camera_get_output_frame_types(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
228 std::vector<FrameType> vec(size);
229 size = tof_camera_get_output_frame_types(this->ptr_, reinterpret_cast<tof_frame_type*>(vec.data()), vec.size(), TOF_ERROR_HANDLER{});
230 return vec;
231 }
232
233 /** Set the frame types the camera should output
234 * @param output_frame_types Output frame types
235 */
236 void set_output_frame_types(const std::vector<FrameType> &output_frame_types) {
237 return tof_camera_set_output_frame_types(this->ptr_, reinterpret_cast<const tof_frame_type*>(output_frame_types.data()), output_frame_types.size(), TOF_ERROR_HANDLER{});
238 }
239
240 /** Check if multiple configurations are set. Switch config can only be used
241 * when this is the case.
242 * @return Is set
243 */
245 return tof_camera_has_multiple_configurations(this->ptr_, TOF_ERROR_HANDLER{});
246 }
247
248 /** Get all the set camera configurations
249 * @return Multiple camera configurations
250 */
251 std::vector<CameraConfig> get_multiple_camera_configurations() const {
252 size_t size = tof_camera_get_multiple_camera_configurations(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
253 std::vector<CameraConfig> vec;
254 vec.reserve(size);
255 for (size_t i = 0; i < size; i++)
256 vec.emplace_back(static_cast<tof_camera_config_t>(nullptr));
257 auto data = reinterpret_cast<tof_camera_config_t*>(vec.data());
258 size = tof_camera_get_multiple_camera_configurations(this->ptr_, data, vec.size(), TOF_ERROR_HANDLER{});
259 return vec;
260 }
261
262 /** Get all the set processing configurations
263 * @return Multiple processing configurations
264 */
265 std::vector<ProcessingConfig> get_multiple_processing_configurations() const {
266 size_t size = tof_camera_get_multiple_processing_configurations(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
267 std::vector<ProcessingConfig> vec;
268 vec.reserve(size);
269 for (size_t i = 0; i < size; i++)
270 vec.emplace_back(static_cast<tof_processing_config_t>(nullptr));
271 auto data = reinterpret_cast<tof_processing_config_t*>(vec.data());
272 size = tof_camera_get_multiple_processing_configurations(this->ptr_, data, vec.size(), TOF_ERROR_HANDLER{});
273 return vec;
274 }
275
276 /** Get the name for each configuration
277 * @return Names
278 */
279 std::vector<const char*> get_multiple_names() const {
280 size_t size = tof_camera_get_multiple_names(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
281 std::vector<const char*> vec(size);
282 size = tof_camera_get_multiple_names(this->ptr_, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
283 return vec;
284 }
285
286 /** Get the description for each configuration
287 * @return Descriptions
288 */
289 std::vector<const char*> get_multiple_descriptions() const {
290 size_t size = tof_camera_get_multiple_descriptions(this->ptr_, nullptr, 0, TOF_ERROR_HANDLER{});
291 std::vector<const char*> vec(size);
292 size = tof_camera_get_multiple_descriptions(this->ptr_, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
293 return vec;
294 }
295
296};
297
298/** A persistent ip data structure
299*/
300class PersistentIp : public detail::Base<tof_persistent_ip, tof_persistent_ip_delete> {
301 public:
302 /** Construct from pointer */
303 PersistentIp(tof_persistent_ip_t ptr = nullptr) {
304 this->ptr_ = ptr;
305 }
306
307 /** Create persistent ip
308 * @param ip IP address
309 * @param netmask Netmask
310 * @param gateway Gateway
311 * @param enabled Enable or disable persistent ip
312 */
313 PersistentIp(StringView ip, StringView netmask, StringView gateway, bool enabled) : PersistentIp(tof_persistent_ip_new(ip, netmask, gateway, enabled, TOF_ERROR_HANDLER{})) {}
314
315 /** Get the IP address
316 * @return the IP address
317 */
318 const char* get_ip() const {
319 return tof_persistent_ip_get_ip(this->ptr_, TOF_ERROR_HANDLER{});
320 }
321
322 /** Set the IP address
323 * @param ip the IP address
324 */
325 void set_ip(StringView ip) {
326 return tof_persistent_ip_set_ip(this->ptr_, ip, TOF_ERROR_HANDLER{});
327 }
328
329 /** Get the netmask
330 * @return The netmask
331 */
332 const char* get_netmask() const {
333 return tof_persistent_ip_get_netmask(this->ptr_, TOF_ERROR_HANDLER{});
334 }
335
336 /** Set the netmask
337 * @param netmask The netmask
338 */
339 void set_netmask(StringView netmask) {
340 return tof_persistent_ip_set_netmask(this->ptr_, netmask, TOF_ERROR_HANDLER{});
341 }
342
343 /** Get the gateway
344 * @return The gateway
345 */
346 const char* get_gateway() const {
347 return tof_persistent_ip_get_gateway(this->ptr_, TOF_ERROR_HANDLER{});
348 }
349
350 /** Set the gateway
351 * @param gateway The gateway
352 */
353 void set_gateway(StringView gateway) {
354 return tof_persistent_ip_set_gateway(this->ptr_, gateway, TOF_ERROR_HANDLER{});
355 }
356
357 /** Get if persistent ip is enabled
358 * @return Is enabled
359 */
360 bool get_enabled() const {
361 return tof_persistent_ip_get_enabled(this->ptr_, TOF_ERROR_HANDLER{});
362 }
363
364 /** Set if persistent ip is enabled
365 * @param enabled Is enabled
366 */
367 void set_enabled(bool enabled) {
368 return tof_persistent_ip_set_enabled(this->ptr_, enabled, TOF_ERROR_HANDLER{});
369 }
370
371};
372
373/** Functions shared across all live cameras
374*/
375class LiveCamera : public Camera {
376 public:
377 /** Construct from pointer */
378 LiveCamera(tof_live_camera_t ptr = nullptr) : Camera(reinterpret_cast<tof_camera_t>(ptr)) {}
379
380 /** Get the tof library version running on the camera
381 * @return Version
382 */
383 const char* version() {
384 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
385 return tof_live_camera_version(this_class, TOF_ERROR_HANDLER{});
386 }
387
388 /** Check whether the camera is capable of updating remotely
389 * @return Remote update capable
390 */
392 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
393 return tof_live_camera_remote_update_capable(this_class, TOF_ERROR_HANDLER{});
394 }
395
396 /** Update the camera remotely. After uploading the update file the function
397 * will return. If a correct update file was uploaded, the camera will flash
398 * the update and reboot. This generally takes about a minute. The camera can
399 * also be updated via a web interface by visiting the ip address of the
400 * camera on port 8080, for example http://192.168.1.208:8080
401 * @param file_location Location of the update file
402 */
403 void remote_update(StringView file_location) {
404 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
405 return tof_live_camera_remote_update(this_class, file_location, TOF_ERROR_HANDLER{});
406 }
407
408 /** Whether the camera is capable of setting persistent ip
409 * @return Persistent ip capable
410 */
412 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
413 return tof_live_camera_persistent_ip_capable(this_class, TOF_ERROR_HANDLER{});
414 }
415
416 /** Get the current persistent ip settings
417 * @return Persistent IP
418 */
420 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
421 PersistentIp new_persistent_ip(static_cast<tof_persistent_ip_t>(nullptr));
422 auto ptr = reinterpret_cast<tof_persistent_ip_t*>(&new_persistent_ip);
423 *ptr = tof_live_camera_get_persistent_ip(this_class, TOF_ERROR_HANDLER{});
424 return new_persistent_ip;
425 }
426
427 /** Set the persistent ip settings. To activate persistent ip settings run
428 * apply_persistent_ip.
429 * @param persistent_ip The persistent ip
430 */
431 void set_persistent_ip(const PersistentIp &persistent_ip) {
432 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
433 return tof_live_camera_set_persistent_ip(this_class, *reinterpret_cast<const tof_persistent_ip_t*>(&persistent_ip), TOF_ERROR_HANDLER{});
434 }
435
436 /** Whether the camera is capable of applying the persistent ip
437 * @return Capable
438 */
440 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
441 return tof_live_camera_apply_persistent_ip_capable(this_class, TOF_ERROR_HANDLER{});
442 }
443
444 /** Apply persistent ip by rebooting the camera, power cycling the camera is
445 * discouraged because the applied ip settings might not stick.
446 */
448 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
449 return tof_live_camera_apply_persistent_ip(this_class, TOF_ERROR_HANDLER{});
450 }
451
452 /** Check whether the camera is capable of software trigger
453 * @return Software trigger capable
454 */
456 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
457 return tof_live_camera_software_trigger_capable(this_class, TOF_ERROR_HANDLER{});
458 }
459
460 /** Software trigger the camera
461 */
463 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
464 return tof_live_camera_software_trigger(this_class, TOF_ERROR_HANDLER{});
465 }
466
467 /** Get delay between network packets
468 * @return The delay, depending on the camera software it is in nanoseconds or
469 * in cpu instruction
470 */
471 uint32_t get_delay() const {
472 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
473 return tof_live_camera_get_delay(this_class, TOF_ERROR_HANDLER{});
474 }
475
476 /** Set delay between network packets
477 * @param delay The delay, depending on the camera software it is in
478 * nanoseconds or in cpu instruction
479 */
480 void set_delay(uint32_t delay) {
481 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
482 return tof_live_camera_set_delay(this_class, delay, TOF_ERROR_HANDLER{});
483 }
484
485 /** Get maximum size of each network packet transmitted
486 * @return Packet size in bytes
487 */
488 uint16_t get_packet_size() const {
489 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
490 return tof_live_camera_get_packet_size(this_class, TOF_ERROR_HANDLER{});
491 }
492
493 /** Set maximum size of each network packet transmitted
494 * @param size Packet size in bytes
495 */
496 void set_packet_size(uint16_t size) {
497 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
498 return tof_live_camera_set_packet_size(this_class, size, TOF_ERROR_HANDLER{});
499 }
500
501 /** Whether the camera is capable of returning temperatures
502 * @return Capable
503 */
505 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
506 return tof_live_camera_get_temperatures_capable(this_class, TOF_ERROR_HANDLER{});
507 }
508
509 /** Get the current on camera temperatures
510 * @return Temperatures
511 */
512 std::vector<float> get_temperatures() {
513 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
514 size_t size = tof_live_camera_get_temperatures(this_class, nullptr, 0, TOF_ERROR_HANDLER{});
515 std::vector<float> vec(size);
516 size = tof_live_camera_get_temperatures(this_class, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
517 return vec;
518 }
519
520 /** Get voltage level on given pin
521 * @param pin Pin
522 * @return Voltage 3.3V
523 */
524 bool get_gpio(size_t pin) {
525 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
526 return tof_live_camera_get_gpio(this_class, pin, TOF_ERROR_HANDLER{});
527 }
528
529 /** Set voltage level on given pin
530 * @param pin Pin
531 * @param level Voltage level
532 */
533 void set_gpio(size_t pin, bool level) {
534 auto this_class = reinterpret_cast<tof_live_camera_t>(this->ptr_);
535 return tof_live_camera_set_gpio(this_class, pin, level, TOF_ERROR_HANDLER{});
536 }
537
538};
539
540} // tof
541} // chronoptics
542
543#endif
This class contains all the calibration information.
Definition: calibration.hpp:38
This class allows you to view/edit the camera settings.
The main interface to the depth cameras.
Definition: camera.hpp:17
const char * get_serial() const
Get the serial number of the current camera.
Definition: camera.hpp:130
bool is_streaming() const
Check whether the camera is streaming.
Definition: camera.hpp:39
bool is_connected() const
Check whether the camera is still connected.
Definition: camera.hpp:46
void clear_buffer()
Clear the circular buffer used to store frames.
Definition: camera.hpp:97
void stop()
Stop streaming of the camera.
Definition: camera.hpp:32
void set_user_pointer_capacity(size_t capacity)
Set the amount of user pointers that can be stored.
Definition: camera.hpp:154
std::vector< Stream > get_stream_list() const
Get the different output streams the camera can provide.
Definition: camera.hpp:53
std::vector< FrameType > possible_frame_types() const
Get the frame types that this camera can output.
Definition: camera.hpp:209
std::vector< CameraConfig > get_multiple_camera_configurations() const
Get all the set camera configurations.
Definition: camera.hpp:251
CameraConfig get_camera_config() const
Get the currently active camera config.
Definition: camera.hpp:120
bool output_frame_types_set()
Whether output frame types have been set.
Definition: camera.hpp:219
void clear_user_pointers()
Clear all user pointers in memory.
Definition: camera.hpp:187
std::vector< const char * > get_multiple_descriptions() const
Get the description for each configuration.
Definition: camera.hpp:289
std::vector< FrameType > get_output_frame_types() const
Get the frame types the camera should output.
Definition: camera.hpp:226
Camera(tof_camera_t ptr=nullptr)
Construct from pointer.
Definition: camera.hpp:20
void add_user_pointer(uint8_t *pointer, size_t capacity, tof_user_pointer_destructed_t callback, void *callback_user_data, FrameType frame_type)
Add a pointer that will be filled with the specified data type.
Definition: camera.hpp:181
size_t get_user_pointer_capacity() const
Get the amount of user pointers that can be stored.
Definition: camera.hpp:147
void set_output_frame_types(const std::vector< FrameType > &output_frame_types)
Set the frame types the camera should output.
Definition: camera.hpp:236
ProcessingConfig get_process_config() const
the processing config of the camera
Definition: camera.hpp:67
bool has_frames() const
Check if the camera has frames available.
Definition: camera.hpp:77
uint32_t config_index() const
Get the currently set configuration index.
Definition: camera.hpp:194
size_t get_buffer_size() const
Get the circular buffer size.
Definition: camera.hpp:105
std::vector< const char * > get_multiple_names() const
Get the name for each configuration.
Definition: camera.hpp:279
void set_buffer_size(size_t size)
Set the circular buffer size.
Definition: camera.hpp:113
void add_user_pointer(uint8_t *pointer, size_t capacity, user_pointer_destructed_fn &callback, FrameType frame_type)
Add a pointer that will be filled with the specified data type.
Definition: camera.hpp:167
std::vector< ProcessingConfig > get_multiple_processing_configurations() const
Get all the set processing configurations.
Definition: camera.hpp:265
Calibration get_calibration() const
Get calibration from the camera.
Definition: camera.hpp:137
void switch_config(uint32_t config_index)
Switch to a different config in real time, depending on configuration and camera, this can take 100-3...
Definition: camera.hpp:202
std::vector< Data > get_frames()
Get data frames from camera.
Definition: camera.hpp:84
void start()
Start streaming of the camera.
Definition: camera.hpp:26
bool has_multiple_configurations() const
Check if multiple configurations are set.
Definition: camera.hpp:244
Functions shared across all live cameras.
Definition: camera.hpp:375
const char * version()
Get the tof library version running on the camera.
Definition: camera.hpp:383
void set_persistent_ip(const PersistentIp &persistent_ip)
Set the persistent ip settings.
Definition: camera.hpp:431
uint32_t get_delay() const
Get delay between network packets.
Definition: camera.hpp:471
void set_delay(uint32_t delay)
Set delay between network packets.
Definition: camera.hpp:480
void apply_persistent_ip()
Apply persistent ip by rebooting the camera, power cycling the camera is discouraged because the appl...
Definition: camera.hpp:447
void set_packet_size(uint16_t size)
Set maximum size of each network packet transmitted.
Definition: camera.hpp:496
std::vector< float > get_temperatures()
Get the current on camera temperatures.
Definition: camera.hpp:512
bool get_temperatures_capable()
Whether the camera is capable of returning temperatures.
Definition: camera.hpp:504
void remote_update(StringView file_location)
Update the camera remotely.
Definition: camera.hpp:403
void set_gpio(size_t pin, bool level)
Set voltage level on given pin.
Definition: camera.hpp:533
void software_trigger()
Software trigger the camera.
Definition: camera.hpp:462
uint16_t get_packet_size() const
Get maximum size of each network packet transmitted.
Definition: camera.hpp:488
bool apply_persistent_ip_capable() const
Whether the camera is capable of applying the persistent ip.
Definition: camera.hpp:439
PersistentIp get_persistent_ip()
Get the current persistent ip settings.
Definition: camera.hpp:419
bool remote_update_capable()
Check whether the camera is capable of updating remotely.
Definition: camera.hpp:391
bool software_trigger_capable()
Check whether the camera is capable of software trigger.
Definition: camera.hpp:455
LiveCamera(tof_live_camera_t ptr=nullptr)
Construct from pointer.
Definition: camera.hpp:378
bool get_gpio(size_t pin)
Get voltage level on given pin.
Definition: camera.hpp:524
bool persistent_ip_capable() const
Whether the camera is capable of setting persistent ip.
Definition: camera.hpp:411
A persistent ip data structure.
Definition: camera.hpp:300
void set_gateway(StringView gateway)
Set the gateway.
Definition: camera.hpp:353
bool get_enabled() const
Get if persistent ip is enabled.
Definition: camera.hpp:360
void set_enabled(bool enabled)
Set if persistent ip is enabled.
Definition: camera.hpp:367
const char * get_ip() const
Get the IP address.
Definition: camera.hpp:318
void set_netmask(StringView netmask)
Set the netmask.
Definition: camera.hpp:339
const char * get_netmask() const
Get the netmask.
Definition: camera.hpp:332
PersistentIp(tof_persistent_ip_t ptr=nullptr)
Construct from pointer.
Definition: camera.hpp:303
void set_ip(StringView ip)
Set the IP address.
Definition: camera.hpp:325
PersistentIp(StringView ip, StringView netmask, StringView gateway, bool enabled)
Create persistent ip.
Definition: camera.hpp:313
const char * get_gateway() const
Get the gateway.
Definition: camera.hpp:346
Processing that can be done.