|
#define | DEFAULT_STEREO true |
|
#define | DEFAULT_XRT_VIDEO_FORMAT XRT_FORMAT_L8 |
|
#define | DEFAULT_VIDEO_FORMAT RS2_FORMAT_Y8 |
|
#define | DEFAULT_VIDEO_WIDTH 640 |
|
#define | DEFAULT_VIDEO_HEIGHT 360 |
|
#define | DEFAULT_VIDEO_FPS 30 |
|
#define | DEFAULT_VIDEO_CHANGE_EXPOSURE true |
|
#define | DEFAULT_VIDEO_AUTOEXPOSURE false |
|
#define | DEFAULT_VIDEO_EXPOSURE 6000 |
|
#define | DEFAULT_VIDEO_GAIN 127 |
|
#define | DEFAULT_GYRO_FPS 200 |
|
#define | DEFAULT_ACCEL_FPS 250 |
|
#define | DEFAULT_STREAM_TYPE RS2_STREAM_INFRARED |
|
#define | DEFAULT_STREAM1_INDEX 1 |
|
#define | DEFAULT_STREAM2_INDEX 2 |
|
#define | RS_DEVICE_STR "Intel RealSense Host-SLAM" |
|
#define | RS_SOURCE_STR "RealSense Source" |
|
#define | RS_HOST_SLAM_TRACKER_STR "Host SLAM Tracker for RealSense" |
|
#define | RS_TRACE(r, ...) U_LOG_IFL_T(r->log_level, __VA_ARGS__) |
|
#define | RS_DEBUG(r, ...) U_LOG_IFL_D(r->log_level, __VA_ARGS__) |
|
#define | RS_INFO(r, ...) U_LOG_IFL_I(r->log_level, __VA_ARGS__) |
|
#define | RS_WARN(r, ...) U_LOG_IFL_W(r->log_level, __VA_ARGS__) |
|
#define | RS_ERROR(r, ...) U_LOG_IFL_E(r->log_level, __VA_ARGS__) |
|
#define | RS_ASSERT(predicate, ...) |
|
#define | RS_ASSERT_(predicate) RS_ASSERT(predicate, "Assertion failed " #predicate) |
|
#define | RS_DASSERT(predicate, ...) RS_ASSERT(predicate, __VA_ARGS__) |
|
#define | RS_DASSERT_(predicate) RS_ASSERT_(predicate) |
|
#define | DO(call, ...) |
| Utility for realsense API calls that can produce errors. More...
|
|
#define | DO_(call) |
| Alternative to DO() with no arguments. More...
|
|
#define | JSON_CONFIG_FIELD_NAME "config_realsense_hdev" |
|
|
static void | receive_left_frame (struct xrt_frame_sink *sink, struct xrt_frame *) |
|
static void | receive_right_frame (struct xrt_frame_sink *sink, struct xrt_frame *) |
|
static void | receive_imu_sample (struct xrt_imu_sink *sink, struct xrt_imu_sample *) |
|
static void | rs_source_node_break_apart (struct xrt_frame_node *) |
|
static void | rs_source_node_destroy (struct xrt_frame_node *) |
|
static bool | check_error (struct rs_source *rs, rs2_error *e, const char *file, int line) |
|
static struct rs_hdev * | rs_hdev_from_xdev (struct xrt_device *xdev) |
|
static XRT_MAYBE_UNUSED struct xrt_pose | rs_hdev_correct_pose_from_kimera (struct xrt_pose pose) |
| Specific pose corrections for Kimera and the D455 camera. More...
|
|
static XRT_MAYBE_UNUSED struct xrt_pose | rs_hdev_correct_pose_from_basalt (struct xrt_pose pose) |
| Specific pose corrections for Basalt and the D455 camera. More...
|
|
static xrt_result_t | rs_hdev_get_tracked_pose (struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation) |
|
static void | rs_hdev_destroy (struct xrt_device *xdev) |
|
static void | json_int (struct rs_source *rs, const cJSON *json, const char *field, int *out) |
| Helper function for loading an int field from a json container and printing useful messages along it. More...
|
|
static void | json_bool (struct rs_source *rs, const cJSON *json, const char *field, bool *out) |
| Similar to json_int but for bools. More...
|
|
static void | json_rs2_format (struct rs_source *rs, const cJSON *json, const char *field, rs2_format *out_rformat, enum xrt_format *out_xformat) |
| Similar to json_int but for a video rs2_format, also sets the equivalent xrt_format if any. More...
|
|
static void | json_rs2_stream (struct rs_source *rs, const cJSON *json, const char *field, rs2_stream *out_stream) |
| Similar to json_int but for a rs2_stream type. More...
|
|
static void | rs_source_load_stream_options_from_json (struct rs_source *rs) |
|
static bool | set_option_in_all_sensors (struct rs_source *rs, enum rs2_option option, float value) |
| Set an option for all sensors. Return whether it was set for any. More...
|
|
static void | update_options (struct rs_source *rs) |
| Submit changes to supported options to the device. More...
|
|
static void | rs_source_frame_destroy (struct xrt_frame *xf) |
|
static timepoint_ns | get_frame_monotonic_ts_from (struct rs_source *rs, rs2_frame *frame, uint64_t unow_monotonic, uint64_t unow_realtime) |
|
static timepoint_ns | get_frame_monotonic_ts (struct rs_source *rs, rs2_frame *frame) |
| Convert device_ts to monotonic clock. More...
|
|
static void | rs2xrt_frame (struct rs_source *rs, rs2_frame *rframe, struct xrt_frame **out_xframe) |
|
static void | handle_frameset (struct rs_source *rs, rs2_frame *frames) |
|
static void | partial_imu_sample_push (struct rs_source *rs, timepoint_ns ts, struct xrt_vec3 vals, bool is_gyro) |
| Decides when to submit the full IMU sample out of separate gyroscope/accelerometer samples. More...
|
|
static void | handle_gyro_frame (struct rs_source *rs, rs2_frame *frame) |
|
static void | handle_accel_frame (struct rs_source *rs, rs2_frame *frame) |
|
static void | check_global_time (struct rs_source *rs, rs2_frame *frame, rs2_stream stream_type) |
| Checks that the timestamp domain of the realsense sample (the frame) is in global time or, at the very least, in another domain that we support. More...
|
|
static void | on_frame (rs2_frame *frame, void *ptr) |
|
static void | rs_source_apply_changes_ctn_cb (void *ptr) |
|
static struct rs_source * | rs_source_from_xfs (struct xrt_fs *xfs) |
|
static bool | rs_source_enumerate_modes (struct xrt_fs *xfs, struct xrt_fs_mode **out_modes, uint32_t *out_count) |
|
static bool | rs_source_configure_capture (struct xrt_fs *xfs, struct xrt_fs_capture_parameters *cp) |
|
static bool | rs_source_stream_stop (struct xrt_fs *xfs) |
|
static bool | rs_source_is_running (struct xrt_fs *xfs) |
|
static bool | rs_source_stream_start (struct xrt_fs *xfs, struct xrt_frame_sink *xs, enum xrt_fs_capture_type capture_type, uint32_t descriptor_index) |
|
static bool | rs_source_slam_stream_start (struct xrt_fs *xfs, struct xrt_slam_sinks *sinks) |
|
struct xrt_device * | rs_hdev_create (struct xrt_prober *xp, int device_idx) |
| Create RealSense device tracked with host-SLAM (one with camera and IMU streams) More...
|
|
struct xrt_fs * | rs_source_create (struct xrt_frame_context *xfctx, int device_idx) |
| Create and open the frame server for IMU/camera streaming. More...
|
|
RealSense device tracked with host-SLAM.
- Author
- Mateo de Mayo mateo.nosp@m..dem.nosp@m.ayo@c.nosp@m.olla.nosp@m.bora..nosp@m.com
Originally created and tried on the D455 model but should work in any RealSense device that has video and IMU streams.
Be aware that you need to properly set the SLAM_CONFIG file to match your camera specifics (stereo/mono, intrinsics, extrinsics, etc).