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

How do I use pcl 1.7 with groovy?

asked 2013-05-17 07:10:12 -0500

kartoffelsalat gravatar image

Hello,

I want to use the RSD-Feature from PCL, which is in their current trunk-version (must be 1.7, am I right?) with ROS groovy. How can I compile the current pcl-trunk version for ros groovy? I found this github repo: github.com/ros-perception/perception_pcl but I don't know how to use it.

I made the same thing half a year ago for ROS electric with a svn checkout from the svn.pointclouds.org/ros/branches/electric/perception_pcl_unstable/ and after that a "rosmake pcl" but the whole svn.pointclouds.org/ros/* does not exist anymore.

Can anyone help me with this?

Thanks in advance, kartoffelsalat

edit retag flag offensive close merge delete

Comments

Sorry for not publishing complete links, but my karma isn't sufficient for this (why do I need karma for this action???)

kartoffelsalat gravatar image kartoffelsalat  ( 2013-05-17 07:11:22 -0500 )edit

The askbot system has a minimum required karma for posting links to prevent spamming.

William gravatar image William  ( 2013-05-17 08:13:39 -0500 )edit

6 Answers

Sort by » oldest newest most voted
9

answered 2013-05-17 07:53:00 -0500

William gravatar image

updated 2013-12-01 18:48:58 -0500

I did this a while back, here is what I did.

First you need to have the pcl_ros package in your workspace, or you need to install all of the debians which pcl_ros depends on. Since I am on a mac, I will fetch all of the dependencies and build them from source, so I will start like this:

Note: the /tmp directory is cleared at reboot, you may want to pick a different directory

cd /tmp
mkdir pcl_ws
cd pcl_ws
wstool init src <a href="http://packages.ros.org/web/rosinstall/generate/raw/groovy/pcl_ros">http://packages.ros.org/web/rosinstall/generate/raw/groovy/pcl_ros</a>

That downloaded pcl_ros and all of it's dependencies into the src folder, including pcl-1.6 which is what is released with groovy. Lets remove that version of pcl so that we can replace it later:

rm -rf src/pcl

If you only want to rebuild pcl and pcl_ros from source then run sudo apt-get install ros-groovy-pcl-ros in order to get all of the dependencies you need and then setup a workspace with pcl_ros in it:

# Only do this if you did the apt-get and did not run wstool above
cd /tmp
mkdir pcl_ws
cd pcl_ws
mkdir src
cd src
git clone <a href="https://github.com/ros-perception/perception_pcl.git">https://github.com/ros-perception/perception_pcl.git</a>

Either way, at this point you have the /tmp/pcl_ws/src folder now which contains at least pcl_ros. In the src folder you should clone the master of pcl (1.7):

cd /tmp/pcl_ws/src
git clone <a href="https://github.com/PointCloudLibrary/pcl.git">https://github.com/PointCloudLibrary/pcl.git</a>

Next you need to "ROS"-ify the pcl package. First you need the package.xml for pcl, we can get this from the released version (it hasn't changed from 1.6 to 1.7):

cd pcl
wget <a href="https://raw.github.com/ros-gbp/pcl-release/release/pcl/1.6.0/package.xml">https://raw.github.com/ros-gbp/pcl-release/release/pcl/1.6.0/package.xml</a>

Next you will want to edit the cmake/pcl_find_ros.cmake file to hard code the USE_ROS option to ON, here is a patch:

diff --git a/cmake/pcl_find_ros.cmake b/cmake/pcl_find_ros.cmake
index cf2e1e3..b426066 100644
--- a/cmake/pcl_find_ros.cmake
+++ b/cmake/pcl_find_ros.cmake
@@ -25,7 +25,7 @@ endmacro(get_ros_inc_path)
 set(ROS_DISTRO $ENV{ROS_DISTRO})

 if(ROS_DISTRO)
-    option(USE_ROS "Integrate with ROS rather than using native files" OFF)
+    option(USE_ROS "Integrate with ROS rather than using native files" ON)
     message(STATUS "Found ROS; USE_ROS is ${USE_ROS}; ROS-Distro: ${ROS_DISTRO}")
     if(USE_ROS)
         # Search for ROS

Now you can build your pcl workspace:

cd /tmp/pcl_ws
source /opt/ros/groovy/setup.bash  # Only if you are using debians
catkin_make_isolated --install  # prefix with `./src/catkin/bin/` if not using debians

Now assuming you didn't run into any build errors (I didn't get any on my Mac just now), then you should have a folder at /tmp/pcl_ws/install_isolated which ... (more)

edit flag offensive delete link more

Comments

I have successfully followed these instructions to get PCL trunk working with ROS Groovy.

mjcarroll gravatar image mjcarroll  ( 2013-05-20 10:19:19 -0500 )edit

Thanks for your quick reply, William! And shame on me for responding so late. I was successful, but it was not easy...Since PCL has also included an old version of libsvm, I ran into runtime error, I didn't expect at all.

kartoffelsalat gravatar image kartoffelsalat  ( 2013-05-30 03:46:09 -0500 )edit

Nevertheless: The way you wrote how to use the compiled pcl-1.7 with ROS didn't worked for me. So I just copied the whole content of .../install_isolated into my /opt/ros/groovy and now its working! Thanks again!

kartoffelsalat gravatar image kartoffelsalat  ( 2013-05-30 03:48:37 -0500 )edit

The instructions don't work for me. pcl builds without a problem, however when it comes to plc_ros I got many linking problems with libpcl_ros_segmentation.dylib.

Artem gravatar image Artem  ( 2013-06-15 05:43:44 -0500 )edit

Linking CXX shared library /Users/artemlenskiy/ros/catkin_install/devel_isolated/pcl_ros/lib/libpcl_ros_surface.dylib Undefined symbols for architecture x86_64: "pcl::MovingLeastSquares<pcl::PointXYZ, pcl::Normal>::performProcessing(pcl::PointCloud<pcl::Normal>&)", referenced from: vtable fo

Artem gravatar image Artem  ( 2013-06-16 06:42:13 -0500 )edit

Any ideas how to solve this? I should mention that if I comment out all the lines related to ros_surface in CMakeLists.txt, plc_ros builds successfully.

Artem gravatar image Artem  ( 2013-06-16 06:43:50 -0500 )edit

I don't know, I guess the trunk of PCL has a breaking change now. I would file a ticket on pcl_ros.

William gravatar image William  ( 2013-06-16 11:15:35 -0500 )edit

Hi I had an error here: [ 87%] Built target flann_s

CalledProcessError: Command '/tmp/pcl_ws/install_isolated/env.sh make -j8 -l8' returned non-zero exit status 2 <== Failed to process package 'flann': Command '/tmp/pcl_ws/install_isolated/env.sh make -j8 -l8' returned non-zero exit status 2

VicL gravatar image VicL  ( 2013-06-30 19:49:55 -0500 )edit
3

answered 2013-06-03 22:58:19 -0500

You can try git clone https://github.com/ros-perception/perception_pcl.git -b groovy-unstable-devel

edit flag offensive delete link more

Comments

This one works. Just had to modify .//pcl/doc/tutorials/content/walkthrough.rst by changing pcl-1.6 to pcl-1.7.

Artem gravatar image Artem  ( 2013-06-15 08:23:41 -0500 )edit

This no longer works. I get all kinds of linker errors when attempting to catkin_make_isolated this.

Neil Traft gravatar image Neil Traft  ( 2014-08-23 17:48:50 -0500 )edit

I've gotten a little farther on this: if you checkout revision 528328f, it refers to a version of PCL from before USE_ROS was removed. This one builds. However, I don't know how to build my own project with it. I've overlayed my (dry) workspace on top of my new pcl workspace, but I have errors...

Neil Traft gravatar image Neil Traft  ( 2014-08-23 20:40:13 -0500 )edit

Oops, nevermind! Those were my own errors. So yes, looks like this builds if you check out branch groovy-unstable-devel, revision 528328f, place it into the src/ folder of a new catkin workspace, and run catkin_make_isolated.

Neil Traft gravatar image Neil Traft  ( 2014-08-23 21:07:30 -0500 )edit
2

answered 2014-08-25 13:02:05 -0500

Neil Traft gravatar image

Here's a more recent answer. This works on my Ubuntu 12.04 as of 08/2014. This is a more detailed version of Michael Korn's answer.

$ mkdir -p pcl_ws/src
$ cd pcl_ws/src
$ git clone https://github.com/ros-perception/perception_pcl.git -b groovy-unstable-devel
$ cd perception_pcl
$ git checkout 528328f
$ cd ..
$ catkin_init_workspace
$ cd ..
$ catkin_make_isolated    # this step takes awhile

If you're trying to build a Catkin package:

(I've not tested this; I have a rosbuild workspace.)

$ source pcl_ws/devel_isolated/setup.bash
$ cd <your catkin groovy workspace>
$ catkin_make
$ source devel/setup.bash

If you're trying to build a Rosbuild package:

$ cd <your rosbuild groovy workspace>
$ vim .rosinstall

change this line:

- setup-file: {local-name: /opt/ros/groovy/setup.sh}

to this:

- setup-file: {local-name: path/to/pcl_ws/devel_isolated/setup.sh}

Now,

$ source setup.bash
$ rosmake <your package that needs PCL 1.7>

Voilà!

Now, if you look for pcl_ros, it should show you the custom-built version:

$ rospack find pcl_ros
/path/to/pcl_ws/src/perception_pcl/pcl_ros

(FYI, what you have done is built your own version of the pcl_ros package and PCL and overlayed them on top of your existing ROS Groovy installation. The version of PCL you built is not quite the 1.7.0 release, but it hopefully has whatever you want to use. For more on overlaying workspaces see here and here.)

edit flag offensive delete link more
1

answered 2013-05-17 14:03:30 -0500

tfoote gravatar image

updated 2013-05-17 14:07:57 -0500

There's also an unstable package pcl17 designed to enable using more recent pcl side by side with the released pcl. This may only work for fuerte though.

edit flag offensive delete link more

Comments

I think this might be for ROS Fuerte, @MichaelKorn can you comment?

William gravatar image William  ( 2013-05-17 14:10:26 -0500 )edit

Yes, it's for fuerte. I'm still using fuerte but I think I will have some time in the next two week and I will switch to groovy.

MichaelKorn gravatar image MichaelKorn  ( 2013-05-18 12:01:36 -0500 )edit
1

answered 2014-10-31 00:50:14 -0500

It has been tested successfully:)

$ mkdir -p pcl_ws/src $ cd pcl_ws/src $ git clone https://github.com/ros-perception/per... -b groovy-unstable-devel $ cd perception_pcl $ git checkout 528328f $ cd .. $ catkin_init_workspace $ cd .. $ catkin_make_isolated [above step takes awhile] $ cd $ vim .rosinstall change this line:

setup-file: {local-name: /opt/ros/groovy/setup.sh} to this (edit below path to point to your new workspace):
setup-file: {local-name: ../pcl_ws/devel_isolated/setup.sh} $ source setup.bash [if you echo $ROS_PACKAGE_PATH you should now see both workspaces]

$ rosmake file

edit flag offensive delete link more
1

answered 2013-06-08 04:23:19 -0500

Artem gravatar image

@William would be great to add your instructions to http://www.ros.org/wiki/groovy/Installation/OSX/Homebrew/Source

Another simpler solution that I followed is to to replace PCL that comes to with groovy with this one https://github.com/kalectro/pcl_groovy it builds on Mac OSX 10.8 with out a problem. Although it's PCL 1.6.1. Also I am not sure if PCL 1.6.1 has rsd features, probably not.

edit flag offensive delete link more

Comments

This might better go on a PCL related wiki page, perhaps in tutorial form, I would welcome help in improving the wiki documentation here.

William gravatar image William  ( 2013-06-10 06:41:03 -0500 )edit

Hello @Artem an @William, I did the " git clone https://github.com/kalectro/pcl_groovy " and it downloaded the package " pcl_groovy " but I dont know from now what should I do? there is no MAKE or something, I am new in ROS so I appreciate that you help me...

Mobile_robot gravatar image Mobile_robot  ( 2014-02-24 01:03:05 -0500 )edit

This is outdated info. Did you try just following this instructions http://wiki.ros.org/hydro/Installation/OSX/Homebrew/Source and choosing desktop-full Install?

Artem gravatar image Artem  ( 2014-02-24 02:43:05 -0500 )edit

Question Tools

5 followers

Stats

Asked: 2013-05-17 07:10:12 -0500

Seen: 4,527 times

Last updated: Oct 31 '14