ros1仿真导航机器人 navigation

仅为学习记录和一些自己的思考,不具有参考意义。

1navigation导航框架

2导航设置过程

(1)启动仿真环境

roslaunch why_simulation why_robocup.launch

(2)启动move_base导航、amcl定位

roslaunch why_simulation nav.launch 

<launch>

    <node pkg="move_base" type="move_base" name="move_base">
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find why_simulation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find why_simulation)/config/local_costmap_params.yaml" command="load" />
        <param name="base_global_planner" value="global_planner/GlobalPlanner" /> 
        <param name="base_local_planner" value="wpbh_local_planner/WpbhLocalPlanner" />
    </node>

    <node pkg="map_server" type="map_server" name="map_server" args="$(find why_simulation)/maps/map.yaml"/>

    <node pkg="amcl" type="amcl" name="amcl"/>


</launch>

(3)启动rviz

rviz

(4)设置目标点

(5)将左右指令完善到launch文件中

<launch>

    <include file="$(find why_simulation)/launch/why_robocup.launch"/>

    <node pkg="move_base" type="move_base" name="move_base">
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find why_simulation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find why_simulation)/config/local_costmap_params.yaml" command="load" />
        <param name="base_global_planner" value="global_planner/GlobalPlanner" /> 
        <param name="base_local_planner" value="wpbh_local_planner/WpbhLocalPlanner" />
    </node>

    <node pkg="map_server" type="map_server" name="map_server" args="$(find why_simulation)/maps/map.yaml"/>

    <node pkg="amcl" type="amcl" name="amcl"/>

    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find why_simulation)/rviz/nav.rviz"/>
    
</launch>

3全局路径规划算法

功能包简介

navfn与global_planner功能相同,同时包含了Dijkstra与A*算法。

navfn默认使用Dijkstra算法,算法无问题,但是此包的A*存在问题。

global_planner功能包无bug。

carrot_planner功能包碰到障碍物就停止了,常作为自己书写的规划器的模板。

启动全局规划

    <node pkg="move_base" type="move_base" name="move_base">
        <param name="base_global_planner" value="global_planner/GlobalPlanner" /> 
    </node>

golbal_planner默认使用Dijkstra算法,若要切换为A*,则需要以下修改。

    <node pkg="move_base" type="move_base" name="move_base">

        <param name="base_global_planner" value="global_planner/GlobalPlanner" /> .

        <param name="GlobalPlanner/use_dijkstra" value="false" /> 
        <param name="GlobalPlanner/use_grid_path" value="true" /> 

    </node>

4 amcl

    <node pkg="amcl" type="amcl" name="amcl"/>

开始导航后真实位置的粒子越来越少

5 costmap

代价地图

代价地图的参数设置

costmap_common_params.yaml

robot_radius: 0.25
inflation_radius: 0.5
obstacle_range: 6.0
raytrace_range: 6.0
observation_sources: base_lidar
base_lidar: {
    data_type: LaserScan,
    topic: /scan, 
    marking: true, 
    clearing: true
    }

global_costmap_params.yaml

global_costmap:
  global_frame: map
  robot_base_frame: base_footprint
  static_map: true
  update_frequency: 1.0
  publish_frequency: 1.0
  transform_tolerance: 1.0

recovery_behaviors:
  - name: 'conservative_reset'
    type: 'clear_costmap_recovery/ClearCostmapRecovery'
  - name: 'rotate_recovery'
    type: 'rotate_recovery/RotateRecovery'
  - name: 'aggressive_reset'
    type: 'clear_costmap_recovery/ClearCostmapRecovery'

conservative_reset:
  reset_distance: 2.0
  layer_names: ["obstacle_layer"]

aggressive_reset:
  reset_distance: 0.0
  layer_names: ["obstacle_layer"]

local_costmap_params.yaml

local_costmap:
  global_frame: odom
  robot_base_frame: base_footprint
  static_map: false
  rolling_window: true
  width: 3.0
  height: 3.0
  update_frequency: 10.0
  publish_frequency: 10.0
  transform_tolerance: 1.0

6 recovery_behaviors

应急机制,在导航进行停滞时,尝试刷新周围障碍物的信息,重新进行全局路径规划。

recovery_behaviors:
  - name: 'conservative_reset'
    type: 'clear_costmap_recovery/ClearCostmapRecovery'
  - name: 'rotate_recovery'
    type: 'rotate_recovery/RotateRecovery'
  - name: 'aggressive_reset'
    type: 'clear_costmap_recovery/ClearCostmapRecovery'

7局部路径规划算法

更改launch文件中的以下代码即可更换算法

        <param name="base_local_planner" value="wpbh_local_planner/WpbhLocalPlanner" />

DWA测试

<launch>

    <include file="$(find why_simulation)/launch/why_robocup.launch"/>

    <node pkg="move_base" type="move_base" name="move_base">
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find why_simulation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find why_simulation)/config/local_costmap_params.yaml" command="load" />
        <param name="base_global_planner" value="global_planner/GlobalPlanner" /> 
        <!-- <param name="GlobalPlanner/use_dijkstra" value="false" />  -->
        <!-- <param name="GlobalPlanner/use_grid_path" value="true" />  -->
        
        <!-- DWA -->
        <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
        <rosparam file="$(find why_simulation)/config/dwa_local_planner_params.yaml" command="load" />

    </node>

    <node pkg="map_server" type="map_server" name="map_server" args="$(find why_simulation)/maps/map.yaml"/>

    <node pkg="amcl" type="amcl" name="amcl"/>

    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find why_simulation)/rviz/nav.rviz"/>

</launch>

导航结果可以看过许多白色的候选路径,绿色为最优路线。

dwa_local_planner_params.yaml

DWAPlannerROS:
  # 速度参数
  max_vel_x: 0.3      # 最大x方向速度
  min_vel_x: -0.05    # 最小x方向速度(设置负数将会允许倒车)
  max_vel_y: 0.0      # 差分驱动机器人的最大y方向速度为 0.0
  min_vel_y: 0.0      # 差分驱动机器人的最小y方向速度为 0.0
  max_vel_trans: 0.3  # 最大平移速度
  min_vel_trans: 0.01 # 最小平移速度(建议不要设置为 0.0 )
  trans_stopped_vel: 0.1  # 当平移速度小于这个值,就让机器人停止
  acc_lim_trans: 2.5      # 最大平移加速度
  acc_lim_x: 2.5          # x方向的最大加速度上限
  acc_lim_y: 0.0          # y方向的加速度上限(差分驱动机器人应该设置为 0.0 )
  
  max_vel_theta: 1.0      # 最大旋转速度,略小于基座的功能
  min_vel_theta: -0.01    # 当平移速度可以忽略时的最小角速度
  theta_stopped_vel: 0.1  # 当旋转速度小于这个值,就让机器人停止
  acc_lim_theta: 6.0      # 旋转的加速度上限

  # 目标容差参数
  yaw_goal_tolerance: 0.1         # 目标航向容差
  xy_goal_tolerance: 0.05         # 目标xy容差
  latch_xy_goal_tolerance: false  # 到达目标容差范围后,停止移动,只旋转调整航向

  # 向前模拟参数
  sim_time: 1.7       # 模拟时间,默认值 1.7
  vx_samples: 3       # x方向速度采样数,默认值 3
  vy_samples: 1       # 差分驱动机器人y方向速度采样数,只有一个样本
  vtheta_samples: 20  # 旋转速度采样数,默认值 20

  # 轨迹评分参数
  path_distance_bias: 32.0  # 靠近全局路径的权重,默认值 32.0
  goal_distance_bias: 24.0  # 接近导航目标点的权重,默认值 24.0
  occdist_scale: 0.01       # 控制器避障的权重,默认值 0.01
  forward_point_distance: 0.325 # 从机器人到评分点的位置,默认值 0.325
  stop_time_buffer: 0.2     # 在碰撞前机器人必须停止的时间长度,留出缓冲空间,默认值 0.2
  scaling_speed: 0.25       # 缩放机器人速度的绝对值,默认值 0.25
  max_scaling_factor: 0.2   # 机器人足迹在高速时能缩放的最大系数,默认值 0.2

  # 防振动参数
  oscillation_reset_dist: 1.05 # 重置振动标志前需要行进的距离,默认值 0.05

  # 辅助调试选项
  publish_traj_pc : true      # 是否在 RViz 里发布轨迹
  publish_cost_grid_pc: true  # 是否在 RViz 里发布代价网格
  global_frame_id: odom       # 基础坐标系

  # 差分驱动机器人配置
  holonomic_robot: false # 是否全向移动机器人

在线调参工具

rosrun rqt_reconfigure rqt_reconfigure

TEB测试

<launch>

    <include file="$(find why_simulation)/launch/why_robocup.launch"/>

    <node pkg="move_base" type="move_base" name="move_base">
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find why_simulation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find why_simulation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find why_simulation)/config/local_costmap_params.yaml" command="load" />
        <param name="base_global_planner" value="global_planner/GlobalPlanner" /> 
        <!-- <param name="GlobalPlanner/use_dijkstra" value="false" />  -->
        <!-- <param name="GlobalPlanner/use_grid_path" value="true" />  -->
        
        <!-- DWA -->
        <!-- <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" /> -->
        <!-- <rosparam file="$(find why_simulation)/config/dwa_local_planner_params.yaml" command="load" /> -->

        <!-- TEB -->
        <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />
        <rosparam file="$(find why_simulation)/config/teb_local_planner_params.yaml" command="load" />


    </node>

    <node pkg="map_server" type="map_server" name="map_server" args="$(find why_simulation)/maps/map.yaml"/>

    <node pkg="amcl" type="amcl" name="amcl"/>

    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find why_simulation)/rviz/nav.rviz"/>

</launch>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/778360.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【OnlyOffice】桌面应用编辑器,插件开发大赛,等你来挑战

OnlyOffice&#xff0c;桌面应用编辑器&#xff0c;最近版本已从8.0升级到了8.1 从PDF、Word、Excel、PPT等全面进行了升级。随着AI应用持续的火热&#xff0c;OnlyOffice也在不断推出AI相关插件。 因此&#xff0c;在此给大家推荐一下OnlyOffice本次的插件开发大赛。 详细信息…

磁盘就是一个超大的Byte数组,操作系统是如何管理的?

磁盘在操作系统的维度看&#xff0c;就是一个“超大的Byte数组”。 那么操作系统是如何对这块“超大的Byte数组”做管理的呢&#xff1f; 我们知道在逻辑上&#xff0c;上帝说是用“文件”的概念来进行管理的。于是&#xff0c;便有了“文件系统”。那么&#xff0c;文件系统…

深圳晶彩智能ESP32-2432S028R实时观察LVGL9效果

深圳晶彩智能ESP32-2432S028R概述&#xff1a; 深圳晶彩智能出品ESP32-32432S028R为2.8寸彩色屏采用分辨率320x240彩色液晶屏&#xff0c;驱动芯片是ILI9431。板载乐鑫公司出品ESP-WROOM-32&#xff0c;Flash 4M。型号尾部“R”标识电阻膜的感压式触摸屏&#xff0c;驱动芯片是…

以腾讯为例,手把手教你搭建产品帮助中心

一个精心设计的产品帮助中心对于提高用户满意度和体验至关重要。腾讯&#xff0c;作为全球领先的互联网企业&#xff0c;通过其多样化的产品线&#xff08;包括微信、QQ、腾讯游戏、腾讯视频等&#xff09;吸引了亿万用户。下面将以腾讯为例&#xff0c;向您展示如何搭建一个高…

数据库系统原理 | 查询作业1

整理自博主本科《数据库系统原理》专业课自己完成的实验课查询作业&#xff0c;以便各位学习数据库系统概论的小伙伴们参考、学习。 *文中若存在书写不合理的地方&#xff0c;欢迎各位斧正。 专业课本&#xff1a; ​ ———— 本次实验使用到的图形化工具&#xff1a;Heidisql…

进程的控制-ps和kill命令

ps 查看进程信息 部分参数&#xff1a; a : 显示现行终端机下的所有程序&#xff0c;包括其他用户的程序 u: 以用户为主的格式来显示程序状况 x: 显示所有程序&#xff0c;不以 终端机来区分 kill 向指定的进程发送信号 kill 可将指定的信息送至程序。预设的信息为 SIG…

linux下高级IO模型

高级IO 1.高级IO模型基本概念1.1 阻塞IO1.2 非阻塞IO1.3 信号驱动IO1.4 IO多路转接1.5 异步IO 2. 模型代码实现2.1 非阻塞IO2.2 多路转接-selectselect函数介绍什么才叫就绪呢&#xff1f;demoselect特点 2.3 多路转接-pollpoll函数介绍poll优缺点demo 2.4 多路转接-epoll&…

24西安电子科技大学马克思主义学院—考研录取情况

01、马克思主义学院各个方向 02、24马克思主义学院近三年复试分数线对比 PS&#xff1a;马院24年院线相对于23年院线增加15分&#xff0c;反映了大家对于马克思主义理论学习与研究的热情高涨&#xff0c;也彰显了学院在人才培养、学科建设及学术研究等方面的不断进步与成就。 6…

集成学习(一)Bagging

前边学习了&#xff1a;十大集成学习模型&#xff08;简单版&#xff09;-CSDN博客 Bagging又称为“装袋法”&#xff0c;它是所有集成学习方法当中最为著名、最为简单、也最为有效的操作之一。 在Bagging集成当中&#xff0c;我们并行建立多个弱评估器&#xff08;通常是决策…

限时免费!国产Sora快手可灵Web网页端及全新功能上线!国货之光!

大家好&#xff0c;我是程序员X小鹿&#xff0c;前互联网大厂程序员&#xff0c;自由职业2年&#xff0c;也一名 AIGC 爱好者&#xff0c;持续分享更多前沿的「AI 工具」和「AI副业玩法」&#xff0c;欢迎一起交流~ 快手可灵&#xff08;Kling&#xff09;这回是真的出息了&…

DP:二维费用背包问题

文章目录 &#x1f3b5;二维费用背包问题&#x1f3b6;引言&#x1f3b6;问题定义&#x1f3b6;动态规划思想&#x1f3b6;状态定义和状态转移方程&#x1f3b6;初始条件和边界情况 &#x1f3b5;例题&#x1f3b6;1.一和零&#x1f3b6;2.盈利计划 &#x1f3b5;总结 &#x1…

身体(body)的觉醒:如果你贪婪,给你整个宇宙都不够

佛&#xff0c;是一个梵文的汉语音译词&#xff0c;指觉醒者。 何谓觉醒&#xff1f;什么的觉醒&#xff1f;其实很简单&#xff0c;就是身体的觉醒。 佛的另一个名字&#xff0c;叫菩提&#xff0c;佛就是菩提&#xff0c;菩提老祖&#xff0c;就是佛祖。 一、body&#xff…

跟《经济学人》学英文:2024年07月06日这期:Finishing schools for the age of TikTok

Finishing schools for the age of TikTok Unsure how to be polite at work? Ask a digital etiquette guru 不确定如何在工作中保持礼貌&#xff1f;请教一位数字礼仪大师 “Finishing schools” 是指专门为年轻女性提供礼仪、社交技巧、文化修养等教育的学校&#xff0c;…

WordPress网站添加插件和主题时潜在危险分析

WordPress 最初只是一个简单的博客软件&#xff0c;现在据估计为全球前 1000 万个网站中的 30% 提供支持。WordPress受欢迎的因素之一是可以轻松创建插件和主题来扩展它并提供比默认设置更多的功能。 目前&#xff0c;WordPress 网站列出了 56,000 多个插件以及数千个主题。插件…

【刷题汇总--大数加法、 链表相加(二)、大数乘法】

C日常刷题积累 今日刷题汇总 - day0061、大数加法1.1、题目1.2、思路1.3、程序实现 2、 链表相加(二)2.1、题目2.2、思路2.3、程序实现 3、大数乘法3.1、题目3.2、思路3.3、程序实现 4、题目链接 今日刷题汇总 - day006 1、大数加法 1.1、题目 1.2、思路 读完题,明白大数相加…

【C++干货基地】C++模板深度解析:进阶技巧与高级特性掌握(按需实例化、全特化与偏特化)文末送书

&#x1f3ac; 鸽芷咕&#xff1a;个人主页 &#x1f525; 个人专栏: 《C干货基地》《粉丝福利》 ⛺️生活的理想&#xff0c;就是为了理想的生活! 引入 哈喽各位铁汁们好啊&#xff0c;我是博主鸽芷咕《C干货基地》是由我的襄阳家乡零食基地有感而发&#xff0c;不知道各位的…

带你解刨自动化测试框架详细总结

自动化测试框架概念 自动化测试框架是一个集成体系&#xff0c;这个体系中包含测试功能的函数库、测试数据源、测试对象以及可重用的模块。 框架&#xff08;framework&#xff09;是一个框子——指其约束性&#xff0c;也是一个架子——指其支撑性。是一个基本概念上的结构&…

go zero入门

一、goctl安装 goctl 是 go-zero 的内置脚手架&#xff0c;可以一键生成代码、文档、部署 k8s yaml、dockerfile 等。 # Go 1.16 及以后版本 go install github.com/zeromicro/go-zero/tools/goctllatest检查是否安装成功 $ goctl -v goctl version 1.6.6 darwin/amd64vscod…

String类对象比较:==和equals的具体细节

public class test {public static void main(String[] args) {String name1 "zzz";String name2 "zzz";String name3 new String("zzz");// hashCode() 方法&#xff1a;基于字符串的内容计算哈希值&#xff0c;因此内容相同的字符串对象其 …

macOS查看系统日志的方法

1、command空格键打开搜索框&#xff0c;输入‘控制台’并打开 2、选择日志报告&#xff0c;根据日期打开自己需要的文件就可以