ROS teb_local_planner安装及使用


前言

多机器人编队在狭窄环境中避障能力较差,领航机器人有时规划不出一条可达路径,故希望采用TEB算法来进行领航者机器人的局部路径规划。以提高机器人编队整体的避障能力。


一、TEB的下载与安装

源码下载地址:https://gitcode.com/mirrors/rst-tu-dortmund/teb_local_planner/tree/noetic-devel
选择对应版本的代码(我的系统为18.04选择melodic版本):
在这里插入图片描述
把下载好的teb_local_planner解压,放在自己的工作空间里,建议放在导航(navigation)功能包中。
在这里插入图片描述 Navigation 所在工作空间运行以下命令:

rosdep install --from-paths src --ignore-src --rosdistro=melodic -r -y

在这里插入图片描述显示successfully:#All required rosdeps installed successfully
返回总的工作空间目录下,对teb功能包单独编译:

catkin_make -DCATKIN_WHITELIST_PACKAGES="teb_local_planner"

在这里插入图片描述
查看是否安装成功:

rospack plugins --attrib=plugin nav_core

在这里插入图片描述
出现:teb_local_planner /opt/ros/melodic/share/teb_local_planner/teb_local_planner_plugin.xml 则代表安装成功。

二、TEB的使用

为把下载好的teb_local_planner成功应用在机器人编队领航者小车的局部路径规划中费了好大一会功夫,在网上也找到了许多的参考资料,但都未能达到预期的效果,最终在ros.wiki中找到了解决办法。
遇到的问题:
在这里插入图片描述在这里插入图片描述
解决办法:
在自己启动navigation的launch文件中,找到需要启动的move_base.launch文件
(我的导航启动文件为:navigation_demo3.launch,
其调用的move_base文件为:move_base_ares2.launch)
在这里插入图片描述按照ros.wiki社区的提示,添加<param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />

在这里插入图片描述

三、效果演示

在这里插入图片描述可以在Local Plan中找到:/move_base/TebLocalPlannerROS/local_plan
导航测试一下:

在这里插入图片描述
teb规划出的局部路径,红色路线,与dwa最大的区别就是可以倒退了,提高了路径规划的效果。
多机:
在这里插入图片描述在这里插入图片描述


总结

虽然整体上机器人编队的避障效果有所改善,但仍未能达到预期的效果,后面打算通过调参来进一步改进,且目前跟随机器人在移动时在地图中留下了障碍物痕迹,对导航效果产生了消极的影响,后面想办法消除他们。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
teb_local_plannerROS的一个局部路径规划器,用于生成机器人在环境的局部路径。以下是使用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的基本步骤,你需要根据你的机器人配置和任务需求进行相应的参数配置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值