teb-安装
阅读原文时间:2023年07月15日阅读:1

源码:https://github.com/rst-tu-dortmund/teb_local_planner.git

以husky为例子:

1.在gazebo里面配置好机器人底盘的环境

roslaunch husky_gazebo husky_playpen.launch

https://github.com/husky/husky/tree/kinetic-devel/husky_gazebo

2.配置teb

launch文件的内容




    <!--Run the map server-->  
    <!--arg name = "map\_file" default = "$(find tfrbt\_navigation)/maps/tfrbt\_map.yaml"/-->  
    <!--arg name = "map\_file" default = "$(env TFRBT\_MAP\_FILE)"/-->  
    <node name = "map\_server" pkg = "map\_server" type = "map\_server" args = "$(find tfrbt\_navigation)/maps/tfrbt\_map.yaml">  
<param name="frame\_id" value="/map"/>  

    <!--Run AMCL-->  
    <arg name = "custom\_amcl\_launch\_file" default = "$(find tfrbt\_navigation)/launch/includes/amcl/front\_back\_lasers.launch.xml"/>  
    <arg name = "initial\_pose\_x" default = "0.0"/>  
    <arg name = "initial\_pose\_y" default = "0.0"/>  
    <arg name = "initial\_pose\_a" default = "0.0"/>  
    <include file = "$(arg custom\_amcl\_launch\_file)">  
            <arg name = "initial\_pose\_x" value = "arg initial\_pose\_x"/>  
            <arg name = "initial\_pose\_y" value = "arg initial\_pose\_y"/>  
            <arg name = "initial\_pose\_a" value = "arg initial\_pose\_a"/>  
    </include>

    <!--Run Move Base-->  
    <arg name = "custom\_param\_file" default = "$(find tfrbt\_navigation)/param/laser\_costmap\_params.yaml"/>  
    <include file = "$(find tfrbt\_navigation)/launch/includes/move\_base\_teb.launch.xml"> <!--move\_base\_dwa.launch.xml-->  
            <arg name = "custom\_param\_file" value = "$(arg custom\_param\_file)"/>  
    </include>

    <!--node name="rviz" pkg="rviz" type="rviz" args="-d $(find teb\_local\_planner\_tutorials)/cfg/rviz\_navigation.rviz"/-->  

主要是文件move_base_teb.launch.xml的配置,查看其内容









    <node pkg = "move\_base" type = "move\_base" respawn = "false" name = "move\_base" output = "screen">  
            <rosparam file = "$(find tfrbt\_navigation)/param/teb/costmap\_common\_params.yaml" command = "load" ns = "global\_costmap"/>  
            <rosparam file = "$(find tfrbt\_navigation)/param/teb/costmap\_common\_params.yaml" command = "load" ns = "local\_costmap"/>  
            <rosparam file = "$(find tfrbt\_navigation)/param/teb/local\_costmap\_params.yaml" command = "load"/>  
            <rosparam file = "$(find tfrbt\_navigation)/param/teb/global\_costmap\_params.yaml" command = "load"/>  
            <rosparam file = "$(find tfrbt\_navigation)/param/teb/teb\_local\_planner\_params.yaml" command = "load"/>  
            <!--rosparam file = "$(find tfrbt\_navigation)/param/teb/move\_base\_params.yaml" command = "load"/-->  
            <!--rosparam file = "$(find tfrbt\_navigation)/param/teb/global\_planner\_params.yaml" command = "load"/-->  
            <!--rosparam file = "$(find tfrbt\_navigation)/param/teb/navfn\_global\_planner\_params.yaml" command = "load"/-->  
            <rosparam file = "$(arg custom\_param\_file)" command = "load"/>

                                                            <param name="base\_global\_planner" value="global\_planner/GlobalPlanner" />  
                        <param name="planner\_frequency" value="1.0" />  
                        <param name="planner\_patience" value="5.0" />

            <param name="base\_local\_planner" value="teb\_local\_planner/TebLocalPlannerROS" />  
                        <param name="controller\_frequency" value="5.0" />  
                        <param name="controller\_patience" value="15.0" />

            <param name = "global\_costmap/global\_frame" value = "$(arg global\_frame\_id)"/>  
            <param name = "global\_costmap/robot\_base\_frame" value = "$(arg base\_frame\_id)"/>  
            <param name = "local\_costmap/global\_frame" value = "$(arg odom\_frame\_id)"/>  
            <param name = "local\_costmap/robot\_base\_frame" value = "$(arg base\_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 laser\_topic)"/>  
    </node>

costmap_common_params.yaml内容

#max_obstacle_height: 2.5 #assume something like an arm is mounted on top of the robot

robot_radius: 0.63
footprint: [[-0.50, -0.38], [-0.50, 0.38], [0.50, 0.38], [0.50, -0.38]]
footprint_padding: 0.02
transform_tolerance: 0.2
#map_type: voxel
map_type: costmap
always_send_full_costmap: true

obstacle_layer:
enabled: true
obstacle_range: 3.0
raytrace_range: 4.0
inflation_radius: 0.4
track_unknown_space: true
combination_method:

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 # exponential rate at which the obstacle cost drops off (default: )
inflation_radius: 0.65 # max. distance from an obstacle at which costs are incurred for planning paths.

static_layer:
enabled: true
map_topic: "map"

local_costmap_params.yaml内容

local_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width:
height:
resolution: 0.05
transform_tolerance: 0.5

inflation_layer:
enabled: true
cost_scaling_factor: 10.0 # exponential rate at which the obstacle cost drops off (default: )
inflation_radius: 0.65 # max. distance from an obstacle at which costs are incurred for planning paths.

plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}

global_costmap_params.yaml内容

global_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 1.0
publish_frequency: 0.5
static_map: true

transform_tolerance: 0.5
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
~

teb_local_planner_params.yaml内容

TebLocalPlannerROS:

odom_topic: odom

# Trajectory

teb_autosize: True
dt_ref: 0.3
dt_hysteresis: 0.1
global_plan_overwrite_orientation: True
allow_init_with_backwards_motion: False
max_global_plan_lookahead_dist: 3.0
feasibility_check_no_poses:

# Robot

max_vel_x: 0.5
max_vel_x_backwards: 0.5
max_vel_y: 0.0
max_vel_theta: 1.5
acc_lim_x: 0.5
acc_lim_theta: 0.5
min_turning_radius: 0.0 # diff-drive robot (can turn on place!)

footprint_model:
type: "point"

# GoalTolerance

xy_goal_tolerance: 0.2
yaw_goal_tolerance: 0.1
free_goal_vel: False

# Obstacles

min_obstacle_dist: 0.65 # This value must also include our robot radius, since footprint_model is set to "point".
inflation_dist: 0.65
include_costmap_obstacles: True
costmap_obstacles_behind_robot_dist: 1.5
obstacle_poses_affected:
costmap_converter_plugin: ""
costmap_converter_spin_thread: True
costmap_converter_rate:

# Optimization

no_inner_iterations:
no_outer_iterations:
optimization_activate: True
optimization_verbose: False
penalty_epsilon: 0.01
weight_max_vel_x:
weight_max_vel_theta:
weight_acc_lim_x:
weight_acc_lim_theta:
weight_kinematics_nh:
weight_kinematics_forward_drive:
weight_kinematics_turning_radius:
weight_optimaltime:
weight_obstacle:
weight_dynamic_obstacle: # not in use yet
weight_adapt_factor:

# Homotopy Class Planner

enable_homotopy_class_planning: True
enable_multithreading: True
simple_exploration: False
max_number_classes:
selection_cost_hysteresis: 1.0
selection_obst_cost_scale: 1.0
selection_alternative_time_cost: False

roadmap_graph_no_samples:
roadmap_graph_area_width:
h_signature_prescaler: 0.5
h_signature_threshold: 0.1
obstacle_keypoint_offset: 0.1
obstacle_heading_threshold: 0.45
visualize_hc_graph: False

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章