ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Illegal Instruction when trying to run raspicam_node

asked 2014-11-28 13:54:07 -0500

that_guy318 gravatar image

updated 2014-11-28 13:54:55 -0500

As the title says, I'm trying to get fpasteau's raspicam_node working on my Raspberry Pi B+. After 3 days I finally got all of the dependencies resolved and catkin_make completes successfully.

Now when I go and try to run the raspicam_node using

 rosrun raspicam raspicam_node

with or without any parameters I just get a cryptic illegal instruction message:

 /home/pi/ros_catkin_ws/devel/bin/rosrun: line 4: Illegal instruction   
 "/home/pi/ros_catkin_ws/src/ros/rosbash/scripts/rosrun" "@"

I've looked all over the place but haven't found anything that is helpful. The most I've found is some people suggesting an issue with OpenCV. I had to compile and install OpenCV 2.4.9 from source on the Pi (took 15 hours) because it only had version 2.4.1 on it to begin with and catkin would get hung up while making it saying something along the lines of stuff not being defined in cv.h.

The other nodes that I wrote still run fine, just the raspicam_node won't work.

Any ideas?

Thanks -Matt

edit retag flag offensive close merge delete


may I ask which version of ROS you are using?

MKI gravatar image MKI  ( 2014-11-30 15:32:49 -0500 )edit

I'm running Indigo

that_guy318 gravatar image that_guy318  ( 2014-11-30 16:41:32 -0500 )edit

I just saw the link you have mentioned, It seems this package was built with Groovy in consideration (check file) . I could manage only bare bones version of Indigo. However, I'll give this package a try n let u know

MKI gravatar image MKI  ( 2014-11-30 17:10:09 -0500 )edit

I saw that too, but I'd be surprised if Indigo vs Groovy causes the illegal instruction.

that_guy318 gravatar image that_guy318  ( 2014-11-30 17:54:48 -0500 )edit

probably you are right, I am able to run the node on groovy (@90 fps too). have you built the userland source code? I ask because, the file does not mention anything on building this code. I guess that you might have missed this step and you are not able to find the right binaries.

MKI gravatar image MKI  ( 2014-12-01 07:08:35 -0500 )edit

I know I remember doing something with userland, but I don't know that I ever actually got it on the pi. I'll see about getting it setup.


that_guy318 gravatar image that_guy318  ( 2014-12-01 09:21:00 -0500 )edit

Well I don't think I have userland installed on the pi. I downloaded it and cross compiled it on my desktop like the github page said, but I haven't had any luck getting it on the pi yet.

that_guy318 gravatar image that_guy318  ( 2014-12-01 21:38:59 -0500 )edit

well, I don't know why you have to cross compile this code? you can just copy/download it into you Pi, and cd userland and ./buildme in your pi's terminal. it takes around 45 mins to build. and then following the you should be able to rosrun it, Also please mind its on groovy nt Indigo

MKI gravatar image MKI  ( 2014-12-02 06:00:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-30 21:55:19 -0500

ahendrix gravatar image

updated 2014-12-01 21:54:13 -0500

Illegal instruction errors usually indicate that you're either using binaries that aren't compiled for your CPU, or you aren't passing the right flags to compiler, so it's producing binaries that aren't compatible with your system.

It sounds like most of the software that you're running was compiled from source, so it's unlikely that it's built for the wrong architecture.

Since you're using Indigo, you should be able to run your node in a debugger easily:

rosrun --prefix 'gdb -ex run --args' raspicam raspicam_node

And that will at least tell you which library contains the illegal instructions. From there, you can track down the source of that library and try to figure out why it contains illegal instructions.

edit flag offensive delete link more


I'll definitely check that out. Probably won't be able to look at it until tomorrow though.

that_guy318 gravatar image that_guy318  ( 2014-11-30 22:31:21 -0500 )edit

So that doesn't really give anything useful when it runs. It just says no debugging symbols found.


that_guy318 gravatar image that_guy318  ( 2014-12-01 21:36:53 -0500 )edit

you have to type run at the gdb prompt to actually run your program.

ahendrix gravatar image ahendrix  ( 2014-12-01 21:49:56 -0500 )edit

I've updated my answer so that gdb runs your program automatically.

ahendrix gravatar image ahendrix  ( 2014-12-01 22:01:02 -0500 )edit

Ok, so it's /usr/arm-linux-gnueabihf/ causing the issue apparently

that_guy318 gravatar image that_guy318  ( 2014-12-01 22:15:09 -0500 )edit

yaml-cpp is usually a system dependency. Did you get your copy of it from somewhere other than apt?

ahendrix gravatar image ahendrix  ( 2014-12-01 22:26:17 -0500 )edit

I think I might have installed the version 0.5 from elsewhere because it wasn't happy about the version 0.3 already installed.

that_guy318 gravatar image that_guy318  ( 2014-12-01 22:43:39 -0500 )edit

I just uninstalled version 0.5 and reinstalled version 0.3 from the repos and now catkin won't compile fully. It's throwing all kinds of errors about things not being as expected in YAML.


that_guy318 gravatar image that_guy318  ( 2014-12-01 23:30:59 -0500 )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



Asked: 2014-11-28 13:54:07 -0500

Seen: 679 times

Last updated: Dec 01 '14