记录TrajectoryPlannerROS参数

本文记录了关于机器人移动基础包(move_base)中TrajectoryPlannerROS的参数配置,包括加速度限制、最大旋转速度、DWA动态窗口算法的使用等。同时详细介绍了全局和局部Costmap的参数,如footprint、inflation_radius、obstacle_range和update_frequency,以确保机器人在环境中安全有效地导航。
xuting@ubuntu:/opt/ros/indigo/catkin_ws$ rosparam get /move_base/TrajectoryPlannerROS/
{acc_lim_theta: 2.2, acc_lim_x: 1.5, acc_lim_y: 2.5, dwa: true, holonomic_robot: false,
  max_rotational_vel: 0.8, max_vel_x: 0.3, meter_scoring: true, min_in_place_rotational_vel: 0.4,
  min_vel_x: 0.1}



xuting@ubuntu:/opt/ros/indigo/catkin_ws$ rosparam get /move_base/
GlobalPlanner: {use_grid_path: false}
TrajectoryPlannerROS: {acc_lim_theta: 2.2, acc_lim_x: 1.5, acc_lim_y: 2.5, dwa: true,
  holonomic_robot: false, max_rotational_vel: 0.8, max_vel_x: 0.3, meter_scoring: true,
  min_in_place_rotational_vel: 0.4, min_vel_x: 0.1}
base_global_planner: global_planner/GlobalPlanner
controller_frequency: 2
global_costmap:
  footprint:
  - [-0.2, -0.2]
  - [0.2, -0.2]
  - [0.2, 0.2]
  - [-0.2, 0.2]
  global_frame: /map
  inflation_layer: {inflation_radius: 0.1}
  inflation_radius: 0.1
  obstacle_range: 2.5
  obstacles:
    laser_scan_sensor: {clearing: true, data_type: LaserScan, marking: true, sensor_frame: laser,
      topic: /scan}
    observation_sources: laser_scan_sensor
    ultra_sensor: {clearing: true, data_type: PointCloud, marking: true, sensor_frame: base_link,
      topic: /ultra_scan}
  plugins:
  - {name: static_map, type: 'costmap_2d::StaticLayer'}
  - {name: inflation_layer, type: 'costmap_2d::InflationLayer'}
  raytrace_range: 3.0
  resolution: 0.1
  robot_base_frame: base_link
  static_map: {map_topic: /map}
  transform_tolerance: 0.5
  update_frequency: 2.0
local_costmap:
  footprint:
  - [-0.2, -0.2]
  - [0.2, -0.2]
  - [0.2, 0.2]
  - [-0.2, 0.2]
  global_frame: odom
  height: 6
  inflation_layer: {inflation_radius: 0.2}
  inflation_radius: 0.1
  map_type: costmap
  obstacle_range: 2.5
  obstacles:
    laser_scan_sensor: {clearing: true, data_type: LaserScan, marking: true, sensor_frame: laser,
      topic: /scan}
    observation_sources: laser_scan_sensor
    ultra_sensor: {clearing: true, data_type: PointCloud, marking: true, sensor_frame: base_link,
      topic: /ultra_scan}
  plugins:
  - {name: obstacles, type: 'costmap_2d::ObstacleLayer'}
  - {name: inflation_layer, type: 'costmap_2d::InflationLayer'}
  publish_frequency: 2.0
  raytrace_range: 3.0
  resolution: 0.1
  robot_base_frame: base_link
  rolling_window: true
  static_map: false
  transform_tolerance: 0.5
  update_frequency: 2.0
  width: 6
recovery_behavior_enabled: false
visualize_potential: true


在ROS中配置 `move_base` 参数是实现机器人导航功能的关键步骤之一。`move_base` 依赖于多个参数文件进行全局和局部路径规划、代价地图构建以及局部规划器行为控制。以下是对主要配置文件及其内容的详细说明。 ### 配置文件结构 通常,`move_base` 的参数配置分为以下几个YAML文件: 1. **costmap_common_params.yaml** 此文件包含全局和局部代价地图共用的参数,例如障碍物检测的传感器信息、代价地图更新频率等。 ```yaml obstacle_range: 2.5 raytrace_range: 3.0 footprint: [[x1, y1], [x2, y2], ...] # 机器人的轮廓定义 inflation_radius: 0.55 cost_scaling_factor: 3.0 map_type: costmap transform_tolerance: 0.1 obstacle_layer: enabled: true max_obstacle_height: 2.0 observation_sources: laser_scan_sensor laser_scan_sensor: data_type: LaserScan topic: /scan marking: true clearing: true ``` 2. **global_costmap_params.yaml** 全局代价地图主要用于全局路径规划,其配置包括地图来源、更新周期、坐标系设置等。 ```yaml global_costmap: global_frame: /map robot_base_frame: /base_link update_frequency: 5.0 static_map: true publish_voxel_map: false ``` 3. **local_costmap_params.yaml** 局部代价地图用于避障和局部路径调整,需指定局部坐标系及传感器数据源等。 ```yaml local_costmap: global_frame: /odom robot_base_frame: /base_link update_frequency: 5.0 publish_frequency: 2.0 static_map: false rolling_window: true width: 6.0 height: 6.0 resolution: 0.05 ``` 4. **base_local_planner_params.yaml** 局部规划器负责生成速度指令以避开障碍并朝向目标点移动。常见的局部规划器为 `TrajectoryPlannerROS` 或 `DWAPlannerROS`。 ```yaml TrajectoryPlannerROS: max_vel_x: 0.5 min_vel_x: 0.1 max_vel_theta: 1.0 min_vel_theta: -1.0 acc_lim_theta: 1.2 yaw_goal_tolerance: 0.1 xy_goal_tolerance: 0.1 sim_time: 1.7 pdist_scale: 0.8 gdist_scale: 0.2 ``` ### 启动配置文件 将上述配置文件通过一个 `.launch` 文件加载到 `move_base` 节点中,确保参数正确作用于对应的命名空间。 ```xml <launch> <node pkg="move_base" type="move_base" name="move_base" output="screen"> <rosparam file="$(find my_robot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap"/> <rosparam file="$(find my_robot_navigation)/config/global_costmap_params.yaml" command="load" ns="global_costmap"/> <rosparam file="$(find my_robot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap"/> <rosparam file="$(find my_robot_navigation)/config/local_costmap_params.yaml" command="load" ns="local_costmap"/> <rosparam file="$(find my_robot_navigation)/config/base_local_planner_params.yaml" command="load"/> </node> </launch> ``` ### 参数调优建议 - **轨迹规划问题(如原地打转、绕圈)**:可以尝试调整局部规划器中的 `pdist_scale` 和 `gdist_scale`,提高对目标方向的优先级[^3]。 - **定位误差过大导致路径偏移**:检查 `/odom` 数据是否稳定,并确认 AMCL 定位节点已正确运行[^4]。 - **传感器数据异常影响导航**:确保激光雷达 `/scan` 数据正常发布,并在 `costmap_common_params.yaml` 中配置正确的 `observation_sources`。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值