cartographer 使用记录

编译

Building & Installation
In order to build Cartographer ROS, we recommend using wstool and rosdep. For faster builds, we also recommend using Ninja.

sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
Create a new cartographer_ros workspace in ‘catkin_ws’.

mkdir catkin_ws
cd catkin_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src
执行这步时由于要下载ceres从goolge服务器下载,所以需要 设置一个代理,使用shadowsock 然后 在终端设置
#export http_proxy=http://proxyAddress:port

#export ALL_PROXY=socks5://127.0.0.1:1080

 

Install cartographer_ros’ dependencies (proto3 and deb packages). The command ‘sudo rosdep init’ will print an error if you have already executed it since installing ROS. This error can be ignored.

src/cartographer/scripts/install_proto3.sh
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
Build and install.

catkin_make_isolated --install --use-ninja


需要调试的参数说明

评估:
  开发SLAM中执行评估是一个十分关键的环节。为此,Cartographer提供内建工具,这些工具有助于调整参数和保证质量。
 


1 关闭Global Slam
   POSE_GRAPH.optimize_every_n_nodes = 0
2 调整submap的size
  TRAJECTORY_BUILDER_2D.submaps.num_range_data
  查看每一个submap,如果有两个以上的constraints,那么就可以认为当前的size良好。
3 调整CeresScanMatcher
  TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight
 
4 低延迟调整
   为了调整Global SLAM以降低 延迟,我们减少计算量,直到始终与传感器输入保持一致。达到这个目标就不再进一步减小了,从而达到一个比较好的质量。减小global SLAM延迟的方法有以下几个:
   1)减小optimize_every_n_nodes 值
   2)增加MAP_BUILDER.num_background_threads线程数,最大到cpu核心数
   3)减小global_sampling_ratio
   4)减小constraint_builder.sampling_ratio, 减小constraint_builder采样率
   5)增加constraint_builder.min_score 增加最低分数
   6) adaptive voxel filter相关参数,
       --减小 .min_num_points,.max_range
       --增加  .max_length
   7) 增加voxel_filter_size,submaps.resolution 减少submaps.num_range_data
   8)decrease search windows sizes, .linear_xy_search_window, .linear_z_search_window ,.angular_search_window
   9)increase global_constraint_search_after_n_seconds
   10)decrease max_num_iterations
   减小local SLAM延迟的方法有以下几个:
    1)increase voxel_filter_size
    2)increase submaps.resolution
    3)for the adaptive voxel filter(s), decrease .min_num_points, .max_range, increase .max_length
    4)decrease max_range (especially if data is noisy)
    5)decrease submaps.num_range_data

pointcloudView 编译记录

1.安装 Rust,这是一个编译工具包
  # curl https://sh.rustup.rs -sSf | sh
   这个需要下载一些包
安装过程
Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

  /home/shen/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /home/shen/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
320.1 KiB / 320.1 KiB (100 %) 182.6 KiB/s ETA:   0 s                
info: latest update on 2018-11-08, rust version 1.30.1 (1433507eb 2018-11-07)
info: downloading component 'rustc'
 76.4 MiB /  76.4 MiB (100 %) 360.7 KiB/s ETA:   0 s                
info: downloading component 'rust-std'
 52.8 MiB /  52.8 MiB (100 %) 438.4 KiB/s ETA:   0 s                
info: downloading component 'cargo'
  4.4 MiB /   4.4 MiB (100 %) 143.5 KiB/s ETA:   0 s                
info: downloading component 'rust-docs'
  8.9 MiB /   8.9 MiB (100 %) 284.4 KiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: default toolchain set to 'stable'

  stable installed - rustc 1.30.1 (1433507eb 2018-11-07)


Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done automatically.

To configure your current shell run source $HOME/.cargo/env

然后 执行# source $HOME/.cargo/env

2 按照ci/install_proto3.sh,安装protobuf3
3.Install the rust gRPC protobuf plugin:
#cargo install grpcio-compiler
and make sure it is in your $PATH. This has more dependencies, it requires cmake and go. On mac: brew install cmake go.
这里需要安装一下Go语言
#sudo apt-get install golang-go
export GOROOT=$HOME/go
export PATH=$GOROOT/bin:$PATHU

二、creating octrees
4.进入point_cloud_viewer
   #cargo build --release
   执行以下命令,产生一个octree out of ply文件
   #target/release/build_octree
   build_octree <input> --output_directory <output_directory> --resolution <resolution>


三 SDL client
1.安装SDL2 #sudo apt-get install libsdl2-dev
2 #cd sdl_viewer/
3 # cargo build --release
编译过程中会出错:
I fail to build SDL client at step 3: cargo build --release. I got the following error msg:

cargo build --release
Compiling point_viewer_grpc_proto_rust v0.1.0 (file:///home/sean/sean/cartographer_ws/point_cloud_viewer-master/point_viewer_grpc_proto_rust)
Compiling collision v0.18.0
error: failed to run custom build command for point_viewer_grpc_proto_rust v0.1.0 (file:///home/sean/sean/cartographer_ws/point_cloud_viewer-master/point_viewer_grpc_proto_rust)
process didn't exit successfully: /home/sean/sean/cartographer_ws/point_cloud_viewer-master/target/release/build/point_viewer_grpc_proto_rust-d13b2a85d9c9c3b2/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=point_viewer_proto_rust/src/proto.proto
--- stderr
thread 'main' panicked at 'called Option::unwrap() on a None value', libcore/option.rs:335:21
note: Run with RUST_BACKTRACE=1 for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed

Before building sdl client, I have already installed "rust gRPC protobuf plugin". Under "${HOME}/.cargo/bin", I do see grpc_rust_plugin. Also, PATH variable has "/home/sean/.cargo/bin" section. Can someone give help on my issue?
解决方法:
I think I figure out the resaon:
build.rs is looking for '.git' file as a sign of root dir. However, I download the repro so there is no git file.

while !path.join(".git").exists() {
path = path.parent().unwrap();
}

#cd point_cloud_viewer
#git init .
then recompile

4 Run with ../target/release/sdl_viewer <octree directory>


四 web Viewer编译
先编译 client
1.cd octree_web_viewer/client
2.安装 nvm  https://github.com/creationix/nvm
  1)install script
To install or update nvm, you can use the install script using cURL:

#curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
or Wget:

#wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

To build,

1.Change into the web viewer's client directory:
#cd octree_web_viewer/client.
2.Install npm. We strongly suggest using nvm. On Mac brew install nvm.
Install node version 8: #nvm install 8. Change to the web viewer's client directory:
# cd client
, then set node version to 8: #
#nvm use 8.
Install javascript dependencies: npm install.
Build the client:
#npm run build.
下面编译server
Then build the server:
#cargo build --release
 Serve up the octree using
#../target/release/octree_web_viewer <octree directory>
打开Chrome to http://localhost:5433,
使用W A S D按键 鼠标左键拖动. 鼠标滚轮改变移动速度.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值