-
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
Segmentation fault on a Raspberry Pi 4 when recieving a frame inside a ROS service #6366
Comments
Hi @f4b14n1 The first question I would ask in a case involving a segmentation fault is whether you have configured a Swap File on your Pi. |
Hello @MartyG-RealSense Yes, the Pi has 4 GB of RAM and I have a swap file of 2 GB configured. |
Do you have an up to date firmware driver installed inside your camera please? One Pi user with a segmentation fault was able to fix it just by updating the firmware. This can be done through the RealSense Viewer program by going to the 'More' option at the top of the options side-panel and selecting the option from its menu to update to recommended firmware. |
Thank you for your quick response. I updated the camera firmware to version 05.11.06.250, sadly the error still seems to persist. |
It may not make a difference to this particular problem but it is a good idea to use a relatively recent firmware. There has not been a Production firmware for a while, so if you are concerned about having production-level stability, a good rule is to use "one version back" for SDK and firmware. This gives time for any problems in a new version to come to light. For firmware, the second newest version is currently 5.12.2.100. |
Do you require any further assistance with this case or can it be closed, please? Thanks! |
I updated the firmware version to 5.12.2.100 as mentioned, but the error is still there. I rewrote the problematic bit to use the ros wrapper now, so this issue can be closed. Thanks for your assistance. |
I'm pleased that you found a solution that worked for you. Thanks for the update! |
Issue Description
For a project in ROS I want to implement a service that returns a set number of depth frames from a D415 on a Raspberry Pi 4. Due to the fact that the camera should not be running all the time I planned on directly using the SDK inside the service call to turn the camera on and off. However I recieve a segfault whenever I try to get a frame from the SDK. The code works without problems on a normal computer. This is the relevant bit inside the service function of a minimal working example:
int currentBufferSize_{0}, maxBufferSize_{30};
// Create a Pipeline - this serves as a top-level API for streaming and processing frames
rs2::pipeline p;
// Configure and start the pipeline
rs2::pipeline_profile selection = p.start();
ROS_INFO_STREAM("Pipeline started.");
while (currentBufferSize_ <= maxBufferSize_)
{
// Block program until frames arrive
rs2::frameset frames = p.wait_for_frames(); // <-- segfault occurs here
// Try to get a frame of a depth image
depthImages_.push_back(frames.get_depth_frame());
currentBufferSize_++;
}
I built the SDK on the Pi from source and the examples like rs-callback or rs-hello-world (whose relevant bits are almost the same as the ones here) are working without any problems. According to gdb the segfault occurs somewhere in rs_frame, you can find the output of gdb below. Thank you in advance for your assistance.
The text was updated successfully, but these errors were encountered: