ROS-melodic:源码安裝teb_local_planner算法、替换DWA算法

news/2024/11/29 13:51:02/

一.安裝teb_local_planner算法

源码下载地址:GitHub - rst-tu-dortmund/teb_local_planner: An optimal trajectory planner considering distinctive topologies for mobile robots based on Timed-Elastic-Bands (ROS Package)

 注意选择对应ROS版本的代码。

 放在navigation目录下(或者自己创建一个):

安装缺失依赖:

rosdep install teb_local_planner

 在src当前目录下运行:

	  rosdep install --from-paths src --ignore-src --rosdistro=<ros_version> -y

编译:

      catkin_make -DCATKIN_WHITELIST_PACKAGES="teb_local_planner"

在编译过程中会出现缺包,对应安装就好了。

查看是否安装成功:

rospack plugins --attrib=plugin nav_core

会出现以下相关信息:

teb_local_planner /home/catkin_navigation/src/navigation/teb_local_planner-melodic-devel/teb_local_planner_plugin.xml

测试:

roslaunch teb_local_planner test_optim_node.launch

 二.teb替代DWA算法

move_base.launch文件中添加teb配置内容:

<launch><!-- Arguments --><arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/><arg name="cmd_vel_topic" default="/cmd_vel" /><arg name="odom_topic" default="odom" /><arg name="move_forward_only" default="false"/><!--true机器人只能向前运动--><!-- move_base --><node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen"><!--加载Dijkstra、A star算法--><param name="base_global_planner" value="global_planner/GlobalPlanner"/><param name="planner_frequency" value="1.0" /><param name="planner_patience" value="5.0" /><!--加载DWA算法<param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />--><!--加载TEB算法--><param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" /><!--配置文件--><rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="global_costmap" /><rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="local_costmap" /><rosparam file="$(find turtlebot3_navigation)/param/local_costmap_params.yaml" command="load" /><rosparam file="$(find turtlebot3_navigation)/param/global_costmap_params.yaml" command="load" /><rosparam file="$(find turtlebot3_navigation)/param/move_base_params.yaml" command="load" /><!--DWA配置文件--><rosparam file="$(find turtlebot3_navigation)/param/dwa_local_planner_params_$(arg model).yaml" command="load" /><!--TEB配置文件--><rosparam file="$(find turtlebot3_navigation)/param/teb_local_planner_params.yaml" command="load" /><remap from="cmd_vel" to="$(arg cmd_vel_topic)"/><remap from="odom" to="$(arg odom_topic)"/><param name="DWAPlannerROS/min_vel_x" value="0.0" if="$(arg move_forward_only)" /></node>
</launch>

turtlebot3_navigation/param文件夹下创建teb_local_planner_params.yaml文件:

TebLocalPlannerROS:odom_topic: odommap_frame: map# Trajectoryteb_autosize: Truedt_ref: 0.5dt_hysteresis: 0.05min_samples: 3global_plan_overwrite_orientation: Trueglobal_plan_viapoint_sep: 0.1 # negative, do not use viapoints. positive, use them. the actual value does not mattermax_global_plan_lookahead_dist: 1.5global_plan_prune_distance: 0.6force_reinit_new_goal_dist: 1.0feasibility_check_no_poses: 3publish_feedback: falseallow_init_with_backwards_motion: trueexact_arc_length: falseshrink_horizon_backup: trueshrink_horizon_min_duration: 10# Robotmax_vel_x: 0.22max_vel_x_backwards: 0.5max_vel_theta: 2.75max_vel_y: 0.0acc_lim_y: 0.0acc_lim_x: 2.5acc_lim_theta: 3.2min_turning_radius: 0.0wheelbase: 0.0 # not used, is differentialcmd_angle_instead_rotvel: false # not used, is differentialfootprint_model: # types: "point", "circular", "two_circles", "line", "polygon"
#    type: "circular"
#    radius: 0.5 # for type "circular"
#    type: "line"
#    line_start: [-0.0545, 0.0] # for type "line"
#    line_end: [0.0545, 0.0] # for type "line"
# front_offset: 0.2 # for type "two_circles"
# front_radius: 0.2 # for type "two_circles"
# rear_offset: 0.2 # for type "two_circles"
# rear_radius: 0.2 # for type "two_circles"type: "polygon"vertices: [[-0.105, -0.105], [-0.105, 0.105], [0.041, 0.105], [0.041, -0.105]] # for type "polygon"# GoalTolerancexy_goal_tolerance: 0.05yaw_goal_tolerance: 0.17free_goal_vel: False# Obstaclesmin_obstacle_dist: 0.1 # minimum distance to obstacle: it depends on the footprint_modelinflation_dist: 0.0 # greater than min_obstacle_dist to take effectinclude_costmap_obstacles: True # use the local costmapcostmap_obstacles_behind_robot_dist: 1.0 # distance at which obstacles behind the robot are taken into accountlegacy_obstacle_association: falseobstacle_poses_affected: 30 # unused if legacy_obstacle_association is falseobstacle_association_force_inclusion_factor: 10.0 # the obstacles that will be taken into account are those closer than min_obstacle_dist*factor, if legacy is falseobstacle_association_cutoff_factor: 40.0 # the obstacles that are further than min_obstacle_dist * factor will not be taken into account, if legacy is false
#  costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSMCCH"#costmap_converter_plugin: "costmap_converter::CostmapToLinesDBSRANSAC"#costmap_converter_plugin: "costmap_converter::CostmapToLinesDBSMCCH"
#  costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSConcaveHull"costmap_converter_plugin: "" # deactivate plugincostmap_converter_spin_thread: Truecostmap_converter_rate: 10# Optimizationno_inner_iterations: 5no_outer_iterations: 4optimization_activate: True # optimizeoptimization_verbose: Falsepenalty_epsilon: 0.1weight_max_vel_x: 2weight_max_vel_y: 1weight_max_vel_theta: 1weight_acc_lim_x: 1weight_acc_lim_y: 1weight_acc_lim_theta: 1weight_kinematics_nh: 1 # is a holonomic robotweight_kinematics_forward_drive: 10 # prefer forward driving, for differentialweight_kinematics_turning_radius: 0 # prefer turns that respect the min_turning_radius, not used if differential (min_turning_radius = 0)weight_optimaltime: 1.0 # prefer trajectories with less transition timeweight_obstacle: 50.0 # prefer trajectories that respect the min_obstacle_distweight_inflation: 0.1 # prefer trajectories that respect the inflation of the obstacles#weight_dynamic_obstacle: 10 # not in use yetweight_viapoint: 1.0 # prefer trajectories that respect the viapoints in the global pathweight_adapt_factor: 2 # factor to multiply some weights (currently only weight_obstacle) at each iteration (gives better results than a huge value for the weight)# Homotopy Class Plannerenable_homotopy_class_planning: True # currently not used

效果展示:

参考:【ROS】Turtlebot3局部避障TEB算法配置_move_base三维导航_RockWang.的博客-CSDN博客


http://www.ppmy.cn/news/382158.html

相关文章

远程复制服务器大于2g文件吗,ps保存文件太大_PS文件大于2G存不了怎么办

摘要 腾兴网为您分享:PS文件大于2G存不了怎么办&#xff0c;社会扶贫&#xff0c;闪动壁纸&#xff0c;每日一淘&#xff0c;老师说等软件知识&#xff0c;以及钢铁侠动态壁纸&#xff0c;甘肃教育&#xff0c;社保认证&#xff0c;华为mate8刷机包&#xff0c;赣教&#xff0c…

3d wallpaper android,3dwallpapers

3d wall papers app是一款最近比较受欢迎的3D立体动态壁纸设置免费软件&#xff0c;这里有非常齐全的立体视觉效果的手机壁纸可供选择&#xff0c;不断更新&#xff0c;试下流心风格图片&#xff0c;高清无水印&#xff0c;免费试用&#xff0c;支持重力传感器和陀螺仪效果是用…

为什么超三成制造企业上市公司选择用友U9 cloud?

导读&#xff1a;30%制造企业上市公司和40%专精特新制造业上市公司都选择用友U9 cloud 当前&#xff0c;数智化转型已经成为中国制造重构竞争力、实现高质量发展的必经之路。《“十四五”智能制造发展规划》提出&#xff0c;到2025年&#xff0c;70%的规模以上制造业企业基本实…

uniapp小程序中的相关设置

要让uniapp中的背景图片全屏&#xff0c;可以在<style>标签中添加以下样式&#xff1a; page { background-image: url(/static/bg.jpg); background-size: cover; background-repeat: no-repeat; background-position: center center; } 在这个样式中&…

盖茨预言AI助理成标配,AI+RPA打破AI准入高门槛!

根据微软联合创始人比尔盖茨的预测&#xff0c;未来顶级的人工智能公司将会开发一种全新的“个人AI助理”。比尔盖茨表示&#xff0c;“个人AI助理”将会具有出色的功能&#xff0c;可以改变人们的生活方式以及工作方式。无论哪一家公司能够赢得AI助理竞争先机&#xff0c;都会…

事件类积木8/16

大家好&#xff0c;今天我们来说一说编程猫事件类积木8/16&#xff0c;要将的积木有;当<>、停止【全部脚本】、停止、重启。 1、当<> 当<>的意思是事件的开端&#xff1a;当满足指定条件&#xff0c;即事件被触发时&#xff0c;立即执行这块积木下的脚本积…

A Game of Thrones(79)

44.SANSA(0) He wouldn’t send Ser Loras,” Sansa told Jeyne Poole that night as they shared a cold supper by lamplight. “I think it was because of his leg.” Lord Eddard had taken his supper in his bedchamber with Alyn, Harwin, and Vayon Poole, the be…

8/1~~8/19

解决用户函数不能打开驱动程序所对应的设备文件的问题: 问题:用户程序b的open("/dev/MyDev",O_RDWR)函数总是失败,返回-1值. 具体更改动作:1.增加头文件(?) 2.更改设备文件路径 "MyDev" -> "/dev/MyDev" 3.打开模式: "读…