ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to integrate PCL library into an existing project?

asked 2020-10-16 03:13:04 -0600

wiyogo gravatar image

updated 2020-10-16 03:14:48 -0600

Suppose I clone the hector_slam project in my catkin_ws:

  1. cd ~/catkin_ws/src/ && git clone https://github.com/tu-darmstadt-ros-pkg/hector_slam.
  2. cd .. && catkin_make

Those two steps work perfectly and I can launch the program.

Now, I need to extend the project and need the PCL library pcl_roshttps://wiki.ros.org/pcl_ros to create new point clouds objects (for clustering and filtering), since hector_slam doesn't depend on the pcl_ros. hector_slam utilized laser_geometry::LaserProjection::projectLaser() to create a sensor_msgs::PointCloud.

Adding #include <pcl_conversions/pcl_conversions.h> in a source file returns this error fatal error: pcl_conversions/pcl_conversions.h: No such file or directory #include <pcl_conversions/pcl_conversions.h>

After adding pcl_conversions in the find_package line of CMakeLists.txt, it returns a CMake error of no package found.

Shall I install the package using sudo apt install ros-melodic-pcl-conversions or sudo apt install pcl-rosor clone the this github repo https://github.com/ros-perception/per... in my catkin_ws/src?

It is a little bit confusing since the name in the Wiki https://wiki.ros.org/pcl_ros called pcl_ros but the repo name is perception_pcl.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-10-16 06:02:57 -0600

mgruhler gravatar image

I suggest do always install dependencies via apt, if there is not a very specific reason to build from source. Thus, install the dependency ros-melodic-pcl-conversions (as this is what you want to include) via apt (any dependencies of that will automatically be installed as well, another advantage vs. from source builds) and you should be good to go.

perception_pcl is only the repository, that contains the packages pcl_conversions, pcl_ros and the perception_pcl metapackage. You can install any package alone (besides dependencies, obviously) via apt. But if you want to build from source, you obviously need to fetch the full repo.

edit flag offensive delete link more

Comments

thanks @mgruhler

wiyogo gravatar image wiyogo  ( 2020-10-16 06:59:08 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-10-16 03:13:04 -0600

Seen: 1,002 times

Last updated: Oct 16 '20