Eigen/Core on ROS hydro
I'm trying to follow this tutorial using ROS hydro medusa:
/laser_pipeline/Tutorials/IntroductionToWorkingWithLaserScannerData
The code won't compile saying that:
/opt/ros/hydro/include/laser_geometry/laser_geometry.h:46:22: fatal error: Eigen/Core: No such file or directory
I could only find a guide for a migration to ROS fuerte, but those instructions didn't work for me. Does anybody know how to fix this?
EDIT to add details: I created a new package with dependences on roscpp, rospy (probably useless) and std_msgs. I'm using ROS hydro medusa. I then created a cpp source containing this code:
#include "ros/ros.h"
#include "tf/transform_listener.h"
#include "sensor_msgs/PointCloud.h"
#include "tf/message_filter.h"
#include "message_filters/subscriber.h"
#include "laser_geometry/laser_geometry.h"
class LaserScanToPointCloud{
public:
ros::NodeHandle n_;
laser_geometry::LaserProjection projector_;
tf::TransformListener listener_;
message_filters::Subscriber<sensor_msgs::LaserScan> laser_sub_;
tf::MessageFilter<sensor_msgs::LaserScan> laser_notifier_;
ros::Publisher scan_pub_;
LaserScanToPointCloud(ros::NodeHandle n) :
n_(n),
laser_sub_(n_, "base_scan", 10),
laser_notifier_(laser_sub_,listener_, "base_link", 10)
{
laser_notifier_.registerCallback(
boost::bind(&LaserScanToPointCloud::scanCallback, this, _1));
laser_notifier_.setTolerance(ros::Duration(0.01));
scan_pub_ = n_.advertise<sensor_msgs::PointCloud>("/my_cloud",1);
}
void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in)
{
sensor_msgs::PointCloud cloud;
try
{
projector_.transformLaserScanToPointCloud(
"base_link",*scan_in, cloud,listener_);
}
catch (tf::TransformException& e)
{
std::cout << e.what();
return;
}
// Do something with cloud.
scan_pub_.publish(cloud);
}
};
int main(int argc, char** argv)
{
ros::init(argc, argv, "my_scan_to_cloud");
ros::NodeHandle n;
LaserScanToPointCloud lstopc(n);
ros::spin();
return 0;
}
At this point, I added these two lines at the end of CMakeLists.txt as I always did with sources:
add_executable(laser_scan_to_point_cloud src/laser_scan_to_point_cloud.cpp)
target_link_libraries(laser_scan_to_point_cloud ${catkin_LIBRARIES})
However, I'm getting the error that I told you when I try to compile with catkin_make. I tried to use rosdep, but it says that all the dependencies have been correctly installed. I also tried with an offline roswtf, but it doesn't find anything. Here are the versions:
rosversion -d: hydro
rosversion roscpp: 1.10.2
rosversion laser_geometry: 1.5.15
rosversion std_msgs: 0.5.8
Please let me know if you need other information!
Please provide more context as to how to reproduce your problem. Those should be system libraries installed on your computer as a dependency of the package where the file is erroring. It could be something like you're overriding the include path.
Thanks for your help. I added all the details that came to my mind. If you need other please let me know. As far as I know, the problem is that I'm missing the "eigen" package, but the point is that that package isn't available since ROS fuerte, since you can find migration instructions TO fuerte