Cartographer installation ubuntu16.04kinetic-Ros

Reference URL but somewhat modified: https: //blog.csdn.net/u012700322/article/details/52766287

According to the first sentence of many URLs are $  sudo APT-GET Update , the result is always wrong. Later, a colleague recommended this web site, you can try.

0. Install all dependencies

sudo apt-get install -y google-mock libboost-all-dev  libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev  libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx  ros-kinetic-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev

1. First install ceres solver, select the version is 1.11, random path.

git clone https://github.com/hitcm/ceres-solver-1.11.0.git

cd ceres-solver-1.11.0/build

cmake ..

make –j

sudo make install

PS: According to the original method of bloggers, Ceres Solver may not be installed on. Specific installation method can refer to the official guide google
http://ceres-solver.org/building.html

2. Then the installation cartographer, random path.

①. git clone https://github.com/hitcm/cartographer.git

②. cd cartographer/build

③. cmake .. -G Ninja

④. ninja

⑤. ninja test

⑥. sudo ninja install

 3. Install cartographer_ros, Google official installation method is cumbersome, I made a little modification to the original files, the same core code, just modify the build file

src file is downloaded to the following folder below catkin_ws

git clone https://github.com/hitcm/cartographer_ros.git

Then to run catkin_make below to catkin_ws

4. data download test

2d data, about 500M, with the Thunder download

https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
And then run the file to launch.
 
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag

红色字体为修改的。
------------------------------------------------------------------------------------结束

走过的坑:1、<lua.hpp>报错:终端进入usr文件夹下 利用 /usr$ find . -name lua.hpp可以找到自己的lua文件的位置,假设在lua5.2下
/usr$ find . -name lua.hpp
./include/lua5.2/lua.hpp
需要<lua.hpp>可以修改<lua5.2/lua.hpp>可以解决问题

这个可以解决,但后续还会有很多问题。用上述流程并没有出现这个问题。

2、之前安装过所有总会报错重定义一些函数,利用sudo apt-get remove ros-kinetic-ca(tab键)找到一些ros需要删除的,程序就可以编辑过去
我删除了这两个sudo apt-get remove ros-kinetic-cartographer-ros-msgs
sudo apt-get remove ros-kinetic-cartographer

3、cmake 版本改成release版本

Catkin_make -DCMAKE_BUILD_TYPE = Release the command line

or in the src directory catkin_ws the sudo gedit CMakeLists.txt

add set (CMAKE_BUILD_TYPE "Release")

and then the error will not catkin_make


 

Guess you like

Origin www.cnblogs.com/rjjhyj/p/11457429.html