PCL学习心得范文

上传人:亦明 文档编号:141986051 上传时间:2020-08-15 格式:DOC 页数:10 大小:87.18KB
返回 下载 相关 举报
PCL学习心得范文_第1页
第1页 / 共10页
PCL学习心得范文_第2页
第2页 / 共10页
PCL学习心得范文_第3页
第3页 / 共10页
PCL学习心得范文_第4页
第4页 / 共10页
PCL学习心得范文_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《PCL学习心得范文》由会员分享,可在线阅读,更多相关《PCL学习心得范文(10页珍藏版)》请在金锄头文库上搜索。

1、PCL学习心得范文 1.Using PCL in your own projectThis tutorialexplains howto usePCLinyourownprojects.Project settingsLet ussay theproject isplaced under/PATH/TO/MY/GRAND/PROJECT thatcontains alonely cppfile namepcd_write.cpp(copy itfrom theWriting PointCloud datato PCDfiles tutorial).#include#include#includ

2、eint main(intargc,char*argv)pcl:PointCloudcloud;/Fill in the clouddata cloud.width=5;cloud.height=1;cloud.is_dense=false;cloud.points.resize(cloud.width*cloud.height);for(size_t i=0;i (0);In thesame folder,create afile namedCMakeLists.txt thatcontains:cmake_minimum_required(VERSION2.6FATAL_ERROR)pro

3、ject(MY_GRAND_PROJECT)find_package(PCL1.3REQUIREDPONENTSmonio)include_directories($PCL_INCLUDE_DIRS)link_directories($PCL_LIBRARY_DIRS)add_definitions($PCL_DEFINITIONS)add_executable(pcd_write_testpcd_write.cpp)target_link_libraries(pcd_write_test$PCL_MON_LIBRARIES$PCL_IO_LIBRARIES)The explanationcm

4、ake_minimum_required(VERSION2.6FATAL_ERROR)This ismandatory(强制的)for cmake,and sincewe aremaking verybasic projectwe dont needfeatures fromcmake2.8or higher.project(MY_GRAND_PROJECT)This linenames your project andsets someuseful cmakevariables suchas thoseto referto thesource directory(MY_GRAND_PROJE

5、CT_SOURCE_DIR)and thedirectory fromwhich youare invokingcmake(MY_GRAND_PROJECT_BINARY_DIR).find_package(PCL1.3REQUIREDPONENTSmonio)We arerequesting tofind the PCL packageat minimumversion1.3.We alsosays thatit isREQUIRED meaningthat cmakewill failgracefully ifit cant befound.As PCLis modular(模块化的)on

6、e canrequest:?only oneponent(成分):find_package(PCL1.3REQUIRED PONENTSio)?several:find_package(PCL1.3REQUIRED PONENTSio mon)?all existing:find_package(PCL1.3REQUIRED)include_directories($PCL_INCLUDE_DIRS)link_directories($PCL_LIBRARY_DIRS)add_definitions($PCL_DEFINITIONS)When PCLis found,several relat

7、edvariables areset:?PCL_FOUND:set to1if PCLis found,otherwise unset?PCL_INCLUDE_DIRS:set tothe pathsto PCLinstalled headersand thedependency headers?PCL_LIBRARIES:set tothe filenames of the builtand installedPCL libraries?PCL_LIBRARY_DIRS:set tothe pathsto wherePCL librariesand3rd partydependencies

8、reside?PCL_VERSION:the versionof thefound PCL?PCL_PONENTS:lists allavailable ponents?PCL_DEFINITIONS:lists theneeded preprocessordefinitions andpiler flagsTo letcmake knowabout externalheaders youinclude inyourproject,one needsto useinclude_directories()macro(宏).In ourcase PCL_INCLUDE_DIRS,contains

9、exactlywhat weneed,thus weask cmaketo searchthe pathsit containsfor aheader potentiallyincluded.add_executable(可执行)(pcd_write_testpcd_write.cpp)Here,we tellcmake thatwe aretrying tomake anexecutable filenamed pcd_write_test fromone singlesource filepcd_write.cpp.CMake willtake careofthesuffix(.exe o

10、nWindows platformand blankon UNIX)and thepermissions.target_link_libraries(pcd_write_test$PCL_MON_LIBRARIES$PCL_IO_LIBRARIES)The executablewe arebuilding makescall toPCL functions.So far,we haveonly includedthePCLheaders sothe pilersknows about the methodswe arecalling.We needalso tomake the linker

11、knowsaboutthelibraries weare linkingagainst.As saidbefore the,PCL foundlibraries arerefered tousing PCL_LIBRARIES variable,all thatremains isto triggerthelinkoperation whichwe docalling target_link_libraries()macro.PCLConfig.cmake usesa CMakespecial featurenamed EXPORTwhich allowsfor usingothersproj

12、ects targetsas ifyou builtthem yourself.When youare usingsuch targetsthey arecalled importedtargets andacts justlike anyothertarget.Add the following linesto yourCMakeLists.txt file:cmake_minimum_required(VERSION2.8FATAL_ERROR)project(pcd_write)find_package(PCL1.2REQUIRED)include_directories($PCL_IN

13、CLUDE_DIRS)link_directories($PCL_LIBRARY_DIRS)add_definitions($PCL_DEFINITIONS)add_executable(pcd_writepcd_write.cpp)target_link_libraries(pcd_write$PCL_LIBRARIES)ply典型的PLY文件结构头部顶点列表面片列表(其他元素列表)头部是一系列以回车结尾的文本行,用来描述文件的剩余部分。 头部包含一个对每个元素类型的描述,包括元素名(如“边”),这个元素在工程里有多少,以及一个与这个元素关联的不同属性的列表。 头部还说明这个文件是二进制的或

14、者是ASCII的。 头部后面的是一个每个元素类型的元素列表,按照在头部中描述的顺序出现。 下面是一个立方体的完整ASCII描述。 相同工程的二进制版本头部的唯一不同是用词“binary_little_endian”或者“binary_big_endian”替换词“ascii”。 大括号中的注释不是文件的一部分,它们是这个例子的注解。 文件中的注释一般在“ment”开始的关键词定义行里。 ply formatascii1.0ascii/二进制,格式版本数ment madeby anonymous注释关键词说明,像其他行一样ment thisfile isa cubeelement vertex8

15、定义“vertex”(顶点)元素,在文件中有8个property float32x顶点包含浮点坐标“x”property float32yy坐标同样是一个顶点属性property float32zz也是坐标element face6在文件里有6个“face”(面片)property listuint8int32vertex_index“vertex_indices”(顶点素引)是一列整数end_header划定头部结尾000顶点列表的开始00101101010010111111040123面片列表开始4765440451415624267343740这个例子说明头部的基本组成。 头部的每个部分

16、都是以一个关键词开头以回车结尾的ASCII串。 即使是头部的开始和结尾(“ply”和“end_header”)也是以这种形式。 因为字符“ply”是文件的魔法数字,必须是文件的头四个字符。 跟在文件头部开头之后的是关键词“format”和一个特定的ASCII或者二进制的格式,接下来是一个版本号。 再下面是多边形文件中每个元素的描述,在每个元素里还有多属性的说明。 一般元素以下面的格式描述elementpropertypropertyproperty.属性罗列在“element”(元素)行后面定义,既包含属性的数据类型也包含属性在每个元素中出现的次序。 一个属性可以有三种数据类型标量,字符串和列表。 属性可能具有的标量数据类型列表如下名称类型字节数-

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号