teb_local_planner安装及使用

在机器人导航实验时,传统的navigation里的路径规划策略性能不佳。在尝试了teb_local_planner后,发现机器人导航性能得到非常大的提升。虽然teb_local_planner是局部规划的plugin,但是其能根据实际的环境情况实时更新全局路径,使得机器人的运动将十分智能。

       teb_local_planner的详尽资料(包括安装及导航,参数调节等)请参考其ros官方文档:http://wiki.ros.org/teb_local_planner、http://wiki.ros.org/teb_local_planner/Tutorials。teb_local_planner的github源码:https://github.com/rst-tu-dortmund/teb_local_planner。在此简要介绍teb_local_planner的安装使用经历。

        teb_local_planner将navigation里的base_local_planner替换,故其作用机制和base_local_planner一样为ros的plugin机制。plugin的使用可以参考:http://www.cnblogs.com/W-chocolate/p/4328725.html。

        

        teb_local_planner的安装步骤如下(注意ros为kenetic版):

        1、安装依赖:

              rosdep install teb_local_planner

              (曾在indigo版本采用此种方式安装依赖未成功,需要在源码中package.xml以及CMakeList.txt中筛选出缺少的依赖并安装)

         2、从github上下载源码:https://github.com/rst-tu-dortmund/teb_local_planner

         3、放入工作空间的/src文件夹中

        4、catkin_make -DCATKIN_WHITELIST_PACKAGES=“源码存放的文件夹名字”(单独编译teb_local_planner)

               编译需要较长的编译时间(我在树莓派上的编译时间近2小时)

         5、查看teb_local_planner的plugin是否安装完成

              rospack plugins --attrib=plugin nav_core

              如果能查询到teb_local_planner,则表明以及准备就绪。

       值得一提的是,teb_local_planner源码中关于plugin的配置文件均已写好,直接编译源码就能完成plugin的注册及插入,非常方便。

      

        teb_local_planner使用方法和base_local_planner一样,接下来简要介绍。默认已熟悉ros的navigation的使用。

         1、新建teb_local_planner配置文件teb_local_planner_params.yaml

              在此我偷了个懒,直接从tutorials中下载:

              git clone https://github.com/rst-tu-dortmund/teb_local_planner_tutorials.git 

              在/cfg中找到所需的teb_local_planner_params.yaml。由于使用机器人odom为差动模式的,故选取diff_drive中的。

        2、将teb_local_planner_params.yaml和navigation中其他的配置文件(如costmap_common_params.yaml等)放在一起,方便查阅调用。个人习惯如此,也可以不放在一起。

         3、在启动navigation的launch文件中load上述配置文件

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
     ...
    <rosparam file="$(find my_robot_name_2dnav)/base_local_planner_params.yaml" command="load" />
     ...
  </node>
         4、在启动navigation的launch文件中声明base_local_planner采用先前注册的plugin

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    ...
    <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />
    ...
  </node>
                当然也可以选择在move_base_params.yaml中声明。

          5、启动navigation,在rviz中将三条path调出来,即可观察机器人导航过程中规划路径的变化。

       此外,可以通过rosrun rqt_reconfigure rqt_reconfigure动态调节参数使机器人导航性能达到最佳。关于参数调节的方法请参考其ros官方文档。实际使用的经历来看,采用从teb_local_planner_tutorials下载下来的默认参数达到的性能已经远优于原始navigation中的路径规划算法的性能。我认为teb_local_planner的应用价值非常大。

teb_local_planner是ROS中的一个局部路径规划器,用于生成机器人在环境中的局部路径。以下是使用teb_local_planner的基本步骤: 1. 安装teb_local_planner: ``` sudo apt-get install ros-<distro>-teb-local-planner ``` 2. 在机器人的工作空间中创建一个catkin包,并在package.xml中添加如下依赖项: ``` <build_depend>teb_local_planner</build_depend> <run_depend>teb_local_planner</run_depend> ``` 3. 创建一个launch文件,将teb_local_planner配置为全局规划器的子规划器: ```xml <launch> <node name="move_base" pkg="move_base" type="move_base" respawn="false" output="screen"> <rosparam file="$(find your_robot_config)/base_local_planner_params.yaml" command="load" /> <rosparam file="$(find your_robot_config)/global_planner_params.yaml" command="load" /> <param name="base_global_planner" value="navfn/NavfnROS" /> <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" /> </node> </launch> ``` 4. 在机器人配置文件夹下创建一个base_local_planner_params.yaml文件,并在其中添加TebLocalPlannerROS的参数设置。这里提供一个示例: ```yaml # TEB Local Planner parameters TrajectoryPlannerROS: max_vel_x: 0.5 max_rotational_vel: 1.0 min_in_place_rotational_vel: 0.1 escape_vel: -0.1 acc_lim_x: 1.0 acc_lim_th: 1.0 holonomic_robot: false max_vel_theta: 1.0 min_turning_radius: 0.2 footprint_model: consavable_laser_scan footprint_padding: 0.1 teb_autosize: true dt_ref: 0.3 dt_hysteresis: 0.1 min_samples: 3 global_plan_overwrite_orientation: true allow_init_with_backwards_motion: false max_global_plan_lookahead_dist: 3.0 force_reinit_new_goal_dist: 1.0 force_reinit_new_goal_angular: 0.2 inscribed_radius: 0.25 circumscribed_radius: 0.3 costmap_converter_plugin: "" costmap_converter_spin_thread: true visualize_subsampled_path: false visualize_voronoi_path: false visualize_infeasible_points: false visualize_dynamic_obstacles: false delete_detours_backwards: false detours_orientation_tolerance: 0.1 weight_viapoint: 1.0 weight_optimaltime: 1.0 weight_shortest_path: 0.0 viapoints_all_candidates: false max_number_classes: 0 selection_cost_hysteresis: 0.1 selection_prefer_initial_plan: false selection_obst_cost_scale: 10.0 selection_viapoint_cost_scale: 1.0 selection_alternative_time_cost: true selection_dropping_probability: 0.0 selection_dropping_memory: 2 ``` 5. 启动机器人并运行局部路径规划器: ``` roslaunch your_robot_name teb_local_planner.launch ``` 以上是使用teb_local_planner的基本步骤,你需要根据你的机器人配置和任务需求进行相应的参数配置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值