Ask Your Question
0

Writing a Simple Image Publisher (C++) tutorial Segmentation Fault

asked 2016-11-27 14:52:28 -0600

FAD0 gravatar image

I am running ROS Kinetic full desktop install on Raspberrypi 3b running Debian Jessie. These are fresh installs with nothing else added. I followed the Simple Image Publisher/Subscriber tutorials and can successful compile. When I run my_publisher (c++) I get a Segmentation Fault. If I start up python on the command and do "import cv2" I get a Segmentation Fault. I suspect the two are related. I have all the dependencies, cv_bridge, vision_opencv. I also see cv2.so in /opt/ros/kinetic/lib/python2.7/dist-packages.

I am unclear if I need to install opencv on my own or if it is part of the ROS install. But if it isn't part of the install, why do I have a cv2.so in my ros directory? I have done a complete sd card reformat and fresh install of Jessie and then the ROS desktop install multiple times and I keep getting the same result. I have tried catkin packages and ros-packages. Can anyone give me some pointers?

edit retag flag offensive close merge delete

Comments

Any time you run into SEGFAULTs, run the binary (preferably a version with debug symbols) in gdb and after getting the SEGFAULT, get gdb to print a backtrace for you (bt).

Please add one of the tutorial C++ node you mentioned.

gvdhoorn gravatar imagegvdhoorn ( 2016-11-27 15:21:02 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-11-29 07:41:08 -0600

FAD0 gravatar image

I figured out the problem. I was publishing a jpeg file but had not installed the image_transport_plugins, so it couldn't handle the jpeg format. Once I installed the plugins it worked.

edit flag offensive delete link more

Comments

Not having some plugins around on the system should not result in SEGFAULTs, warnings / errors at most. Could you report this over at the image_transportissue tracker?

gvdhoorn gravatar imagegvdhoorn ( 2016-11-29 07:48:02 -0600 )edit

gvdhoorn: I am very new to ROS. There were too many possible things I could have been doing wrong in my environment to know if it was the lack of the proper plugins that was causing the segfault. So I consider this user error.

FAD0 gravatar imageFAD0 ( 2016-12-01 14:09:07 -0600 )edit

You may be new, but we should make sure that plugin discovering / loading code does not cause crashes when no plugins are present on a system. That's why I feel it's important to report this.

gvdhoorn gravatar imagegvdhoorn ( 2016-12-01 14:26:46 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-27 14:52:28 -0600

Seen: 260 times

Last updated: Nov 29 '16