Software Development Project (WS2013/2014) - PCL Group (Pointcloud library)
About this repository : This repository contains code related to PCL usage, the main idea behind this code is to agentify the components of the PCL library and at the same time construct and develop a useful pointcloud program.
It contains both ros independant and ros dependant code, using ROS hydro and PCL 1.7 standalone version.
Documentation for installation avilable at:
http://www.openni.org/
http://pointclouds.org/downloads/linux.html
This steps were tested on kubuntu 12.10 and also there is knowledge about they work on ubuntu 12.04 LTS. Other Linux distributions might try this code as well but there is no available tests.
-
install openni drivers (for kinect)
Since pcl 1.7 openni drivers come with PCL library so you don't need to install them
-
install pcl 1.7
NOTE: If you install ros hydro by using full desktop installation (sudo apt-get install ros-hydro-desktop-full) then it automatically installs standalone pcl version 1.7 and the following steps then can be omitted, if not then do:
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all
-
Install cmake
sudo apt-get install cmake
-
Install gcc (c gnu compiler)
sudo apt-get install gcc
-
Install essential packages (g++ and others)
sudo apt-get install build-essential
-
Install and configure github
Create github account:
https://github.com/
install git:
sudo apt-get install git
configure git, (start from "setup git" section)
https://help.github.com/articles/set-up-git
setup ssh keys:
https://help.github.com/articles/generating-ssh-keys
-
Install ROS hydro
http://wiki.ros.org/hydro/Installation/Ubuntu
-
Configure bashrc and create proper directories to clone the repository
make proper directories and compile
mkdir -p ~/ros_ws/sdp_pcl_ws/src
cd ~/ros_ws/sdp_pcl_ws/src
catkin_init_workspace
cd ..
catkin_make
edit bashrc
cd ~
gedit .bashrc
add the following lines at the bottom
#:::::::::ROS_PCL_BASHRC_CONFIGURATION
source /opt/ros/hydro/setup.bash
source ~/ros_ws/sdp_pcl_ws/devel/setup.bash
source your bashrc
source ~/.bashrc
-
clone the sdp_pcl repository
cd ~/ros_ws/sdp_pcl_ws/src git clone [email protected]:mas-group/sdp_ws2013_pcl.git
-
Compile
cd ~/ros_ws/sdp_pcl_ws catkin_make
You should be able to compile now with no errors.
done! you can now test your installation.
- try the kinect simple example
Connect a Microsoft kinnect to your computer.
Compile and run the example:
cd ~/ros_ws/sdp_pcl_ws/src/sdp_ws2013_pcl/independent_of_ros/examples/kinect_io
mkdir build && cd build
cmake ..
make
./openni_grabber
Now you should be able to see live pointclouds streaming from kinect.
- try some other ros_independant pcl examples.
You can do the same procedure in general for running all ros independant examples
a. go to the location of the example
cd ~/ros_ws/sdp_pcl_ws/src/sdp_ws2013_pcl/independent_of_ros/examples/
cd example_that_you_want_to_try
b. create build folder and change to that location
mkdir build && cd build
c. cmake
cmake ..
You should see something like this:
Build files have been written to: ~/ros_ws/sdp_pcl_ws/src...
d. make
make
You should now be able to compile without errors
e. run
Change to build location folder (from previous step) if not there already...
cd .../build
./executable_name
To know the executable_name you can type ./ and then "tab" you will see the suggestions.
Another thing you can do is to open CMakeLists.txt and look for the "add executable" line, it will tell you the executable name.
- run the main program : pcl_agent (ros dependant)
Connect the kinnect and launch the main project:
roslaunch pcl_agents pcl_agents.launch
By now all the nodes should launch and a gui should show up in the screen waiting for commands (reconfigure parameters).
Now we will see how to use the gui.
- Usage of the main program : pcl_agent
The project uses ROS and dynamic reconfigure, to use it you must create pipelines during runtime.
To create a pipeline you must specify subscribers, the publishers are fixed.
We have two available pointcloud input sources: read from file and read from depth camera (kinnect).
kinnect is publishing on the topic: /pcl_kinect/output_cloud
So for example to create a simple pipeline to visualize the kinnect we will just make the pcl_viewer to subscribe to that topic.
This can be done by clicking on the left side of the gui on "pcl_viewer", and then write inside "viewer sub" the following:
/pcl_kinect/output_cloud
Similarly if we want to downsample the cloud first before visualizing it, we can make the proper connections.
input :
-
pcd file reader : /pcl_file_reader/output_cloud
-
depth camera : /pcl_kinect/output_cloud
filters :
-
statistical outlier : /statisticaloutlierremoval_filter/output_cloud
-
downsampling : /donwsampling_filter/output_cloud
-
passtrough : /passtrough_filter/output_cloud
output :
- viewer : does not apply
- Launching many agents (nodes) of the same type
It is possible to launch several viewers or filters of the same kind, by doing that we can filter on 3 axis at the same time. For doing that some steps are needed:
a. launch the desired agent (node) using the following example command:
rosrun pcl_viewer pcl_viewer __name:=viewer2
b. relaunch dynamic reconfigure
If you have questions you can contact the developers with the subject [PCL_HELP] at:
Oscar Lima: [email protected]
Shehzad Ahmed: [email protected]
Iuri Andrade: [email protected]
Enjoy!
This project was part of a development of the university:
Hochschule Bonn Rhein Sieg
under the supervision of:
Prof. Dr. Eng. Gerard Kraetzschmar
Teacher Assistant: Ms.C. Frederik Hegger
for the subject: Software Development Project
Thanks.