Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'poll_for_frames()' method doesnt work in matlab. #6738

Closed
mk-kor opened this issue Jul 1, 2020 · 3 comments
Closed

'poll_for_frames()' method doesnt work in matlab. #6738

mk-kor opened this issue Jul 1, 2020 · 3 comments

Comments

@mk-kor
Copy link

mk-kor commented Jul 1, 2020


Required Info 'poll_for_frames()' method doesnt work in matlab.
Camera Model D415
Firmware Version
Operating System & Version Win10
Kernel Version (Linux Only)
Platform PC
SDK Version 2.35.2
Language Matlab
Segment Robot

Issue Description

Hi.

Im trying to use 'poll_for_frames()', but it doesnt work in matlab.

Im gonna attach my codes and error messages. It seems matlab cant recognize what is 'res'.

Can u give me some examples to call 'poll_for_frames()' ?

Thanks in advance !!

clc
clear all
close all

%%Set timer & Camera

tims = timerfindall;
if ~isempty(tims)
    stop(tims);
    delete(tims);
end

htim2 = timer;
set(htim2,'ExecutionMode','fixedRate');
set(htim2,'StartDelay',5);
set(htim2,'Period',1/60);
set(htim2,'TimerFcn',@(~,~)TimerFcn2);

global width height fps pipe cfg

width = 848;
height = 480;
fps = 60;


pipe = realsense.pipeline();
cfg = realsense.config();
cfg.enable_stream(realsense.stream.color,width,height,realsense.format.rgb8,fps);
cfg.enable_stream(realsense.stream.depth,width,height,realsense.format.z16,fps);

profile = pipe.start(cfg);

for i = 1:5     
         fs = pipe.wait_for_frames();
end

%%

start(htim2);

function TimerFcn2()
global pipe width height

fs = pipe.poll_for_frames();
color=fs.get_color_frame();
data=color.get_data();
img = permute(reshape(data,[3,width,height]),[3 2 1]);

imshow(img)
end

Error message.

'res' is an unrecognized function or variable.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 1, 2020

poll_for_frames support for the RealSense MATLAB wrapper was added to the SDK in version 2.34.0. So it should be accessible in 2.35.2.

#5970

f516a8a

@lramati Could you advise please? Thanks!

@mk-kor
Copy link
Author

mk-kor commented Jul 13, 2020

#6786

Fixed ! I'll close the case.

thanks.

@mk-kor mk-kor closed this as completed Jul 13, 2020
@MartyG-RealSense
Copy link
Collaborator

Great news - thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants