Cmake error during building a rospackage
Hello all
I am trying to learn how to use the ROS-PCL library with the Velodyne 64E lidar. I have stored my code in the same directory as that of the Velodyne_height_map project and I want to modify the existing CMakeList.txt file to incorporate my own code. My main goal is to find the distances of the obstacles by subscribing to the velodyne_obstacles topic.
This is the error I am getting when I am building the project.
> *** No rule to make target
> '/usr/lib/x86_64-linux-gnu/libpthread.so/opt/ros/kinetic/lib/libpcl_ros_filters.so',
> needed by
> '/home/aditya/catkin_ws/devel/lib/velodyne_height_map/myheight'.
> Stop.
This is the addition I have done to the CMakeLists.txt file by following few tutorials.
add_executable(myheight src/my_height_sub.cpp)
target_link_libraries(myheight ${catkin_LIBRARIES}${catkin_LIBRARIES}
${Boost_LIBRARIES}
${PCL_LIBRARIES})
This is the program I am trying to run.
#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <boost/foreach.hpp>
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
void callback(const sensor_msgs::PointCloud2ConstPtr&);
int main(int argc, char** argv)
{
ros::NodeHandle nh;
std::string topic = nh.resolveName("point_cloud");
uint32_t queue_size = 1;
// to create a subscriber, you can do this (as above):
ros::Subscriber sub = nh.subscribe<sensor_msgs::PointCloud2> ("velodyne_points", queue_size, callback);
}
I know I am missing some dependencies in the CMakelists, but cant seem to figure out what they are. Can someone help me out please? Many thanks in advance!
I'm no expert on this, but it seems that
pcl_ros_filter
(which is in your error message) cannot be used. Why this should be linked, however, I don't know. I don't see anything apparent relating to that.Thats what I am unable to understand, I have not used
pcl_ros_filter
still this is showing up. But I have still added${PCL_ROS_FILTER}
in the link libraries, but still I am facing the same error.Can you paste the entire CMakeList.txt(without the comments)?
pastebin
It is attached here