一.局部路径规划
DWA
DWAPlannerROS:
#旋转加速度的绝对值.
acc_lim_th: 1
#x方向的加速度绝对值.
acc_lim_x: 1
#y方向的加速度绝对值,该值只有全向移动的机器人才需配置.
acc_lim_y: 1
#x方向最大线速度绝对值,单位:米/秒
max_vel_x: 1
#x方向最小线速度绝对值,单位:米/秒。如果为负值表示可以后退.
min_vel_x: 1
#y方向最大线速度绝对值,单位:米/秒
max_vel_y: 1
#y方向最小线速度绝对值,单位:米/秒
min_vel_y: 1
#机器人最大平移速度的绝对值,单位为 m/s
max_vel_trans: 1
#机器人最小平移速度的绝对值,单位为 m/s
min_vel_trans: 1
#最大旋转速度的绝对值.
max_vel_theta: 1.0
#最小旋转速度的绝对值.
min_vel_theta: -1.0
#向前仿真轨迹的时间.
sim_time: 1.5
#步长,轨迹上采样点之间的距离,轨迹上点的密集程度.
sim_granularity: 0.1
#定义控制器与局部目标点的接近程度的权重.
goal_distance_bias: 30.0
#定义控制器与给定路径接近程度的权重.
path_distance_bias: 20.0
#定义控制器躲避障碍物的程度.
occdist_scale: 0.01
#距离机器人中心点的距离,以米为单位放置额外的得分点.
forward_point_distance: 0.5
#为防止碰撞,机器人必须提前停止的时间长度.
stop_time_buffer: 0.2
#启动机器人底盘的速度.
scaling_speed: 0.5
#最大缩放参数.
max_scaling_factor: 0.2
#机器人运动多远距离才会重置振荡标记
oscillation_reset_dist: 0.05
#x方向速度空间的采样点数.
vx_samples: 20
#y方向速度空间采样点数.
vy_samples: 0
#旋转方向的速度空间采样点数.
vtheta_samples: 10
#旋转停止速度
theta_stopped_vel: 0.01
#平移停止速度
trans_stopped_vel: 0.01
#到达目标点时,在xy平面内与目标点的距离误差.
xy_goal_tolerance: 0.2
#到达目标点时偏行角允许的误差,单位弧度.
yaw_goal_tolerance: 0.1
#设置为true,如果到达容错距离内,机器人就会原地旋转,即使转动是会跑出容错距离外.
latch_xy_goal_tolerance: false
TEB
TebLocalPlannerROS:
odom_topic: odom
# Trajectory
teb_autosize: True
#期望的轨迹时间分辨率
dt_ref: 0.3
#根据当前时间分辨率自动调整大小的滞后现象,通常约为。建议使用dt ref的10%
dt_hysteresis: 0.1
#最大样本数
max_samples: 500
#覆盖由全局规划器提供的局部子目标的方向
global_plan_overwrite_orientation: True
allow_init_with_backwards_motion: True
#指定考虑优化的全局计划子集的最大长度
max_global_plan_lookahead_dist: 10
#如果为正值,则通过点(via-points )从全局计划(路径跟踪模式)展开,该值确定参考路径的分辨率(沿着全局计划的每两个连续通过点之间的最小间隔,可以参考参数weight_viapoint来调整大小
global_plan_viapoint_sep: -1
global_plan_prune_distance: 1
exact_arc_length: False
#每个采样间隔的姿态可行性分析数,default:4
feasibility_check_no_poses: 2
#发布包含完整轨迹和动态障碍的列表的规划器反馈
publish_feedback: False
# Robot
max_vel_x: 0.4
max_vel_x_backwards: 0.2
max_vel_y: 0.0
max_vel_theta: 0.3 # the angular velocity is also bounded by min_turning_radius in case of a carlike robot (r = v / omega)
acc_lim_x: 0.5
acc_lim_theta: 0.5
# ********************** Carlike robot parameters ********************
#最小转弯半径
min_turning_radius: 0.5
wheelbase: 0.4
#是否允许原地转
cmd_angle_instead_rotvel: True
# ********************************************************************
footprint_model: # types: "point", "circular", "two_circles", "line", "polygon"
type: "line"
radius: 0.2 # for type "circular"
line_start: [0.0, 0.0] # for type "line"
line_end: [0.4, 0.0] # for type "line"
front_offset: 0.2 # for type "two_circles"
front_radius: 0.2 # for type "two_circles"
rear_offset: 0.2 # for type "two_circles"
rear_radius: 0.2 # for type "two_circles"
vertices: [ [0.25, -0.05], [0.18, -0.05], [0.18, -0.18], [-0.19, -0.18], [-0.25, 0], [-0.19, 0.18], [0.18, 0.18], [0.18, 0.05], [0.25, 0.05] ] # for type "polygon"
#目标位置的允许距离误差
xy_goal_tolerance: 0.2
#目标位置的允许角度误差
yaw_goal_tolerance: 0.1
#去除目标速度的约束
free_goal_vel: False
complete_global_plan: True
#与障碍的最小期望距离,注意,teb_local_planner本身不考虑膨胀半径
min_obstacle_dist: 0.5
#障碍物周围缓冲区(应大于min_obstacle_dist才能生效)
inflation_dist: 0.8
#应否考虑到局部costmap的障碍
include_costmap_obstacles: True
#考虑后面n米内的障碍物
costmap_obstacles_behind_robot_dist: 1.0
#为了保持距离,每个障碍物位置都与轨道上最近的位置相连
obstacle_poses_affected: 20
dynamic_obstacle_inflation_dist: 0.6
include_dynamic_obstacles: True
costmap_converter_plugin: ""
costmap_converter_spin_thread: True
costmap_converter_rate: 8
#在每个外循环迭代中调用的实际求解器迭代次数
no_inner_iterations: 5
#在每个外循环迭代中调用的实际求解器迭代次数
no_outer_iterations: 4
optimization_activate: True
optimization_verbose: False
#为硬约束近似的惩罚函数添加一个小的安全范围
penalty_epsilon: 0.1
obstacle_cost_exponent: 4
weight_max_vel_x: 2
weight_max_vel_theta: 1
weight_acc_lim_x: 1
weight_acc_lim_theta: 1
weight_kinematics_nh: 1000
weight_kinematics_forward_drive: 1
weight_kinematics_turning_radius: 1
weight_optimaltime: 1 # must be > 0
weight_shortest_path: 0
weight_obstacle: 100
weight_inflation: 0.2
weight_dynamic_obstacle: 10 # not in use yet
weight_dynamic_obstacle_inflation: 0.2
weight_viapoint: 1
weight_adapt_factor: 2
# Homotopy Class Planner
enable_homotopy_class_planning: True
enable_multithreading: True
max_number_classes: 4
selection_cost_hysteresis: 1.0
selection_prefer_initial_plan: 0.95
selection_obst_cost_scale: 1.0
selection_alternative_time_cost: False
roadmap_graph_no_samples: 15
roadmap_graph_area_width: 5
roadmap_graph_area_length_scale: 1.0
h_signature_prescaler: 0.5
h_signature_threshold: 0.1
obstacle_heading_threshold: 0.45
switching_blocking_period: 0.0
viapoints_all_candidates: True
delete_detours_backwards: True
max_ratio_detours_duration_best_duration: 3.0
visualize_hc_graph: False
visualize_with_time_as_z_axis_scale: False
# Recovery
shrink_horizon_backup: True
shrink_horizon_min_duration: 10
oscillation_recovery: True
oscillation_v_eps: 0.1
oscillation_omega_eps: 0.1
oscillation_recovery_min_duration: 10
oscillation_filter_duration: 10
二.全局路径规划
#三种全局路径规划
GlobalPlanner:
allow_unknown: false
default_tolerance: 0.3 #路径规划器目标点的公差范围
# visualize_potential: true #指定是否通过可视化PointCloud2计算的潜在区域
use_dijkstra: true #如果为ture,则使用dijkstra算法。 否则使用A *算法
use_quadratic: true #二次逼近
use_grid_path: false #如果为true,沿着栅格边界创建路径。 否则,使用梯度下降的方法。
# old_navfn_behavior: true #如果你想要global_planner准确反映navfn的行为,此项设置为true。
lethal_cost: 253
neutral_cost: 66
cost_factor: 0.5
publish_potential: True
NavfnROS:
allow_unknown: false
RRTstarPlannerROS:
search_radius: 2.0 #搜索附近的节点的搜索范围
goal_radius: 0.3 #认为搜索到目标点的范围
epsilon_min: 0.001 #节点之间的最小允许距离
epsilon_max: 0.1 #节点之间的最大允许距离
max_nodes_num: 2000000000.0 #节点数的最大值,最大迭代次数
plan_time_out: 0.1 #规划超时,默认10s
三.全局代价地图
global_costmap:
footprint: [[-0.305, -0.18], [-0.305, 0.18], [0.305, 0.18], [0.305, -0.18]]
footprint_padding: 0.01
transform_tolerance: 0.5
#用来决定全局地图信息更新的频率,单位是Hz
update_frequency: 10.0
publish_frequency: 10.0
#用来表示全局代价地图需要在哪个参考系下运行
global_frame: map
#用来表示代价地图参考的机器本体参考系
robot_base_frame: base_footprint
#用来设置分辨率
resolution: 0.10
#用来设置在机器人移动过程中是否需要滚动窗口,以保持机器人处于中心位置
rolling_window: true
#用来设置全局代价地图宽高,单位是米
width: 28.0
height: 13.0
track_unknown_space: false
plugins:
- {name: static, type: "costmap_2d::StaticLayer"}
- {name: sensor, type: "costmap_2d::ObstacleLayer"}
- {name: inflation, type: "costmap_2d::InflationLayer"}
static:
map_topic: /map
subscribe_to_updates: true
sensor:
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
inflation:
inflation_radius: 0.6
cost_scaling_factor: 2.0
四.局部代价地图
local_costmap:
footprint: [[-0.305, -0.18], [-0.305, 0.18], [0.305, 0.18], [0.305, -0.18]]
footprint_padding: 0.01
#发布tf变换的超时时间
transform_tolerance: 0.5
#地图更新频率
update_frequency: 10.0
#用来设置代价地图发布可视化信息的频率,单位是hz
publish_frequency: 10.0
global_frame: map
robot_base_frame: base_footprint
#用来设置分辨率
resolution: 0.10
#用来设置在机器人移动过程中是否需要滚动窗口,以保持机器人处于中心位置
rolling_window: true
#用来设置局部代价地图宽高,单位是米
width: 5.0
height: 5.0
#分辨率可以设置的与静态地图不同,但是一般情况下两者是相同的
resolution: 0.05
track_unknown_space: false
plugins:
- {name: sensor, type: "costmap_2d::ObstacleLayer"}
- {name: inflation, type: "costmap_2d::InflationLayer"}
sensor:
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
inflation:
inflation_radius: 0.7
cost_scaling_factor: 8.0
五.move_base_params.yaml
# Move base node parameters. For full documentation of the parameters in this file, please see
#
# http://www.ros.org/wiki/move_base
#当move_base在不活动状态时,是否关掉costmap.
shutdown_costmaps: false
#向底盘控制移动话题cmd_vel发送命令的频率.
controller_frequency: 5 #1.0
#在空间清理操作执行前,控制器花多长时间等有效控制下发
controller_patience: 3.0
#全局规划操作的执行频率.如果设置为0.0,则全局规划器仅在接收到新的目标点或者局部规划器报告路径堵塞时才会重新执行规划操作
planner_frequency: 10.0
#在空间清理操作执行前,留给规划器多长时间来找出一条有效规划.
planner_patience: 5.0
#执行修复机制前,允许振荡的时长.
oscillation_timeout: 10.0
#来回运动在多大距离以上不会被认为是振荡
oscillation_distance: 0.2
#机器人是否在尝试清理空间时进行原地旋转
clearing_rotation_allowed: false