MoveBa的配置⽂件分析
本⽂分析move ba 的配置⽂件,从配置⽂件设置的⾓度,可以更清晰的把握move ba对于costmap2D,global planner,local planner的调⽤关系。
这⾥采⽤turtlebot_navigation package 为例:
<launch>
<include file="$(find turtlebot_navigation)/launch/includes/velocity_l"/>
<include file="$(find turtlebot_navigation)/launch/includes/safety_l"/>
<arg name="odom_frame_id"default="odom"/>
<arg name="ba_frame_id"default="ba_footprint"/>
<arg name="global_frame_id"default="map"/>
<arg name="odom_topic"default="odom" />
<arg name="lar_topic"default="scan" />
<arg name="custom_param_file"default="$(find turtlebot_navigation)/param/dummy.yaml"/>
<!-- 以下部分是move ba调⽤,需要配置的⽂件:包括全局地图,局部地图,全局planner,局部planner -->
这就是我作文400字<node pkg="move_ba"type="move_ba"respawn="fal"name="move_ba"output="screen">
<rosparam file="$(find turtlebot_navigation)/param/costmap_common_params.yaml"command="load"ns="global_costmap" />
<rosparam file="$(find turtlebot_navigation)/param/costmap_common_params.yaml"command="load"ns="local_costmap" />
<rosparam file="$(find turtlebot_navigation)/param/local_costmap_params.yaml"command="load" />
<rosparam file="$(find turtlebot_navigation)/param/global_costmap_params.yaml"command="load" />
<rosparam file="$(find turtlebot_navigation)/param/dwa_local_planner_params.yaml"command="load" />
<rosparam file="$(find turtlebot_navigation)/param/move_ba_params.yaml"command="load" />
<rosparam file="$(find turtlebot_navigation)/param/global_planner_params.yaml"command="load" />
<rosparam file="$(find turtlebot_navigation)/param/navfn_global_planner_params.yaml"command="load" />
<!-- external params file that could be loaded into the move_ba namespace -->
<rosparam file="$(arg custom_param_file)"command="load" />
<!-- ret frame_id parameters using ur input data -->
<param name="global_costmap/global_frame"value="$(arg global_frame_id)"/>
<param name="global_costmap/robot_ba_frame"value="$(arg ba_frame_id)"/>
<param name="local_costmap/global_frame"value="$(arg odom_frame_id)"/>
<param name="local_costmap/robot_ba_frame"value="$(arg ba_frame_id)"/>
<param name="DWAPlannerROS/global_frame_id"value="$(arg odom_frame_id)"/>
<remap from="cmd_vel"to="navigation_velocity_smoother/raw_cmd_vel"/>
<remap from="odom"to="$(arg odom_topic)"/>
<remap from="scan"to="$(arg lar_topic)"/>
</node>
</launch>
从上⾯的配置上来可以看到以下内容,这些都是关于地图的配置:
/param/costmap_common_params.yaml" command="load" ns="global_costmap"
/param/costmap_common_params.yaml" command="load" ns="local_costmap"
/param/local_costmap_params.yaml" command="load"
/
param/global_costmap_params.yaml" command="load"
地图配置,⾸先是采⽤了⼀个costmap_common_params.yaml⽂件配置了⼀些公共的参数:
max_obstacle_height: 0.60 # assume something like an arm is mounted on top of the robot
# Obstacle Cost Shaping (s/costmap_2d/hydro/inflation)
robot_radius: 0.20 # 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: 0.6
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.5
raytrace_range: 3.0
origin_z: 0.0
z_resolution: 0.2
z_voxels: 2
publish_voxel_map: fal
obrvation_sources: scan bump
scan:
data_type: LarScan
topic: scan
marking: true
clearing: true
min_obstacle_height: 0.25
max_obstacle_height: 0.35
bump:
data_type: PointCloud2
topic: mobile_ba/nsors/bumper_pointcloud
marking: true
clearing: fal
min_obstacle_height: 0.0
max_obstacle_height: 0.15
# for debugging only, let's you e the entire voxel grid
#cost_scaling_factor and inflation_radius were now moved to the inflation_layer ns
inflation_layer:
enabled: true
行车记录仪什么牌子质量好
cost_scaling_factor: 5.0 # exponential rate at which the obstacle cost drops off (default: 10)
inflation_radius: 0.5 # max. distance from an obstacle at which costs are incurred for planning paths.
static_layer:
enabled: true
然后分别设定global map 和local map:
global_costmap:
global_frame: /map
robot_ba_frame: /ba_footprint
update_frequency: 1.0
publish_frequency: 0.5
static_map: true
transform_tolerance: 0.5
<!-- global map引⼊了以下三层,经融合构成了master map,⽤于global planner-->
plugins:
-
{name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
local_costmap:
global_frame: odom
robot_ba_frame: /ba_footprint
update_frequency: 5.0
publish_frequency: 2.0
static_map: fal
rolling_window: true
width: 4.0
height: 4.0
resolution: 0.05
年会流程transform_tolerance: 0.5
<!-- local map引⼊了以下两层,经融合构成了master map,⽤于局部planner-->
plugins:
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}不同的用英语怎么说
然后是planner的配置:
/param/move_ba_params.yaml" command="load"
/param/global_planner_params.yaml" command="load"
/param/navfn_global_planner_params.yaml" command="load"
/
param/dwa_local_planner_params.yaml" command="load"
⽂件move_ba_params.yaml 内容
shutdown_costmaps: fal
controller_frequency: 5.0
controller_patience: 3.0
planner_frequency: 1.0
planner_patience: 5.0
oscillation_timeout: 10.0
oscillation_distance: 0.2
# local planner - default is trajectory rollout
ba_local_planner: "dwa_local_planner/DWAPlannerROS"
<!--这⾥配置了local planner为dwa_local_planner -->
<!--这⾥配置了global planner为navfn/NavfnROS -->
ba_global_planner: "navfn/NavfnROS" #alternatives: global_planner/GlobalPlanner, carrot_planner/CarrotPlanner 对于global planner,可以采⽤以下三种实现之⼀:
"navfn/NavfnROS","global_planner/GlobalPlanner","carrot_planner/CarrotPlanner"
然后来看global planner的配置:
GlobalPlanner: # Also e: s/global_planner
old_navfn_behavior: fal # Exactly mirror behavior of navfn, u defaults for other boolean parameters, default fal
u_quadratic: true # U the quadratic approximation of the potential. Otherwi, u a simpler calculation, default true
u_dijkstra: true # U dijkstra's algorithm. Otherwi, A*, default true
高中生家长寄语
u_grid_path: fal # Create a path that follows the grid boundaries. Otherwi, u a gradient descent method, default fal
allow_unknown: true # Allow planner to plan through unknown space, default true
#Needs to have track_unknown_space: true in the obstacle / voxel layer (in costmap_commons_param) to work planner_window_x: 0.0 # default0.0
planner_window_y: 0.0 # default0.0
default_tolerance: 0.0 # If goal in obstacle, plan to the clost point in radius default_tolerance, default0.0
publish_scale: 100 # Scale by which the published potential gets multiplied, default100
planner_costmap_publish_frequency: 0.0 # default0.0
lethal_cost: 253 # default253
neutral_cost: 50 # default50
cost_factor: 3.0 # Factor to multiply each cost from costmap by, default3.0
publish_potential: true # Publish Potential Costmap (this is not like the navfn pointcloud2 potential), default true
对于local planner ,有以下两种选择:
"trajectory rollout","dwa_local_planner/DWAPlannerROS"
以下配置了DWAPlannerROS :
DWAPlannerROS:
# Robot Configuration Parameters - Kobuki
max_vel_x: 0.5# 0.55
min_vel_x: 0.0
max_vel_y: 0.0# diff drive robot
min_vel_y: 0.0# diff drive robot
max_trans_vel: 0.5# choo slightly less than the ba's capability
min_trans_vel: 0.1# this is the min trans velocity when there is negligible rotational velocity
trans_stopped_vel: 0.1
# Warning!
# do not t min_trans_vel to 0.0 otherwi dwa will always think translational velocities
# are non-negligible and small in place rotational velocities will be created.
max_rot_vel: 5.0# choo slightly less than the ba's capability
min_rot_vel: 0.4# this is the min angular velocity when there is negligible translational velocity
rot_stopped_vel: 0.4
死气沉沉的近义词acc_lim_x: 1.0# maximum is theoretically 2.0, but we
acc_lim_theta: 2.0
acc_lim_y: 0.0# diff drive robot
# Goal Tolerance Parameters
yaw_goal_tolerance: 0.3# 0.05蒜蓉西兰花的做法
xy_goal_tolerance: 0.15# 0.10
# latch_xy_goal_tolerance: fal
# Forward Simulation Parameters
sim_time: 1.0# 1.7
vx_samples: 6# 3
vy_samples: 1# diff drive robot, there is only one sample
vtheta_samples: 20# 20
# Trajectory Scoring Parameters
path_distance_bias: 64.0# 32.0 - weighting for how much it should stick to the global path plan goal_distance_bias: 24.0# 24.0 - wighting for how much it should attempt to reach its goal
occdist_scale: 0.5# 0.01 - weighting for how much the controller should avoid obstacles
forward_point_distance: 0.325# 0.325 - how far along to place an additional scoring point
stop_time_buffer: 0.2# 0.2 - amount of time a robot must stop in before colliding for a valid traj. scaling_speed: 0.25# 0.25 - absolute velocity at which to start scaling the robot's footprint
max_scaling_factor: 0.2# 0.2 - how much to scale the robot's footprint when at speed.
# Oscillation Prevention Parameters
oscillation_ret_dist: 0.05# 0.05 - how far to travel before retting oscillation flags
干洗# Debugging
publish_traj_pc : true
publish_cost_grid_pc: true
global_frame_id: odom
# Differential-drive robot configuration - necessary?
# holonomic_robot: fal