cartographer turtlebot的编译、安装和运行

接着上一篇博客继续:https://blog.csdn.net/Jinxiaoyu886/article/details/90215630
如果还没有安装cartographer、ceres solver、cartographer和cartographer_ros。
可以把下面这个命令
$ wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
替换成:
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_turtlebot/master/cartographer_turtlebot.rosinstall
其余的不变 按照之前的走就行了。

运行例子:

Download the example bag.(下载例子) wget -P ~/Downloads
https://storage.googleapis.com/cartographer-public-data/bags/turtlebot/cartographer_turtlebot_demo.bag

Launch the 2D LIDAR demo.(2D雷达DEMO)
$ roslaunch cartographer_turtlebot demo_lidar_2d.launch
bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag

Launch the 2D depth camera demo.(2D深度相机DEMO)
$ roslaunch cartographer_turtlebot demo_depth_camera_2d.launch
bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag

Launch the 3D depth camera demo.(3D深度相机DEMO)
$ roslaunch cartographer_turtlebot demo_depth_camera_3d.launch bag_filename:=${HOME}/Downloads/cartographer_turtlebot_demo.bag

DEBUG

在运行例子时,如果出现

ERROR: cannot launch node of type [cartographer_ros/cartographer_node]: can't locate node [cartographer_node] in package [cartographer_ros]
ERROR: cannot launch node of type [cartographer_ros/cartographer_occupancy_grid_node]: can't locate node [cartographer_occupancy_grid_node] in package [cartographer_ros]
ERROR: cannot launch node of type [cartographer_turtlebot/cartographer_flat_world_imu_node]: can't locate node [cartographer_flat_world_imu_node] in package [cartographer_turtlebot]

类似与上述的错误。
第一、 检查你的包路径是否已经在ROS路径之中,通过vim ~/.bashrc 可以添加修改。
第二、 回到根目录,cd进你的工作空间,输入:
$ source devel/setup.bash
$ source install_isolated/setup.bash
这两句很重要,如果失败就关闭终端重新来一次,这两句话是要在每次运行前都要输入的。

对于第二个例子,2D深度相机DEMO,在运行时候会出现
ERROR: cannot launch node of type [depthimage_to_laserscan]: can't locate node [depthimage_to_laserscan] in package [depthimage_to_laserscan]
这个错误提示我们是缺少depthimage_to_laserscan包。

在终端输入
$ sudo apt-get install ros-kinetic-depthimage-to-laserscan
$ git clone https://github.com/ros-perception/depthimage_to_laserscan
然后在cd进包里,用cmake编译,然后make, sudo make install。 最后在bashrc里添加环境路径。
然后就可以运行了。
祝大家好运!

  • 3
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值