Getting the picoflexx depth sensor working on ROS [solved]
Hi,
I'm trying to get the picoflexx depth sensor working with ROS Indigo on Ubuntu 14.04. I can run the normal royaleviewer.sh from the official package "libroyale-1.0.5.40-LINUX-64Bit", and the depth camera is working fine. Then I tried this wrapper here : https://github.com/fmina/ros_picoflexx It compiles fine, but when I run the launch file, I got this error :
process[firefly/picoflexx_cam-1]: started with pid [9406]
[ INFO] [1445772351.805227168]: Detecting cameras...
Detected 1 camera(s).
[firefly/picoflexx_cam-1] process has died [pid 9406, exit code -11, cmd /home/cyril/catkin_ws/devel/lib/ros_picoflexx/ros_picoflexx_node __name:=picoflexx_cam __log:=/home/cyril/.ros/log/e35b1f4c-7b07-11e5-9dd2-247703332438/firefly-picoflexx_cam-1.log].
log file: /home/cyril/.ros/log/e35b1f4c-7b07-11e5-9dd2-247703332438/firefly-picoflexx_cam-1*.log
Using rosrun leads to a segmentation fault, which is why we see exit code -11 I think. Anyone got this error and found how to fix that ?
FIRST EDIT (This was the old workaround fix) :
As suggested by gvdhoorn, I've run the node with GDB by adding to the node parameters : launch-prefix="gdb -ex run --args".
So the segmentation fault occur in the function void PicoFlexxCamera::Initialize(), when it's checking the camera id. As a workaround, I've just removed the if condition. The original code is :
for (int i = 0; i < camlist.size(); i++) {
if (camlist[i] == camera_id_) {
camera_device_ = manager_.createCamera(camlist[i]);
ROS_INFO_STREAM(camera_name_ << " initialized correctly");
}
}
So I just commented out the if :
for (int i = 0; i < camlist.size(); i++) {
//if (camlist[i] == camera_id_) {
camera_device_ = manager_.createCamera(camlist[i]);
ROS_INFO_STREAM(camera_name_ << " initialized correctly");
//}
}
The node works well, I can visualize the PointCloud2 in rviz. If someone has a better solution, please post it.
SECOND EDIT : Now the new code in the repository works fine (at this time there is just a ':' missing in the src/ros_picoflexx_node.cc file, you will get notified when launching catkin_make, just add it, this will get fix soon I think), you have to launch it once to get the camera ID and enter it in the yaml parameter file.
Try to get a gdb backtrace, to pinpoint where the thing is crashing. See Roslaunch Nodes in Valgrind or GDB for info on running nodes with gdb.
Thanks a lot for your advice, I managed to run the node with GDB and found where the issue was, I'll edit my post.
I'd be more inclined to call that a workaround. Something is wrong with the way
camlist
is being indexed, most likely. Perhaps you should keep this question open, at least until fmina/ros_picoflexx/issues/6 is resolved.