Ask Your Question
0

No such file or directory [sensor_msgs/LaserScan.h]

asked 2012-02-06 23:32:26 -0500

jlo gravatar image

Hi there, guys, I have been writing some codes that made use of geometry_msgs lately. The way I included them in the previous algorithm was like this:

#include "geometry_msgs/Point.h"

And now I would like to use LaserScan.h, located in my system at

/opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include/sensor_msgs

using

#include "geometry_msgs/Point.h"

The thing is, when I try to compile what I get is this error, showing it can't find it:

  /home/alonsoj1/ros_workspace/prueba/src/talker.cpp:2:48: error: common_msgs/sensor_msgs/CameraInfo.h: No such file or directory

That's why I just link to the whole path like this to make it work:

#include "/opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include/sensor_msgs/LaserScan.h"

I wonder why this is necessary, since the file Point.h (the one I used before wasn't in geometry_msgs/ path directly, but in /opt/ros/electric/stacks/common_msgs/geometry_msgs/msg_gen/cpp/include/geometry_msgs). Is there a reason for this behaviour?

Thanks,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2012-02-07 00:46:21 -0500

DimitriProsser gravatar image

Check your package's manifest.xml. It must say the following:

<depend package="geometry_msgs" />
<depend package="sensor_msgs" />

This will allow CMake to locate the appropriate header files. The other thing to check is to make sure that geometry_msgs is properly located in your ROS_PACKAGE_PATH.

edit flag offensive delete link more

Comments

Awesome, exactly what was going on. I had forgotten about manifest.xml dependencies.
jlo gravatar imagejlo ( 2012-02-07 22:21:12 -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

Stats

Asked: 2012-02-06 23:32:26 -0500

Seen: 3,599 times

Last updated: Feb 07 '12