参考:ROS机器人高效编程第六章导航功能包进阶
www.guyuehome.com/281
amcl代价地图。机器人导航将使用两种导航算法在地图上移动=全局导航和局部导航
https://www.ncnynl.com/archives/201609/857.html
sudo apt-get install ros-indigo-navigation
全局导航用于建立到地图上最终目标或一个远距离的路径。
局部导航用于建立到近距离目标和为了临时躲避障碍物的路径。
代价地图的参数用于配置算法计算行为。它们也有最基本的通用参数,这些参数会保存在共享的文件中。
可以在三个最基本的配置文件中设定不同的参数。这三个文件如下:
costmap_common_params.yaml
global_costmap_params.yaml
local_costmap_params.yaml
程序代码
base_local_planner_params.yaml
TrajectoryPlannerROS:
max_vel_x: 0.2
min_vel_x: 0.05
max_rotational_vel: 0.15
min_in_place_rotational_vel: 0.01
min_in_place_vel_theta: 0.01
max_vel_theta: 0.15
min_vel_theta: -0.15
acc_lim_th: 3.2
acc_lim_x: 2.5
acc_lim_y: 2.5
holonomic_robot: false
costmap_common_params.yaml
obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[-0.2,-0.2],[-0.2,0.2], [0.2, 0.2], [0.2,-0.2]]
#robot_radius: ir_of_robot
inflation_radius: 0.5
cost_scaling_factor: 10.0
observation_sources: scan
scan: {sensor_frame: base_link, observation_persistence: 0.0, max_obstacle_height: 0.4, min_obstacle_height: 0.0, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
global_costmap_params.yaml
global_costmap:
global_frame: /map
robot_base_frame: /base_footprint
update_frequency: 1.0
static_map: true
local_costmap_params.yaml
local_costmap:
global_frame: /map
robot_base_frame: /base_footprint
update_frequency: 5.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width: 5.0
height: 5.0
resolution: 0.02
tranform_tolerance: 0.5
planner_frequency: 1.0
planner_patiente: 5.0
#plugins:
# {name: obstacles, type: "costmal_2d::ObstacleLayer",
# name: inflation, type: "costmal_2d::InflationLayer"}
movebase.launch
<launch>
<!-- Run the map server -->
<node name="map_server" pkg="map_server" type="map_server" args="$(find navigation_test)/maps/map.yaml" output="screen"/>
<include file="$(find amcl)/examples/amcl_diff.launch" >
</include>
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<param name="controller_frequency" value="10.0"/>
<param name="controller_patiente" value="15.0"/>
<rosparam file="$(find navigation_test)/launch/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find navigation_test)/launch/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find navigation_test)/launch/local_costmap_params.yaml" command="load" />
<rosparam file="$(find navigation_test)/launch/global_costmap_params.yaml" command="load" />
<rosparam file="$(find navigation_test)/launch/base_local_planner_params.yaml" command="load" />
</node>
</launch>