0
点赞
收藏
分享

微信扫一扫

ROS智能小车

Jonescy 2022-01-12 阅读 48

小车自主导航——思岚激光雷达、cartographer建图、纯定位,movebase

move_base导航包文件配置(根据小车底盘参数)(小白学习ing,有错误麻烦大神指正!)

四个配置文件分别是:
(1)costmap_common_params.yaml
代价地图共同的配置选项
(2)global_costmap_params.yaml
用于全局规划的代价地图的配置
(3)local_costmap_params.yaml
用于局部规划和避障的代价地图的配置
(4)teb_local_planner_params.yaml
局部规划器参数配置

costmap_common_params.yaml

该公共配置代码具体内容如下

// 小车中心为原点(*)
footprint: [ [-0.10,-0.08], [0.10,-0.08], [0.10,0.08], [-0.10,0.08] ]
transform_tolerance: 0.2
#map_type: costmap

obstacle_layer:
 enabled: true
 obstacle_range: 3.0
 raytrace_range: 3.5
 inflation_radius: 0.1
 #inflation_radius: 0.2
 track_unknown_space: false
 combination_method: 1

 observation_sources: laser_scan_sensor
 laser_scan_sensor: {data_type: LaserScan, topic: scan, marking: true, clearing: true}

inflation_layer:
  enabled:              true
  cost_scaling_factor:  10.0 
  // * 代价地图的膨胀半径:例如,将膨胀半径设定为0.1米,意味着机器人针对相同的障碍物获取的所有路径都保持距离障碍物0.1米或更远。
 inflation_radius:     0.1 
static_layer:
  enabled:              true
  map_topic:            "/map"

global_costmap_params.yaml

全局规划的代价地图的配置代码:

global_costmap:
//global_frame参数定义了代价地图应该运行的坐标系
  global_frame: map
//机器人的基座的坐标系 
  robot_base_frame: base_footprint
  update_frequency: 1.0
  publish_frequency: 0.5
  transform_tolerance: 1.0
  plugins:
    - {name: static_layer,            type: "costmap_2d::StaticLayer"}
    - {name: obstacle_layer,          type: "costmap_2d::VoxelLayer"}
    - {name: inflation_layer,         type: "costmap_2d::InflationLayer"}

local_costmap_params.yaml

//“global_frame”,“robot_base_frame”,“update_frequency”参数与上述“全局代价地图配置”部分中描述的相同。
local_costmap:
  global_frame: map
  robot_base_frame: base_footprint
  update_frequency: 5.0
  publish_frequency: 2.0
  rolling_window: true
  width: 5
  height: 5
  resolution: 0.1
  #transform_tolerance: 0.5
  transform_tolerance: 1.0
  
  plugins:
   - {name: static_layer,        type: "costmap_2d::StaticLayer"}
   - {name: obstacle_layer,      type: "costmap_2d::ObstacleLayer"}

teb_local_planner_params.yaml

TebLocalPlannerROS:
 odom_topic: odom
    
 # ******Trajectory******
 teb_autosize: True
 dt_ref: 0.3
 dt_hysteresis: 0.1
 max_samples: 500
 global_plan_overwrite_orientation: False
 allow_init_with_backwards_motion: True
 max_global_plan_lookahead_dist: 3.0
 global_plan_viapoint_sep: -1     #禁用
 global_plan_prune_distance: 1
 exact_arc_length: False
 feasibility_check_no_poses: 2
 publish_feedback: False
    
 # ******Robot******
 max_vel_x: 1.2  #最大x前向速度
 max_vel_x_backwards: 0.5  #最大x后退速度
 max_vel_y: 0.0
 max_vel_theta: 0.61 # 最大转向角速度
 acc_lim_x: 2.0  # 最大x加速度
 acc_lim_theta: 5.8  #最大角加速度

 # ********************** Carlike robot parameters ********************
 min_turning_radius: 0.36        #车类机器人的最小转弯半径
 wheelbase: 0.24                 # 驱动轴和转向轴之间的距离
 cmd_angle_instead_rotvel: True  #将收到的角速度消息转换为 操作上的角度变化 
 # ********************************************************************

 footprint_model: # types: "point", "circular", "two_circles", "line", "polygon"
   type: "line"
   #type: "polygon"
   radius: 0.2 # for type "circular"
   line_start: [0.0, 0.0] # for type "line"
   #line_end: [0.4, 0.0] # for type "line"
   line_end: [0. 20, 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.10, 0.08], [0.10, 0.08], [0.10, -0.08], [-0.10, -0.08] ] # for type "polygon"

 # GoalTolerance************************************
 xy_goal_tolerance: 0.15  #目标允许距离误差
 yaw_goal_tolerance: 0.5   #允许角度误差
 free_goal_vel: False
 complete_global_plan: True
    
 # Obstacles************************************
 min_obstacle_dist: 0.20 # This value must also include our robot's expansion, since footprint_model is set to "line".
 inflation_dist: 0.2
 include_costmap_obstacles: True
 costmap_obstacles_behind_robot_dist: 1.0
 obstacle_poses_affected: 15
 dynamic_obstacle_inflation_dist: 0.5
 include_dynamic_obstacles: True 
 costmap_converter_plugin: ""
 costmap_converter_spin_thread: True
 costmap_converter_rate: 5

 # Optimization************************************
 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

min_obstacle_dist参数解释: 在这里插入图片描述

举报

相关推荐

0 条评论