Rplidar A2与turtlebot进行amcl导航教程
我在网上搜寻了很久看到了一些别的小车的导航教程但是turtlebot的却很少,仅有的几个尝试了几个还是发生了很多错误,所以我决定写了一篇这种文章
帮助大家了解如何去操作
1.https://github.com/ncnynl/turtlebot_apps网址下载该包,因为该包中我们需要的文件
2./home/wly/catkin_ws/src/turtlebot_apps/turtlebot_navigation/launch/amcl_demo.launch文件进行修改
我的代码如下:
3./home/wly/catkin_ws/src/turtlebot_apps/turtlebot_navigation/launch/includes/amcl中加入rplidar_amcl.launch.xml文件
具体代码如下:
4./home/wly/catkin_ws/src/turtlebot_apps/turtlebot_navigation/launch/includes下添加rplidar_move_base.launch.xml文件
具体代码如下:
5./home/wly/catkin_ws/src/turtlebot_apps/turtlebot_navigation/param下添加rplidar_costmap_params.yaml文件
具体代码如下:#A dummy file loaded when no custom param file is given
6./home/wly/catkin_ws/src/turtlebot_apps/turtlebot_navigation/param下添加rplidar_costmap_params.yaml.bk文件
具体代码如下:
max_obstacle_height: 2.0 # assume something like an arm is mounted on top of the robot
# Obstacle Cost Shaping (http://wiki.ros.org/costmap_2d/hydro/inflation)
robot_radius: 0.18 # distance a circular robot should be clear of the obstacle (kobuki: 0.18)
# footprint: [[x0, y0], [x1, y1], ... [xn, yn]] # if the robot is not circular
#map_type: voxel
obstacle_layer:
enabled: true
max_obstacle_height: 2.0
min_obstacle_height: 0.0
#origin_z: 0.0
#z_resolution: 0.2
#z_voxels: 2
#unknown_threshold: 15
#mark_threshold: 0
combination_method: 1
track_unknown_space: true #true needed for disabling global path planning through unknown space
obstacle_range: 2.0
raytrace_range: 5.0
#origin_z: 0.0
#z_resolution: 0.2
#z_voxels: 2
publish_voxel_map: false
observation_sources: scan
scan:
data_type: LaserScan
topic: "/scan"
marking: true
clearing: true
expected_update_rate: 0
#cost_scaling_factor and inflation_radius were now moved to the inflation_layer ns
inflation_layer:
enabled: true
cost_scaling_factor: 10.0 # exponential rate at which the obstacle cost drops off (default: 10)
inflation_radius: 0.25 # max. distance from an obstacle at which costs are incurred for planning paths.
static_layer:
enabled: true
map_topic: "/map"
7./home/wly/catkin_ws/src/turtlebot_apps/turtlebot_navigation/param添加config文件包
此处文件包从可以从第一步下的文件中找到的.
我这里提到的文件都可以在第一步下载的文件包里找到,如果有具体错误,可以根据输出错误查看是否缺少什么文件,添加进去即可
如果还有具体问题可以加我QQ私聊
QQ:1599015354