Ask Your Question

illegal instruction (object_recognition)

asked 2012-06-20 13:38:19 -0500

cgomez gravatar image

updated 2014-01-28 17:12:45 -0500

ngrennan gravatar image

Hello. I'm fairly new to ROS and I'm starting by trying to play with the object recognition packages in electric. I can run:

$rosrun object_recognition_core -o my_textured_plane

with no problems. It makes five .yaml files in a directory called my_textured_plane. Note: it does not create an image named "train.png" in that same directory. It saves the image in the directory above as "image_0000.png". When I run :

$rosrun object_recognition_core --track_directory my_textured_plane

I get an illegal instruction error. More details below - I did gdb python and ran the file:

Starting program: /usr/bin/python /opt/ros/electric/stacks/object_recognition/object_recognition_core/bin/
[Thread debugging using libthread_db enabled]
Registration? 1
Sync? 0
[New Thread 0x7fffe3f9d700 (LWP 448)]
[Thread 0x7fffe3f9d700 (LWP 448) exited]
[New Thread 0x7fffe3f9d700 (LWP 450)]
[New Thread 0x7fffe379c700 (LWP 452)]
[New Thread 0x7fffe0ea5700 (LWP 454)]
[New Thread 0x7fffdf024700 (LWP 455)]
[New Thread 0x7fffde823700 (LWP 456)]
[New Thread 0x7fffde022700 (LWP 457)]
1. device on bus: 1 @ 18 with serial number: B00363276005047B  Microsoft : Xbox NUI Camera
Time diff max: 33.5333
Registered:on Supported: 1
Setting registration on
Setting sync off
Reading : ./T.yaml
Reading : ./R.yaml
Reading : ./descriptors.yaml
Reading : ./points3d.yaml
Reading : ./points.yaml
read image:./train.png
width:0 height:0 channels:1

Program received signal SIGILL, Illegal instruction.

0x00007fffe6904449 in operator() (

    b=0x2e1af40 "\001\355\250\036\233\324e\367\377\\\224\276\001\237\246\250\201\320RDζP\372tY\250|\032\n\303A\367\354~\346W\275}\016\244M\377\277\377\277\063\314\370\376\377f?ϻ\005v\233\246]\366\343\321\313=\223{M\313\300\350\023\314\354o\321\372\357\264y\376\373\347K\\\357XƟa\242\352\207\336wUi=\270\t\371\275i\365y\314\321\371q;2\221\341ʗ\352~\266\333\357\225I\372\376\001\222\231bH\231\371\017MӜ\302y\214HL9\371\004\006\305\314وL\261\f\353\233\351\334\353\071\020\241\310Hk\224\225\370\223\211\342p\242\063\315e\270T\002\305\310وJ\261\204\351\317\340y\353,2\251\336\371\227=\271\025\350\272\377"..., 

    a=0x34e6480 "8\310\324\065$B\362\236#1\373\344료\002\036%\374\367\023\305\004\060\213\247\305\021\254\325,\316\334$G\300\313\335G\342΅71T\025\352=\234uC9y_/Kx:\251\306\327cR1\302\060ȹ\316?\035\346>\227ި5E \217E\364C0\254\035\215{\370lX@\001\"\305\373\326\016\336\034ԋ93\361\252)\225\361;\177]q\216\277\346\273\300o\rK\232:\377oy\375\377\036\315O?\266\273\032\272Û-W\365\273o}q\r\257\022\331\324U\251˛\206\377\377qs\375\210\321\332\367-a\366\217*\201Sb\217Ǎ\006\036wp\037\223\231\250\364\037ue", this=<optimized out>, size=<optimized out>)

    at /tmp/buildd/ros-electric-object-recognition-0.4.8/debian/ros-electric-object-recognition/opt/ros/electric/stacks/object_recognition/object_recognition_core/build/source/ecto_opencv/include/opencv_candidate/hamming.h:32 ...
edit retag flag offensive close merge delete


Can you try removing any special compile flags before compiling opencv? What kind of system do you use?

dornhege gravatar image dornhege  ( 2012-06-25 06:00:21 -0500 )edit

I'm on Ubuntu 11.10 - I used CMake 2.8.5. I just used whatever was already set after running cmake-gui. Which would be the special compile flags? (I followed instructions here:, as far as the optional parameters).

cgomez gravatar image cgomez  ( 2012-06-25 08:42:11 -0500 )edit

I was more thinking about the system hardware and architecture. If it is a "standard machine" it should work. I've never had to remove compile options, but things like SSE instructions might be good candidates.

dornhege gravatar image dornhege  ( 2012-06-25 23:57:55 -0500 )edit

How about this? 3.0.0-21-generic #35-Ubuntu SMP Fri May 25 17:57:41 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux; and as far as a processor Intel Core 2 CPU 6700.

cgomez gravatar image cgomez  ( 2012-06-26 11:54:47 -0500 )edit

Also I tried this way: and after getting through the errors in rosmake, I got the same response. I could run the orb_template, but when I ran the orb_track, I get an illegal instruction.

cgomez gravatar image cgomez  ( 2012-06-26 11:59:56 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2012-06-21 04:45:50 -0500

The opencv library is compiled for recent cpus. I had the same error and solved it by compiling OpenCV myself (with standard compiler flags).

edit flag offensive delete link more

answered 2012-06-21 01:19:43 -0500

dornhege gravatar image

Illegal instruction means that the code compiled uses some instruction that is not available on your system. Did you compile the code yourself? Maybe you need to remove some optimization compile flags that are not available on your target platform.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2012-06-20 13:38:19 -0500

Seen: 502 times

Last updated: Jun 25 '12