Class software_sensor

Inheritance Relationships

Base Type

Class Documentation

class software_sensor : public rs2::sensor

Public Functions

inline stream_profile add_video_stream(rs2_video_stream video_stream, bool is_default = false)

Add video stream to software sensor

Parameters:

video_stream[in] all the parameters that required to defind video stream

inline stream_profile add_motion_stream(rs2_motion_stream motion_stream, bool is_default = false)

Add motion stream to software sensor

Parameters:

motion[in] all the parameters that required to defind motion stream

inline stream_profile add_pose_stream(rs2_pose_stream pose_stream, bool is_default = false)

Add pose stream to software sensor

Parameters:

pose[in] all the parameters that required to defind pose stream

inline void on_video_frame(rs2_software_video_frame frame)

Inject video frame into the sensor

Parameters:

frame[in] all the parameters that required to define video frame

inline void on_motion_frame(rs2_software_motion_frame frame)

Inject motion frame into the sensor

Parameters:

frame[in] all the parameters that required to define motion frame

inline void on_pose_frame(rs2_software_pose_frame frame)

Inject pose frame into the sensor

Parameters:

frame[in] all the parameters that required to define pose frame

inline void set_metadata(rs2_frame_metadata_value value, rs2_metadata_type type)

Set frame metadata for the upcoming frames

Parameters:
  • value[in] metadata key to set

  • type[in] metadata value

inline void add_read_only_option(rs2_option option, float val)

Register read-only option that will be supported by the sensor

Parameters:
  • option[in] the option

  • val[in] the initial value

inline void set_read_only_option(rs2_option option, float val)

Update value of registered read-only option

Parameters:
  • option[in] the option

  • val[in] the initial value

inline void add_option(rs2_option option, const option_range &range, bool is_writable = true)

Register option that will be supported by the sensor

Parameters:
  • option[in] the option

  • range[in] range data for the option. range.def will be used as the initial value

inline void on_notification(rs2_software_notification notif)
inline void detach()

Sensors hold the parent device in scope via a shared_ptr. This function detaches that so that the software sensor doesn’t keep the software device alive. Note that this is dangerous as it opens the door to accessing freed memory if care isn’t taken.