-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Not all frames run? #8704
Comments
Hi @ls880 A RealSense team member provides guidance in the link below about how to obtain the timestamp of each frame of a program in the RealSense MATLAB wrapper, such as rosbag_example.m. Is this helpful to you, please? As the MATLAB script that the advice refers to has been updated slightly since the comment in the above link was written, I believe that the line that the advice is likely referring to is this: https://github.com/IntelRealSense/librealsense/blob/master/wrappers/matlab/frame.m#L28 |
Sorry for the late reply, I have been having computer problems. I have tried this and I get an error stating that timestamp domain is the system time, not the frame time. This also come up on the RS viewer tool. How do I change this? |
It also states that per frame metadata isn't enable at OS level and to follow installation guide for details |
But essentially I still have the problem that the frames do not run in order? Even using this feature I can see that the frames seemingly come out randomly? |
If you are using the RealSense MATLAB wrapper then you are likely using Windows 10 on your computer. Is that correct, please? If you are using Windows, then you can enable metadata for your camera in the RealSense Viewer program. If a Frame Metadata Disabled box pops up in the corner of the Viewer when it is launched then left-click on the box's Enable button to enable per-frame metadata. |
Hi, I have tried this but when I run the code files the frames still do no run in order, they seem completely random |
A bag file always runs in the forward direction when played and does not run backwards. So there is a certain amount of predictable linearity in the playback, and once the bag reaches the end then it will loop around to the start and play from start frame to end again unless playback looping is disabled. Could you tell me please which method you use to stop the bag playback and check the frame number? If you were using a 'stop' button then it would be very hard to stop the playback on the same frame number each time due to te speed at which frames are played back. |
I am currently using the beginning of the pointcloud example to run through the frames and have put a break point at the end of the loop. Many frames seem to be missing when using this method. I have been advised that with .bag files, some frames are not able to be captured fast enough and the next one will be used instead. Is there a way I can ensure that all frames are captured? function pointcloud_example(Cross)
|
Is it possible o implement the playback.m rather than pipeline.m and alter the playback speed, line 49? |
Apologies for the delay in responding further. Looking through your code, I notice that it is not using a command called playback.set_real_time(false); Setting set_real_time to False is commonly done to help ensure smooth playback when reading frames from a bag file instead of live camera data. A C++ example script that demonstrates this function is in the link below. The official SDK documentation entry about set_real_time is here: |
I have tried adding this in but I only seem to get error messages that there are not enough inputs, or "Unable to resolve the name playback.set_real_time"? I tried to implement similar to this issue: #3126 cfg.enable_device_from_file(filename) % Make Pipeline object to manage streaming % Start streaming from the file with default settings |
Comparing your code to the linked-to script, it looks as though playback has not been defined in the line before it is called by playback.set_real_time
I also note that your quoted script above is missing some semicolons on the end of the lines, in these lines: cfg.enable_device_from_file(filename) |
This is not valid code in matlab, so I wrote it as below but I still get the error. It seems to want a second input for the index? Error: Error in realsense.playback (line 6) Code: |
I found an example of a RealSense user who wrote a set_real_time playback routine in the MATLAB wrapper and how it was debugged. |
This is great, these comments have helped me find the error thank you! One last question; is there any way to find the number of depth frames, other than using the realsense viewer? |
Great news that you were successful with get_real_time in the MATLAB wrapper! If you are using a bag file, you could check the number of messages in the recorded depth topics with the SDK's rosbag inspector C++ tool. https://github.com/IntelRealSense/librealsense/tree/master/tools/rosbag-inspector |
Hi @ls880 Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
When running functions like pointcloud and rosbag_example on matlab, I'm unsure these run every frame. If I stop at the same point running two different times this gives a different output? How do I ensure every frame is chosen to run?
The text was updated successfully, but these errors were encountered: