1#ifndef _CHRONOPTICS_TOF_KEA_CAMERA_HPP_
2#define _CHRONOPTICS_TOF_KEA_CAMERA_HPP_
4#include <chronoptics/tof/kea_camera.h>
6#include <chronoptics/tof/camera.hpp>
7#include <chronoptics/tof/processing_config.hpp>
8#include <chronoptics/tof/camera_config.hpp>
9#include <chronoptics/tof/gige_interface.hpp>
11namespace chronoptics {
19 KeaCamera(tof_kea_camera_t ptr =
nullptr) :
Camera(reinterpret_cast<tof_camera_t>(ptr)) {}
33 this->ptr_ =
reinterpret_cast<tof_camera_t
>(tof_kea_camera_new(*
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), serial, TOF_ERROR_HANDLER{}));
48 this->ptr_ =
reinterpret_cast<tof_camera_t
>(tof_kea_camera_new_simple(serial, TOF_ERROR_HANDLER{}));
64 this->ptr_ =
reinterpret_cast<tof_camera_t
>(tof_kea_camera_new_both_configs(*
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), serial, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), TOF_ERROR_HANDLER{}));
71 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
72 return tof_kea_camera_on_camera_processing_capable(this_class, TOF_ERROR_HANDLER{});
79 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
80 return tof_kea_camera_get_on_camera_processing(this_class, TOF_ERROR_HANDLER{});
88 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
89 return tof_kea_camera_set_on_camera_processing(this_class, on_camera_processing, TOF_ERROR_HANDLER{});
97 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
98 return tof_kea_camera_get_delay(this_class, TOF_ERROR_HANDLER{});
106 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
107 return tof_kea_camera_set_delay(this_class, delay, TOF_ERROR_HANDLER{});
114 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
115 return tof_kea_camera_get_packet_size(this_class, TOF_ERROR_HANDLER{});
122 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
123 return tof_kea_camera_set_packet_size(this_class, size, TOF_ERROR_HANDLER{});
130 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
131 return tof_kea_camera_set_camera_config(this_class, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), TOF_ERROR_HANDLER{});
139 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
140 return tof_kea_camera_set_configurations(this_class, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), *
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), TOF_ERROR_HANDLER{});
147 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
148 return tof_kea_camera_version(this_class, TOF_ERROR_HANDLER{});
155 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
156 return tof_kea_camera_software_trigger_capable(this_class, TOF_ERROR_HANDLER{});
162 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
163 return tof_kea_camera_software_trigger(this_class, TOF_ERROR_HANDLER{});
170 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
171 return tof_kea_camera_remote_update_capable(this_class, TOF_ERROR_HANDLER{});
182 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
183 return tof_kea_camera_remote_update(this_class, file_location, TOF_ERROR_HANDLER{});
190 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
191 return tof_kea_camera_multiple_configurations_possible(this_class, TOF_ERROR_HANDLER{});
199 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
200 return tof_kea_camera_set_multiple_configurations(this_class,
reinterpret_cast<const tof_camera_config_t*
>(camera_configs.data()), camera_configs.size(),
reinterpret_cast<const tof_processing_config_t*
>(pro_configs.data()), pro_configs.size(), TOF_ERROR_HANDLER{});
207 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
208 return tof_kea_camera_get_temperatures_capable(this_class, TOF_ERROR_HANDLER{});
215 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
216 size_t size = tof_kea_camera_get_temperatures(this_class,
nullptr, 0, TOF_ERROR_HANDLER{});
217 std::vector<float> vec(size);
218 size = tof_kea_camera_get_temperatures(this_class, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
226 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
227 return tof_kea_camera_persistent_ip_capable(this_class, TOF_ERROR_HANDLER{});
234 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
235 PersistentIp new_persistent_ip(
static_cast<tof_persistent_ip_t
>(
nullptr));
236 auto ptr =
reinterpret_cast<tof_persistent_ip_t*
>(&new_persistent_ip);
237 *ptr = tof_kea_camera_get_persistent_ip(this_class, TOF_ERROR_HANDLER{});
238 return new_persistent_ip;
246 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
247 return tof_kea_camera_set_persistent_ip(this_class, *
reinterpret_cast<const tof_persistent_ip_t*
>(&persistent_ip), TOF_ERROR_HANDLER{});
254 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
255 return tof_kea_camera_apply_persistent_ip_capable(this_class, TOF_ERROR_HANDLER{});
262 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
263 return tof_kea_camera_apply_persistent_ip(this_class, TOF_ERROR_HANDLER{});
270class DiscoveredKea :
public detail::Base<tof_discovered_kea, tof_discovered_kea_delete> {
281 return tof_discovered_kea_serial(this->ptr_, TOF_ERROR_HANDLER{});
288 return tof_discovered_kea_info(this->ptr_, TOF_ERROR_HANDLER{});
295 return tof_discovered_kea_model(this->ptr_, TOF_ERROR_HANDLER{});
302 return tof_discovered_kea_is_tui(this->ptr_, TOF_ERROR_HANDLER{});
310inline std::vector<DiscoveredKea> discover_kea_cameras() {
311 size_t size = tof_discover_kea_cameras(
nullptr, 0, TOF_ERROR_HANDLER{});
312 std::vector<DiscoveredKea> vec;
314 for (
size_t i = 0; i < size; i++)
315 vec.emplace_back(
static_cast<tof_discovered_kea_t
>(
nullptr));
316 auto data =
reinterpret_cast<tof_discovered_kea_t*
>(vec.data());
317 size = tof_discover_kea_cameras(data, vec.size(), TOF_ERROR_HANDLER{});
336inline KeaCamera create_kea_camera_gige(
const ProcessingConfig &processing_config, StringView serial, uint16_t packet_size = 1472) {
337 KeaCamera new_kea_camera(
static_cast<tof_kea_camera_t
>(
nullptr));
338 auto ptr =
reinterpret_cast<tof_kea_camera_t*
>(&new_kea_camera);
339 *ptr = tof_create_kea_camera_gige(*
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), serial, packet_size, TOF_ERROR_HANDLER{});
340 return new_kea_camera;
This class allows you to view/edit the camera settings.
The main interface to the depth cameras.
Simple class containing information about found kea cameras.
bool is_tui() const
Check whether this camera is a TUI camera.
const char * info() const
Additional information about the discovered camera.
const char * serial() const
The serial.
DiscoveredKea(tof_discovered_kea_t ptr=nullptr)
Construct from pointer.
const char * model() const
Get the camera model name.
The main interface to the kea camera.
bool multiple_configurations_possible() const
Check whether camera supports multiple configurations.
bool on_camera_processing_capable() const
Check whether this kea camera can do on camera processing.
KeaCamera(tof_kea_camera_t ptr=nullptr)
Construct from pointer.
bool remote_update_capable()
Check whether the camera is capable of updating remotely.
void software_trigger()
Software trigger the camera.
void set_on_camera_processing(bool on_camera_processing)
Set on camera processing.
void set_multiple_configurations(const std::vector< CameraConfig > &camera_configs, const std::vector< ProcessingConfig > &pro_configs)
Set multiple configurations.
bool software_trigger_capable()
Check whether the camera is capable of software trigger.
void set_packet_size(uint16_t size)
Set maximum size of each network packet transmitted.
bool apply_persistent_ip_capable() const
Whether the camera is capable of applying the persistent ip.
bool get_temperatures_capable()
Whether the camera is capable of returning temperatures.
bool get_on_camera_processing() const
Get on camera processing.
void set_configurations(const CameraConfig &camera_config, const ProcessingConfig &processing_config)
Set both the camera and processing config.
PersistentIp get_persistent_ip() const
Get the current persistent ip settings.
uint32_t get_delay() const
Get delay between network packets.
uint16_t get_packet_size() const
Get maximum size of each network packet transmitted.
KeaCamera(const ProcessingConfig &processing_config, StringView serial, const CameraConfig &camera_config)
Construct the kea camera with the given processing and camera config.
const char * version()
Get the tof library version running on the camera.
void remote_update(StringView file_location)
Update the camera remotely.
void set_persistent_ip(const PersistentIp &persistent_ip)
Set the persistent ip settings.
std::vector< float > get_temperatures()
Get the current on camera temperatures.
void set_camera_config(const CameraConfig &camera_config)
Set the camera config.
void set_delay(uint32_t delay)
Set delay between network packets.
KeaCamera(StringView serial)
Construct the kea camera with a processing config generated by default_processing from the camera con...
void apply_persistent_ip()
Apply persistent ip by rebooting the camera, power cycling the camera is discouraged because the appl...
KeaCamera(const ProcessingConfig &processing_config, StringView serial)
Construct the kea camera.
bool persistent_ip_capable() const
Whether the camera is persistent ip capable.
A persistent ip data structure.
Processing that can be done.