cartographer ros使用指南-第一视角点云
cartographer ros使用指南-第一视角点云
说明:
- 介绍如何实时查看ply点云文件
安装point_cloud_viewer
- 下载源码point_cloud_viewer
mkdir ~/tools/
cd ~/tools/
git clone https://github.com/googlecartographer/point_cloud_viewer
- 安装rust
curl https://sh.rustup.rs -sSf | sh
echo "export PATH=$HOME/.cargo/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
- 安装NVM
# install [nvm](https://github.com/creationix/nvm)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# make sure it's done node version mannager
nvm ls && nvm ls-remote && nvm install v**
source ~/.bashrc
nvm install 8
- 编译point_cloud_viewer
cd ~/tools/point_cloud_viewer
cargo build --release
- 然后可以使用target/release/build_octree从PLY文件生成八叉树。
- 编译octree_web_viewer/client
#complie the web_viewer
cd octree_web_viewer/client
#install javascript dependencies ,node.js package mannager
nvm use 8
npm install
#build the client
npm run build
- 完成之后,会在web_viewer目录下得到target目录,其中app_bundle.js app_bundle.js.map
- 编译octree_web_viewer
cd ..
cargo build --release
- 使用../target/release/octree_web_viewer <octree目录> 提供八叉树
- 打开Chrome到http//localhost:5433,使用WASD导航并左键单击并拖动鼠标,鼠标滚轮可调节移动速度。
测试步骤:
下载官方backpack包
生成pbstream文件
roslaunch cartographer_ros offline_backpack_3d.launch bag_filenames:=${your_bag_file_path}
# 同时使用rosservice得到状态值,命名的时候在原来的bag文件的基础上添加后缀.pbstream
rosservice call /write_state ${your_bag_file_path.pbstream}
- 生产ply文件
roslaunch cartographer_ros assets_writer_backpack_3d.launch \
bag_filenames:=${your_bag_file_path} \
pose_graph_filename:=${your_bag_file_path.pbstream}
- 当程序运行结束之后,在~/.ros目录下,可以看到points.ply以及*.png
- 使用target/release/build_octree将得到的ply文件转成八叉树
target/release/build_octree ${you_ply_path} --output_directory ${out_dir}
- target/release/octree_web_viewer 以第一视角观察点云
target/release/octree_web_viewer ${out_dir}
在Chrome的浏览器中http://localhost:5433查看点云。
放一个自己制作的点云包出现的效果图:
参考:
- https://blog.csdn.net/Nksjc/article/details/77359952
- https://github.com/googlecartographer/point_cloud_viewer
- https://blog.csdn.net/ucan23/article/details/45667187
- https://blog.csdn.net/Cocoa_vip/article/details/74395285
- https://brew.sh/
- https://blog.csdn.net/hank12580/article/details/45949525
- https://skyao.io/learning-rust/installation/ubuntu.html
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号