|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
4 #ifndef LIBREALSENSE_RS2_SENSOR_HPP
5 #define LIBREALSENSE_RS2_SENSOR_HPP
75 return _serialized_data;
79 std::string _description;
80 double _timestamp = -1;
83 std::string _serialized_data;
89 T on_notification_function;
102 class sensor :
public options
130 return is_supported > 0;
151 void open(
const std::vector<stream_profile>& profiles)
const
155 std::vector<const rs2_stream_profile*> profs;
156 profs.reserve(profiles.size());
157 for (
auto& p : profiles)
159 profs.push_back(p.get());
164 static_cast<int>(profiles.size()),
221 std::vector<stream_profile> results{};
224 std::shared_ptr<rs2_stream_profile_list> list(
232 for (
auto i = 0; i <
size; i++)
236 results.push_back(profile);
248 std::vector<stream_profile> results{};
251 std::shared_ptr<rs2_stream_profile_list> list(
259 for (
auto i = 0; i <
size; i++)
263 results.push_back(profile);
275 std::vector<filter> results{};
278 std::shared_ptr<rs2_processing_block_list> list(
286 for (
auto i = 0; i <
size; i++)
288 auto f = std::shared_ptr<rs2_processing_block>(
292 results.push_back(f);
315 operator bool()
const
320 const std::shared_ptr<rs2_sensor>&
get()
const
339 explicit sensor(std::shared_ptr<rs2_sensor> dev)
343 explicit operator std::shared_ptr<rs2_sensor>() {
return _sensor; }
352 std::shared_ptr<rs2_sensor>
_sensor;
360 return std::make_shared<sensor>(psens);
363 inline bool operator==(
const sensor& lhs,
const sensor& rhs)
373 class color_sensor :
public sensor
386 operator bool()
const {
return _sensor.get() !=
nullptr; }
389 class motion_sensor :
public sensor
402 operator bool()
const {
return _sensor.get() !=
nullptr; }
405 class fisheye_sensor :
public sensor
418 operator bool()
const {
return _sensor.get() !=
nullptr; }
421 class roi_sensor :
public sensor
451 operator bool()
const {
return _sensor.get() !=
nullptr; }
454 class depth_sensor :
public sensor
479 operator bool()
const {
return _sensor.get() !=
nullptr; }
483 class depth_stereo_sensor :
public depth_sensor
507 operator bool()
const {
return _sensor.get() !=
nullptr; }
511 class pose_sensor :
public sensor
549 std::vector<uint8_t> results;
618 operator bool()
const {
return _sensor.get() !=
nullptr; }
622 class wheel_odometer :
public sensor
662 operator bool()
const {
return _sensor.get() !=
nullptr; }
666 class calibrated_sensor :
public sensor
680 operator bool()
const {
return _sensor.get() !=
nullptr; }
728 class max_usable_range_sensor :
public sensor
742 operator bool()
const {
return _sensor.get() !=
nullptr; }
756 class debug_stream_sensor :
public sensor
770 operator bool()
const {
return _sensor.get() !=
nullptr; }
778 std::vector< stream_profile > results;
781 std::shared_ptr< rs2_stream_profile_list > list(
789 for(
auto i = 0; i <
size; i++ )
793 results.push_back( profile );
800 #endif // LIBREALSENSE_RS2_SENSOR_HPP
void rs2_set_notifications_callback_cpp(const rs2_sensor *sensor, rs2_notifications_callback *callback, rs2_error **error)
set callback to get notifications from specified device
3D vector in Euclidean coordinate space
float get_depth_scale() const
Retrieves mapping between the units of the depth image and meters.
void rs2_delete_processing_block(rs2_processing_block *block)
Deletes the processing block.
float get_stereo_baseline() const
Retrieve the stereoscopic baseline value from the sensor.
void open(const stream_profile &profile) const
open sensor for exclusive access, by committing to a configuration
int rs2_load_wheel_odometry_config(const rs2_sensor *sensor, const unsigned char *odometry_config_buf, unsigned int blob_size, rs2_error **error)
Load Wheel odometer settings from host to device.
Quaternion used to represent rotation
std::shared_ptr< sensor > sensor_from_frame(frame f)
rs2_processing_block * rs2_get_processing_block(const rs2_processing_block_list *list, int index, rs2_error **error)
Returns specific processing blocks from processing blocks list.
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented.
float rs2_get_stereo_baseline(rs2_sensor *sensor, rs2_error **error)
Retrieve the stereoscopic baseline value from sensor.
std::vector< stream_profile > get_debug_stream_profiles() const
Retrieves the list of debug stream profiles supported by the sensor.
float rs2_get_depth_scale(rs2_sensor *sensor, rs2_error **error)
When called on a depth sensor, this method will return the number of meters represented by a single d...
void rs2_override_intrinsics(const rs2_sensor *sensor, const rs2_intrinsics *intrinsics, rs2_error **error)
Override intrinsics of a given sensor that supports calibrated_sensor.
std::vector< stream_profile > get_stream_profiles() const
Retrieves the list of stream profiles supported by the sensor.
int rs2_get_static_node(const rs2_sensor *sensor, const char *guid, rs2_vector *pos, rs2_quaternion *orient, rs2_error **error)
Retrieve a named location tag.
rs2_notification_category
Category of the librealsense notification.
bool supports(rs2_camera_info info) const
check if specific camera info is supported
sensor(std::shared_ptr< rs2_sensor > dev)
void rs2_override_dsm_params(rs2_sensor const *sensor, rs2_dsm_params const *p_params, rs2_error **error)
Set the sensor DSM parameters This should ideally be done when the stream is NOT running.
bool set_static_node(const std::string &guid, const rs2_vector &pos, const rs2_quaternion &orient) const
Creates a named virtual landmark in the current map, known as static node.
void set_notifications_callback(T callback) const
register notifications callback
int rs2_remove_static_node(const rs2_sensor *sensor, const char *guid, rs2_error **error)
Remove a named location tag.
rs2_time_t rs2_get_notification_timestamp(rs2_notification *notification, rs2_error **error)
retrieve timestamp from notification handle
Video DSM (Digital Sync Module) parameters for calibration (same layout as in FW ac_depth_params) Thi...
void open(const std::vector< stream_profile > &profiles) const
open sensor for exclusive access, by committing to composite configuration, specifying one or more st...
rs2_notification_category get_category() const
retrieve the notification category
int rs2_import_localization_map(const rs2_sensor *sensor, const unsigned char *lmap_blob, unsigned int blob_size, rs2_error **error)
Imports a localization map from file to tm2 tracking device.
void reset_calibration()
Reset the sensor DSM calibration.
void rs2_stop(const rs2_sensor *sensor, rs2_error **error)
stops streaming from specified configured device
depth_sensor(std::shared_ptr< rs2_sensor > dev)
int rs2_set_static_node(const rs2_sensor *sensor, const char *guid, const rs2_vector pos, const rs2_quaternion orient, rs2_error **error)
Create a named location tag.
void set_region_of_interest(const region_of_interest &roi)
notification(rs2_notification *nt)
rs2_camera_info
Read-only strings that can be queried from the device.
void close() const
close sensor for exclusive access this method should be used for releasing sensor resource
@ RS2_EXTENSION_DEPTH_STEREO_SENSOR
@ RS2_EXTENSION_MAX_USABLE_RANGE_SENSOR
const char * rs2_get_notification_serialized_data(rs2_notification *notification, rs2_error **error)
retrieve serialized data from notification handle
wheel_odometer(std::shared_ptr< rs2_sensor > dev)
@ RS2_EXTENSION_DEPTH_SENSOR
int rs2_send_wheel_odometry(const rs2_sensor *sensor, char wo_sensor_id, unsigned int frame_num, const rs2_vector translational_velocity, rs2_error **error)
Send wheel odometry data for each individual sensor (wheel)
@ RS2_EXTENSION_FISHEYE_SENSOR
region_of_interest get_region_of_interest() const
rs2_notification_category rs2_get_notification_category(rs2_notification *notification, rs2_error **error)
retrieve category from notification handle
std::string get_serialized_data() const
retrieve the notification's serialized data
rs2_log_severity
Severity of the librealsense logger.
bool send_wheel_odometry(uint8_t wo_sensor_id, uint32_t frame_num, const rs2_vector &translational_velocity)
Send wheel odometry data for each individual sensor (wheel)
@ RS2_EXTENSION_POSE_SENSOR
int rs2_get_recommended_processing_blocks_count(const rs2_processing_block_list *list, rs2_error **error)
Returns the processing blocks list size.
void rs2_open(rs2_sensor *device, const rs2_stream_profile *profile, rs2_error **error)
open subdevice for exclusive access, by committing to a configuration
sensor & operator=(const std::shared_ptr< rs2_sensor > other)
bool load_wheel_odometery_config(const std::vector< uint8_t > &odometry_config_buf) const
Load Wheel odometer settings from host to device.
void rs2_get_dsm_params(rs2_sensor const *sensor, rs2_dsm_params *p_params_out, rs2_error **error)
Get the DSM parameters for a sensor.
max_usable_range_sensor(sensor s)
std::vector< stream_profile > get_active_streams() const
Retrieves the list of stream profiles currently streaming on the sensor.
struct rs2_raw_data_buffer rs2_raw_data_buffer
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
delete stream profiles list
bool remove_static_node(const std::string &guid) const
Removes a static node from the current map.
@ RS2_EXTENSION_COLOR_SENSOR
void on_notification(rs2_notification *_notification) override
void override_dsm_params(rs2_dsm_params const ¶ms)
Set the sensor DSM parameters This should ideally be done when the stream is NOT running.
bool supports(rs2_option option) const
check if particular option is supported
@ RS2_CAMERA_INFO_SERIAL_NUMBER
Device serial number.
struct rs2_options rs2_options
bool get_static_node(const std::string &guid, rs2_vector &pos, rs2_quaternion &orient) const
Gets the current pose of a static node that was created in the current map or in an imported map.
std::shared_ptr< rs2_sensor > _sensor
void rs2_get_region_of_interest(const rs2_sensor *sensor, int *min_x, int *min_y, int *max_x, int *max_y, rs2_error **error)
gets the active region of interest to be used by auto-exposure algorithm
@ RS2_EXTENSION_WHEEL_ODOMETER
std::vector< filter > get_recommended_filters() const
get the recommended list of filters by the sensor
void rs2_delete_sensor(rs2_sensor *sensor)
delete relasense sensor
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
Delete rs2_raw_data_buffer.
constexpr absl::OTABSL_OPTION_NAMESPACE_NAME::remove_reference_t< T > && move(T &&t) noexcept
int rs2_get_stream_profiles_count(const rs2_stream_profile_list *list, rs2_error **error)
get the number of supported stream profiles
int rs2_supports_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
check if specific sensor info is supported
rs2_log_severity rs2_get_notification_severity(rs2_notification *notification, rs2_error **error)
retrieve severity from notification handle
calibrated_sensor(sensor s)
const rs2_stream_profile * rs2_get_stream_profile(const rs2_stream_profile_list *list, int index, rs2_error **error)
Get pointer to specific stream profile.
@ RS2_NOTIFICATION_CATEGORY_COUNT
Number of enumeration values.
depth_stereo_sensor(sensor s)
struct rs2_notification rs2_notification
debug_stream_sensor(sensor s)
void rs2_reset_sensor_calibration(rs2_sensor const *sensor, rs2_error **error)
Reset the sensor DSM parameters This should ideally be done when the stream is NOT running.
rs2_processing_block_list * rs2_get_recommended_processing_blocks(rs2_sensor *sensor, rs2_error **error)
Returns the list of recommended processing blocks for a specific sensor.
@ RS2_CAMERA_INFO_NAME
Friendly name.
const rs2_stream_profile * get() const
Get back the internal stream profile instance.
void override_extrinsics(rs2_extrinsics const &extr)
Override the intrinsics at the sensor level, as DEPTH_TO_RGB calibration does.
constexpr const char * size
void rs2_start_cpp(const rs2_sensor *sensor, rs2_frame_callback *callback, rs2_error **error)
start streaming from specified configured sensor
int rs2_is_sensor_extendable_to(const rs2_sensor *sensor, rs2_extension extension, rs2_error **error)
Test if the given sensor can be extended to the requested extension.
bool operator==(const sensor &lhs, const sensor &rhs)
pose_sensor(std::shared_ptr< rs2_sensor > dev)
sensor & operator=(const sensor &other)
options & operator=(const options &other)
void stop() const
stop streaming
void rs2_override_extrinsics(const rs2_sensor *sensor, const rs2_extrinsics *extrinsics, rs2_error **error)
Override extrinsics of a given sensor that supports calibrated_sensor.
const char * get_info(rs2_camera_info info) const
retrieve camera specific information, like versions of various internal components
rs2_stream_profile_list * rs2_get_active_streams(rs2_sensor *sensor, rs2_error **error)
check how subdevice is streaming
rs2_stream_profile_list * rs2_get_debug_stream_profiles(rs2_sensor *sensor, rs2_error **error)
retrieve list of debug stream profiles that given subdevice can provide
const std::shared_ptr< rs2_sensor > & get() const
void rs2_set_region_of_interest(const rs2_sensor *sensor, int min_x, int min_y, int max_x, int max_y, rs2_error **error)
sets the active region of interest to be used by auto-exposure algorithm
float get_max_usable_depth_range() const
Retrieves the maximum range of the camera given the amount of ambient light in the scene.
void rs2_open_multiple(rs2_sensor *device, const rs2_stream_profile **profiles, int count, rs2_error **error)
open subdevice for exclusive access, by committing to composite configuration, specifying one or more...
@ RS2_EXTENSION_DEBUG_STREAM_SENSOR
const rs2_raw_data_buffer * rs2_export_localization_map(const rs2_sensor *sensor, rs2_error **error)
Extract and store the localization map of tm2 tracking device to file.
const char * rs2_get_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
retrieve sensor specific information, like versions of various internal components
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
get the size of rs2_raw_data_buffer
@ RS2_EXTENSION_MOTION_SENSOR
rs2_dsm_params get_dsm_params() const
Override the intrinsics at the sensor level, as DEPTH_TO_RGB calibration does.
const char * rs2_get_notification_description(rs2_notification *notification, rs2_error **error)
retrieve description from notification handle
notifications_callback(T on_notification)
static void handle(rs2_error *e)
@ RS2_EXTENSION_CALIBRATED_SENSOR
@ RS2_LOG_SEVERITY_COUNT
Number of enumeration values.
std::vector< uint8_t > export_localization_map() const
Get relocalization map that is currently on device, created and updated during most recent tracking s...
void rs2_close(const rs2_sensor *sensor, rs2_error **error)
stop any streaming from specified subdevice
void override_intrinsics(rs2_intrinsics const &intr)
Override the intrinsics at the sensor level, as DEPTH_TO_RGB calibration does.
double get_timestamp() const
retrieve the notification arrival timestamp
rs2_stream_profile_list * rs2_get_stream_profiles(rs2_sensor *sensor, rs2_error **error)
check if physical subdevice is supported
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
Retrieve char array from rs2_raw_data_buffer.
float rs2_get_max_usable_depth_range(rs2_sensor const *sensor, rs2_error **error)
When called on a depth sensor, this method will return the maximum range of the camera given the amou...
bool import_localization_map(const std::vector< uint8_t > &lmap_buf) const
Load relocalization map onto device.
void rs2_delete_recommended_processing_blocks(rs2_processing_block_list *list)
Deletes processing blocks list.
std::string get_description() const
retrieve the notification description
void start(T callback) const
Start passing frames into user provided callback.
rs2_log_severity get_severity() const
retrieve the notification severity
struct rs2_error rs2_error