TX1安装运行turtlebot3 cartographer 利用rplidar

http://emanual.robotis.com/docs/en/platform/turtlebot3/navigation/#navigation

 

$ sudo apt-get install ninja-build libceres-dev libprotobuf-dev protobuf-compiler libprotoc-dev
$ cd ~/catkin_ws/src
$ git clone https://github.com/googlecartographer/cartographer.git
$ git clone https://github.com/googlecartographer/cartographer_ros.git
$ cd ~/catkin_ws
$ src/cartographer/scripts/install_proto3.sh
$ rm -rf protobuf/
$ rosdep install --from-paths src --ignore-src -r -y --os=ubuntu:xenial
$ catkin_make_isolated --install --use-ninja

 

roslaunch turtlebot3_bringup turtlebot3_robot.launch

修改原始雷达为rplidar

roscd turtlebot3_bringup找到相应launch文件夹。

turtlebot3_robot.launch第八行,改为turtlebot3_rplidar.launch,改文件如下

export  TURTLEBOT3_MODEL=burger

roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

 修改~/catkin_ws/src/turtlebot3/turtlebot3_slam/config/turtlebot3_lds_2d.lua配置文件第22行,跟踪坐标系imu_link改为base_link

然后运行

$ source ~/catkin_ws/install_isolated/setup.bash
$ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer

rviz -d `rospack find turtlebot3_slam`/rviz/turtlebot3_cartographer.rviz

rviz -d `rospack find turtlebot3_navigation`/rviz/turtlebot3_navigation.rviz

查看地图

保存地图

$ rosrun map_server map_saver -f ~/map

 导航

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

 

 

 

你可能感兴趣的:(ros学习,Slam)