librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Matlab get_extrinsics_to error

Open delucr opened this issue 7 years ago • 7 comments

Required Info
Camera Model { D435 }
Firmware Version (0.5.10.13.00)
Operating System & Version {Win 10
Kernel Version (Linux Only) (N/A)
Platform PC
SDK Version { 2.0 }
Language {Matlab}
Segment {Other}

Issue Description

I am trying to get the extrinsics properties from IR1 to IR2 in Matlab (R2016b). I followed the API how to for getting the disparity baseline (https://github.com/IntelRealSense/librealsense/wiki/API-How-To#get-disparity-baseline). My code looks like this:

% Make Pipeline object to manage streaming pipe = realsense.pipeline();

config = realsense.config(); config.enable_all_streams();

profile = pipe.start(config);

ir1_stream = profile.get_stream(realsense.stream.infrared,1) ir2_stream = profile.get_stream(realsense.stream.infrared,2)

ir1_stream.get_extrinsics_to(ir2_stream)

I get the following error: Error using librealsense_mex rs2::stream_profile::get_extrinsics_to: Wrong number of inputs

Error in realsense.stream_profile/get_extrinsics_to (line 80) extrinsics = realsense.librealsense_mex('rs2::stream_profile', 'get_extrinsics_to', this.objectHandle, to.objectHandle);

This seems to be a problem with the mex wrapper. Thoughts?

delucr avatar Jan 16 '19 18:01 delucr

This is indeed a mistake on my part. If you take a look at the PR, this can be fixed with a minor edit to line 113 of librealsense_mex.cpp and recompiling the wrapper

lramati avatar Jan 16 '19 18:01 lramati

[Please Ignore - RealSense system comment]

@delucr Did you get it through? Looking forward to your update. Thanks!

@RealSenseCustomerSupport, tested it this morning and it works.

delucr avatar Jan 25 '19 14:01 delucr

@delucr Thanks for your update! That's great! Close the ticket accordingly.

@delucr ,I would like to ask how to get the camera parameters, because I need these parameters to convert the depth to point cloud. I refer to your method, but I don't know how to solve the error you mentioned. I am worried now.Can you help me?

nevynwong avatar May 29 '19 04:05 nevynwong

@nevynwong, if you use the latest release of the SDK and update Matlab library, you shouldn't get the error. If you are using the old code you can fix the error yourself by editing line 113 of librealsense_mex.cpp as mentioned in the above thread.

delucr avatar May 29 '19 11:05 delucr