For the C13 room preset:
Do not forget about sourcing (ros and workspace!)
Here you have some guides to the first lab session. Please note that all the necessary material for these practical sessions is stored in the catkin_ws folder. If not, you can also download the source here. You can inspect this from the file manager (double click on the desktop icon) or using the terminal(black icon on the launch pane at left-hand side) and starting mc(midnight commander) from the command line
directory view: command line (in mc) and GUI view (nautilus)
I/O and basic visualization
In this part you will learn about basic 3D data visualization. In order to to do so, please try to follow the next steps, first downloading this and extracting to the Desktop:
Navigate to the ~/Desktop/training_school_2015/data/cog/2009 directory using the mc. The open with a text viewer the 3D data file filtered_20cm.pcd. You should see:
How many points are in this file? What other fields can you recognize? You can exit from this view pressing Esc. Next, can you make up a point cloud from the xyzdata.xyz file in the /data/cog/2009 directory?
2. In the next step you should visualize the content of this file as a spatial point cloud. To do so, please run pcl_viewer filtered_20cm.pcd in the command line (alternatively, you can hide the mc panes by pressing Ctr-O). You will see a window like:
3. Try to move around (left click, scroll), press in turns 1,2,3,4 from the keyboard! If you need a picture of your current view, you can also press j! You can close this window either by the X sign in the left upper corner, or by pressing Ctr-C in the command line. For advanced command line options you can run pcl_viewer –help. Can you display the coordinate axis?
4. Should you need this PCD format in another one, compatible with major software tool? Please try yo see your options by entering pcl_pcd2ply or pcl_pcd2obj! Make sure that you use at least one of the above mentioned commands for a conversion, as you will need this in the next steps!
Basics of filtering and segmentation
In this part you can play around with different filters and segmentation options, using a 3D data processing pipeline. A short overview of this pipeline is here
As you can see in this Figure, the output of one module is connected as input to another one, i.e. the voxel filter is linked to the passthrough filter which is providing the output for the plane segmentation. Thus we will have to analyze each step of this chain. To do so, please type in the terminal the for the VM:
enter in the ros_demo/src/cfg directory and execute chmod +x *
build the workspace with catkin_make (in the catkin_ws folder)
roslaunch pcl_tutorial tutorial.launch
For the C13 config use the following:
cd catkin_ws
source /opt/ros/noetic/setup.bash
catkin_make
source ./devel/setup.bash
roslaunch pcl_tutorial tutorial.launch
You will see two windows similar to:
The first one contains the display of the 3D data as well as in the left part the different visualization options for the different filters (the thick boxes and the drop down lists). The second image lets you dynamically configure the parameters of these filters, i.e. passhthrough, plane segmentation and voxel filter. In order to understand the effect of these filters please try out the following steps:
Check the box for the voxel filter, and then play around with the values of the filter parameter (i.e. in the dynamic reconfigure window)
Check the box of the passthrough filter (you might want to disable the output of the rest at this point), and see what happens if you modify the minimum and maximum values around 0.5.
Enable/disable the plane/nonplane options, and see the effect of the change in the plane segmentation parameters.
Finally, display the fitted plane and normal to this plane with the last two options!
You should stop this computationally intensive processing chain in the terminal by pressing Ctr-C!
This session is based on the Lab session 1. Further more, this is divided into two separate sessions: one focusing on hands-on-registration and comparison of heterogeneous 3D data using CloudCompare, while the other part is more about software engineering using PCL. Based on your experience/interest, you can choose from these two options.
This tutorial shows basic demos from the PCL from different sources, mainly from their documentation. Please try to follow the steps indicated bellow, and make sure to check the relevant code sections. To do so, please navigate to the pcl_demo folder, and inspect its content.
! Remove openni_grabber and sample_consensus from CMakeLists.txt !
cd pcl_demo
mkdir build
cd build
cmake ..
make
I/O demos:
write a pcd file containing randomly generated points. What is the signature of the point cloud saving function? Can you save it as ASCII/Binary too?
Run from the build directory the ./write_pcd command.
test your file using:
pcl_viewer test_pcd.pcd
read in that generated pcd file
./read_pcd Is there a way to open ply or obj format too?
3D Normals
compute point normals on a point cloud and use built-in visualizer
./compute_normals
Can you change the support for which the normals are computed? Please make sure that you compile the modified code, by issuing make in the build directory!
Filtering
run one of 3 different filters on a point cloud
./filtering 0 (pass through filter)
./filtering 1 (downsample to a voxel grid)
./filtering 2 (perform statistical outlier removal)
visualize the output side-by-side with the original
pcl_viewer -multiview 1 ../data/table_scene_lms400.pcd table_scene_lms400_filtered.pcd
press ‘r’ to zero the viewpoint, and ‘l’ to list the color handlers. How much change is in the filesize of the original/filtered clouds?
Keypoints:
find SIFT keypoints in a point cloud and visualize
./keypoints ../data/robot1.pcd keypoints
Can you change the parameters of the algorithm in code? Try to recompile/run the modified code.
Features:
Compute PFH features on SIFT keypoints for two point clouds and then compute their correspondences
./keypoints ../data/robot correspondences
Can you modify the correspondence filtering part?
Sample Consensus:
generate some points that fit a planar model as well as a bunch of outliers
./sample_consensus
generate points as before, but use sample consensus to find inliers to a planar model
./sample_consensus -f
Try to modify the threshold of the plane segmentation, and watch the result!
Segmentation:
perform iterative plane segmentation on real point cloud data
./plane_segmentation
Visualize the output side-by-side with the original
pcl_viewer -multiview 1 ../data/table_scene_lms400.pcd table_scene_lms400_first_plane.pcd table_scene_lms400_second_plane.pcd
perform euclidean cluster extraction after removing the dominant planes in the scene
./euclidean_cluster_extraction
Visualize the output with all clusters in the same viewport
pcl_viewer cloud_cluster_0.pcd cloud_cluster_1.pcd cloud_cluster_2.pcd cloud_cluster_3.pcd cloud_cluster_4.pcd
Registration:
perform iterative closest point to align two point clouds
./icp ../data/robot1.pcd ../data/robot2.pcd
visualize aligned and combined point cloud beside originals
pcl_viewer -multiview 1 ../data/robot1.pcd ../data/robot2.pcd icp_aligned.pcd
attempt to fit several point cloud templates to the target point cloud, output the best match
./template_matching ../data/object_templates.txt ../data/person.pcd
visualize the matched and aligned template against the target PC
pc_viewer ../data/person.pcd template_aligned.pcd
you may need to press ’1′ several times to get a good color scheme for the two point clouds to be visible
These demos are meant for demo purposes. Should you need advanced features, you can find a complete documentation of the available tool in the PCL’s website.
Appendix:
For the VM Install the followings:
sudo rm /var/cache/apt/archives/lock
sudo apt-get install ros-melodic-pcl-ros
sudo apt-get install pcl-tools