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: maprobot_base_frame: base_footprintstatic_map: trueupdate_frequency: 1.0publish_frequency: 1.0transform_tolerance: 1.0recovery_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.0layer_names: ["obstacle_layer"]aggressive_reset:reset_distance: 0.0layer_names: ["obstacle_layer"]

local_costmap_params.yaml

local_costmap:global_frame: odomrobot_base_frame: base_footprintstatic_map: falserolling_window: truewidth: 3.0height: 3.0update_frequency: 10.0publish_frequency: 10.0transform_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.0min_vel_y: 0.0      # 差分驱动机器人的最小y方向速度为 0.0max_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.7vx_samples: 3       # x方向速度采样数,默认值 3vy_samples: 1       # 差分驱动机器人y方向速度采样数,只有一个样本vtheta_samples: 20  # 旋转速度采样数,默认值 20# 轨迹评分参数path_distance_bias: 32.0  # 靠近全局路径的权重,默认值 32.0goal_distance_bias: 24.0  # 接近导航目标点的权重,默认值 24.0occdist_scale: 0.01       # 控制器避障的权重,默认值 0.01forward_point_distance: 0.325 # 从机器人到评分点的位置,默认值 0.325stop_time_buffer: 0.2     # 在碰撞前机器人必须停止的时间长度,留出缓冲空间,默认值 0.2scaling_speed: 0.25       # 缩放机器人速度的绝对值,默认值 0.25max_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.mzph.cn/pingmian/38894.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

系统运行缓慢CPU飙高等问题的排查思路

系统运行缓慢和CPU飙高问题的排查思路 当系统运行缓慢或CPU使用率飙高时&#xff0c;可能有多种原因导致这一现象。以下是一些排查思路和方法&#xff1a; 1. 检查系统资源使用情况 - 任务管理器&#xff08;Windows&#xff09;或活动监视器&#xff08;Mac&#xff09;或top…

postgresql搭建

搭建postgresql-11.3&#xff0c;和客户端工具 1&#xff0c;准备对应的包&#xff0c;右键直接下一步安装完即可&#xff0c; 将postgresql设置为本地服务&#xff0c;方便启动&#xff0c; 2&#xff0c;用对应客户端软件连接&#xff0c;新建一个数据库controlDB 新建用户…

无偏归一化自适应心电ECG信号降噪方法(MATLAB)

心电信号作为一种生物信号&#xff0c;含有大量的临床应用价值的信息&#xff0c;在现代生命医学研究中占有重要的地位。但心电信号低频、低幅值的特点&#xff0c;使其在采集和传输的过程中经常受到噪声的干扰&#xff0c;使心电波形严重失真&#xff0c;从而影响后续的病情分…

你还不会买智能猫砂盆吗?跟你们详细讲解今年最火的智能猫砂盆!

智能猫砂盆的坑&#xff0c;想必有很多养猫家庭都踩过吧。自己买回来的机器&#xff0c;不是空间不够大&#xff0c;导致猫咪拉到外面去&#xff0c;就是铲不干净&#xff0c;还得自己进行二次清理&#xff0c;搞得这个智能猫砂盆白买了。那如果我们想要购买合适自己家猫咪的智…

数据链路层分析

文章目录 前言一、数据链路层概述二、终端之间的通信三、帧格式1.Ethernet_II型2.IEEE 802.3 四、MTU分析五、数据帧的传输1.MAC地址2.单播3.广播4.组播5.数据帧的收发 前言 网络中传输数据需要定义并遵循一些标准&#xff0c;以太网是根据IEEE802.3标准来管理和控制数据帧的&…

sqlserver开启CDC

1、背景 由于需要学习flink cdc&#xff0c;并且数据选择sqlserver&#xff0c;所以这里记录sqlserver的cdc开启操作步骤。 2、基础前提 官方介绍地址&#xff1a;https://learn.microsoft.com/zh-cn/sql/relational-databases/track-changes/enable-and-disable-change-dat…

隐式转换的魔法:Scala中隐式转换的深度解析

隐式转换的魔法&#xff1a;Scala中隐式转换的深度解析 在Scala编程语言的丰富特性中&#xff0c;隐式转换是一个强大而微妙的工具。它允许开发者在不改变现有代码的情况下&#xff0c;扩展或修改类的行为。本文将深入探讨Scala中隐式转换的工作原理&#xff0c;并通过详细的代…

如何优化前端性能:提高网页加载速度的实用技巧

我们在前端开发中&#xff0c;性能优化是提高用户体验的关键因素。网页加载速度直接影响用户的满意度和留存率。本文将介绍几种优化前端性能的实用方法&#xff0c;帮助你提高网页加载速度。 问题描述 &#xff1a; 首先前端性能优化涉及多个方面&#xff0c;包括减少HTTP请…

Java命名规范:

Java命名规范&#xff1a; 大驼峰命名法/帕斯卡命名法&#xff1a; ​ 作用&#xff1a;类名、接口名 ​ 规则&#xff1a;每个单词首字母大写 ​ ps&#xff1a; ​ public class HelloWorld{} ​ 小驼峰命名法&#xff1a; ​ 作用&#xff1a;方法名、变量名 ​ 规则&am…

专为运维工程师设计!阿里藏经阁出品的Python实战手册被我搞来了

Python 可能是极少数既简单又强大的编程语言中的一种。更重要的是&#xff0c;用它来编程是非常快乐的事。 今天给小伙伴们分享的是阿里“藏经阁”出品的专门给运维工程师设计的Python实战手册 废话不多说&#xff0c;下面把内容展示给大家 01 Python快速回顾 02 Python脚本…

【大模型】基于ChatGLM进行微调及应用 [更新中......]

文章目录 一、前言二、说明2.1 代码结构2.2 依赖包版本 三、启动对话演示3.1 命令行交互 cli_demo.py3.2 网页交互 web_demo.py 四、微调模型4.1 基于 P-Tuning v2 微调模型4.1.1 软件依赖4.1.2 下载数据集4.1.3 下载模型文件4.1.4 操作步骤 4.2 基于 Full Parameter 微调模型4…

洛谷P10677题解

题目描述 给一个 n m n\times m nm 的字符矩阵&#xff0c;有些位置有障碍&#xff08;记为字符 #&#xff09;&#xff0c;需要在矩阵上找出一条起始点任意的路径&#xff08;可以重复经过某个格子&#xff09;&#xff0c;使得字典序最大。 可以证明答案一定是有限的或者…

从进程到协程,浅谈Java提高CPU利用率的发展

综合CPU利用率来讲,计算机远古时期,为提高CPU利用率,有以下概念 串行进程->并行进程->线程->线程池>->虚拟线程(协程) 一,串行进程, 早期的操作系统对任务调度,往往从最简单的实现开端,串型进程意思是对分配的一个任务,其任务能百分百占用CPU,哪怕…

前程无忧滑块

声明(lianxi a15018601872) 本文章中所有内容仅供学习交流使用&#xff0c;不用于其他任何目的&#xff0c;抓包内容、敏感网址、数据接口等均已做脱敏处理&#xff0c;严禁用于商业用途和非法用途&#xff0c;否则由此产生的一切后果均与作者无关&#xff01; 前言(lianxi …

OpenCV学习之cv2.addWeighted函数

OpenCV学习之cv2.addWeighted函数 一、简介 在图像处理和计算机视觉中&#xff0c;图像融合是一种常见的操作。cv2.addWeighted 函数是 OpenCV 提供的用于对两幅图像进行加权融合的函数&#xff0c;通过对图像像素值进行线性加权和偏移&#xff0c;可以实现图像的混合和过渡效…

日期时间显示网页

SweetOrange_Clock &#x1f558; 一、简介 1、这个项目包括一个HTML文件&#xff0c;其中包含页面的样式和脚本。 2、页面以优雅的黑白配色为主题&#xff0c;突出了实用性和视觉冲击力&#xff0c;使得显示内容在视觉上更为突出和易于阅读。 3、这是一个日期时间显示器。通…

高通源代码版本ADK工具版本源代码release版本MDE版本介绍

0 Preface/Foreword 1 版本介绍 高通代码存放在chipcode中&#xff0c;网址URL&#xff1a;Chipcode 1.1 高通源代码版本 Bluetooth Audo芯片的高通源代码版本号&#xff08;类似于分类的类名&#xff09;&#xff1a;ADK.SRC.1.0 &#xff08;最新qcc307x系列及之后的芯片如…

SQL中Order by详解

在 MySQL 中&#xff0c;ORDER BY 语句用于对查询结果进行排序。 语法&#xff1a; SELECT column1, column2,... FROM table_name ORDER BY column_name [ASC | DESC];以下是对其主要部分的详细解释&#xff1a; column_name &#xff1a;指定要依据其进行排序的列名。 ASC…

Pycharm安装依赖

1. IDE集成的错误解决 鼠标悬停,点击 install 2. 配置环境 ctrlalts 3. 终端运行pip (要求有先有一个pip) 最好用最简单

NSE and KGE

NSE&#xff08;Nash-Sutcliffe Efficiency&#xff09;&#xff1a; 解释&#xff1a;NSE 是衡量水文模型模拟结果与观测值之间拟合程度的指标。它计算模拟值与观测值之间的均方误差&#xff0c;并将其与观测值的方差进行比较。NSE 的取值范围为-∞至 1&#xff0c;值越接近 1…