安裝過程:html
官方安裝教程:node
https://google-cartographer-ros.readthedocs.io/en/latest/index.htmlpython
# Install wstool and rosdep. sudo apt-get update sudo apt-get install -y python-wstool python-rosdep ninja-build # Create a new workspace in 'catkin_ws'. mkdir catkin_ws cd catkin_ws wstool init src # Merge the cartographer_ros.rosinstall file and fetch code for dependencies. wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall wstool update -t src //在這一步可能會顯示沒法下載cere-solver
/*
解決辦法手動下載cere-solver 而後放到src中
下載連接:https://ceres-solver.googlesource.com/ceres-solver.git/+/1.13.0
點擊頁面中的tgz能夠下載,下載後解壓到src中
# Install proto3. src/cartographer/scripts/install_proto3.sh # Install deb dependencies. # The command 'sudo rosdep init' will print an error if you have already # executed it since installing ROS. This error can be ignored. sudo rosdep init rosdep update rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y //這裏要修改ROS_DISTRO爲本身的ros版本如kinetic或者indigo # Build and install. catkin_make_isolated --install --use-ninja source install_isolated/setup.bash
下載安裝完畢之後,運行數據集。git
下載數據集。github
# Download the 2D backpack example bag. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag # Launch the 2D backpack demo. roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag # Download the 3D backpack example bag. wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/with_intensities/b3-2016-04-05-14-14-00.bag # Launch the 3D backpack demo. roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag
二維數據集運行api
結果以下所示:bash
rosbag內容:網絡
1 //輸入命令 2 rostopic list 3 //獲得數據包內容,而且用rostopic echo /topic_name 來查看各個topic的內容 4 /clicked_point 5 /clock 6 /horizontal_laser_3d//有數據, frame_id: "horizontal_vlp16_link" 7 /imu//有數據,frame_id: "imu_link" 8 /initialpose 9 /map 10 /map_updates 11 /move_base/DWAPlannerROS/global_plan 12 /move_base/global_costmap/costmap 13 /move_base/global_costmap/costmap_updates 14 /move_base/global_costmap/footprint 15 /move_base/local_costmap/costmap 16 /move_base/local_costmap/costmap_updates 17 /move_base_simple/goal 18 /particlecloud 19 /rosout 20 /rosout_agg 21 /scan 22 /tf 23 /tf_static 24 /velodyne_points//沒有數據 25 /vertical_laser_3d//有數據,frame_id: "vertical_vlp16_link"
這裏有vertical和horizaontal兩個laser_3d,如何理解,還有velodyne_points。fetch
利用rostopic查看各個數據信息:ui
發現
跑3維度數據集效果:
在跑3維數據集的時候,查看rostopic
1 rostopic list 2 /clicked_point 3 /clock 4 /constraint_list 5 /horizontal_laser_3d 6 /imu 7 /initialpose 8 /joint_states 9 /landmark_poses_list 10 /map 11 /move_base_simple/goal 12 /rosout 13 /rosout_agg 14 /scan_matched_points2 15 /submap_list 16 /tf 17 /tf_static 18 /trajectory_node_list 19 /vertical_laser_3d
用本身的傳感器跑cartographer
因爲傳感器的rostopic不一樣,咱們須要對cartographer訂閱的名稱進行修改,須要在launch文件中進行修改,可是修改後發現沒有任何做用,這是由於修改後須要從新按照上面的流程進行編譯安裝,這個多是由於在安裝的時候其實已經把launch文件安裝到系統中了,因此咱們調用的時候仍是調用系統中的launch文件
可是按照網絡上的修改版本後能夠直接修改,不用走以上的流程
修改好名稱接入之後出現問題
Queue(0,imu)exceeds maximum size.
Queue(0,points2_1) exceeds maximum size.