当前位置: 首页 > news >正文

ros1仿真导航机器人 hector_mapping gmapping

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

1 hector_mapping

建图过程

(1)gazebo仿真

roslaunch why_simulation why_slam.launch 

<launch><!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched --><include file="$(find gazebo_ros)/launch/empty_world.launch"><arg name="world_name" value="$(find why_simulation)/worlds/slam_simple.world"/><arg name="paused" value="false"/><arg name="use_sim_time" value="true"/><arg name="gui" value="true"/><arg name="recording" value="false"/><arg name="debug" value="false"/></include><!-- Spawn a robot into Gazebo --><node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/wpb_home.model -urdf -x -0.0 -y -0.0 -model wpb_home" /><!-- tf --><arg name="model" default="$(find why_simulation)/models/wpb_home.model"/><param name="robot_description" command="$(find xacro)/xacro $(arg model)" /><node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /><node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" /></launch>

(2)启动建图节点

rosrun hector_mapping hector_mapping

(3)rviz

rviz

将所需要的模块添加进去之后,保存为hector.rviz文件。

(4)控制机器人运动

rosrun rqt_robot_steering rqt_robot_steering

建图结果

launch

新建一个launch文件,将以上四条指令添加到launch文件中。

<launch><include file="$(find why_simulation)/launch/why_slam.launch"/><node name="hector_mapping" pkg="hector_mapping" type="hector_mapping" /><node name="rviz" pkg="rviz" type="rviz" args="-d $(find why_simulation)/rviz/hector.rviz"/><node name="rqt_robot_steering" pkg="rqt_robot_steering " type="rqt_robot_steering " /></launch>

查找参数

ROS Indexa community-maintained index of robotics softwareicon-default.png?t=N7T8https://index.ros.org/

(1)搜索hector_mapping

(2)选择Website

即可查看到有哪些参数可以设置

设置参数

<launch><include file="$(find why_simulation)/launch/why_slam.launch"/><node name="hector_mapping" pkg="hector_mapping" type="hector_mapping" output="screen"><param name="map_update_distance_thresh" value="0.1"/><param name="map_update_angle_thresh " value="0.1"/><param name="map_pub_period " value="0.1"/></node><node name="rviz" pkg="rviz" type="rviz" args="-d $(find why_simulation)/rviz/hector.rviz"/><node name="rqt_robot_steering" pkg="rqt_robot_steering " type="rqt_robot_steering " /></launch>

2 gmapping

建图过程

(1)gazebo环境

roslaunch why_simulation why_robocup.launch 

<launch><!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched --><include file="$(find gazebo_ros)/launch/empty_world.launch"><arg name="world_name" value="$(find why_simulation)/worlds/why_robocup.world"/><arg name="paused" value="false"/><arg name="use_sim_time" value="true"/><arg name="gui" value="true"/><arg name="recording" value="false"/><arg name="debug" value="false"/></include><!-- Spawn the objects into Gazebo --><node name="bed" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/bed.model -x 5.0 -y -3.9 -z 0 -Y 3.14159 -urdf -model bed" /><node name="sofa" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/sofa.model -x -1.0 -y -3.9 -z 0 -Y 1.57 -urdf -model sofa" /><node name="tea_table" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/tea_table.model -x -2.1 -y -2.2 -z 0 -Y 1.57 -urdf -model tea_table" /><node name="bookshelft" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/bookshelft.model -x 2.0 -y -0.55 -z 0 -Y -1.57 -urdf -model bookshelft" /><node name="kitchen_table" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/table.model -x -3.5 -y 3.7 -z 0 -Y 1.57 -urdf -model kitchen_table" /> <node name="cupboard_0" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/cupboard.model -x -2.0 -y 0.7 -z 0 -Y 1.57 -urdf -model cupboard_0" /><node name="cupboard_1" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/cupboard.model -x -1.3 -y 3.7 -z 0 -Y -1.57 -urdf -model cupboard_1" /> <node name="dinning_table_0" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/table.model -x 1.5 -y 1.5 -z 0 -Y 1.57 -urdf -model dinning_table_0" /><node name="dinning_table_1" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/table.model -x 1.5 -y 2.0 -z 0 -Y 1.57 -urdf -model dinning_table_1" /><node name="dinning_table_2" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/table.model -x 2.7 -y 1.5 -z 0 -Y 1.57 -urdf -model dinning_table_2" /><node name="dinning_table_3" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/table.model -x 2.7 -y 2.0 -z 0 -Y 1.57 -urdf -model dinning_table_3" /><node name="chair_0" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/chair.model -x 1.5 -y 1.2 -z 0 -Y 1.57 -urdf -model chair_0" /><node name="chair_1" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/chair.model -x 1.5 -y 2.3 -z 0 -Y -1.57 -urdf -model chair_1" /><node name="chair_2" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/chair.model -x 2.7 -y 1.2 -z 0 -Y 1.57 -urdf -model chair_2" /><node name="chair_3" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/chair.model -x 2.7 -y 2.3 -z 0 -Y -1.57 -urdf -model chair_3" /><!-- Spawn a robot into Gazebo --><node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/wpb_home.model -urdf -x 0.0 -y -0.0 -model wpb_home" /><!-- tf --><arg name="model" default="$(find why_simulation)/models/wpb_home.model"/><param name="robot_description" command="$(find xacro)/xacro $(arg model)" /><node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /><node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" /><!-- lidar filter--><node pkg="why_simulation" type="lidar_filter" name="lidar_filter" /></launch>

(2)启动gmapping节点

rosrun gmapping slam_gmapping

(3)rviz

rviz

保存成gmapping.rviz

(4)控制机器人移动

rosrun why_simulation keyboard_vel_ctrl

建图结果

launch

新建launch文件gmapping.launch,接上述指令添加到launch文件里

<launch><include file="$(find why_simulation)/launch/why_robocup.launch"/><node pkg="gmapping" type="slam_gmapping" name="slam_gmapping"/><node name="rviz" pkg="rviz" type="rviz" args="-d $(find why_simulation)/rviz/gmapping.rviz"/><node name="why_simulation" pkg="keyboard_vel_ctrl " type="keyboard_vel_ctrl " /></launch>

设置参数

<launch><include file="$(find why_simulation)/launch/why_robocup.launch"/><node pkg="gmapping" type="slam_gmapping" name="slam_gmapping"><param name="map_update_interval" value="0.5"/><param name="linearUpdate " value="0.1"/></node><node name="rviz" pkg="rviz" type="rviz" args="-d $(find why_simulation)/rviz/gmapping.rviz"/><node name="why_simulation" pkg="keyboard_vel_ctrl " type="keyboard_vel_ctrl " /></launch>

3保存地图

rosrun map_server map_saver -f map

4加载地图

roscore

rosrun map_server map_server map.yaml

rviz

5 对比

hector_mapping不使用里程计,长直的路径存在建图错误,gmapping使用里程计。

相关文章:

ros1仿真导航机器人 hector_mapping gmapping

仅为学习记录和一些自己的思考&#xff0c;不具有参考意义。 1 hector_mapping 建图过程 &#xff08;1&#xff09;gazebo仿真 roslaunch why_simulation why_slam.launch <launch><!-- We resume the logic in empty_world.launch, changing only the name of t…...

嵌入式实验---实验五 串口数据接收实验

一、实验目的 1、掌握STM32F103串口数据接收程序设计流程&#xff1b; 2、熟悉STM32固件库的基本使用。 二、实验原理 1、STM32F103R6能通过查询中断方式接收数据&#xff0c;每接收到一个字节&#xff0c;立即向对方发送一个相同内容的字节&#xff0c;并把该字节的十六进…...

ubuntu 22.04下编译安装glog共享库

笔者是完美主义者&#xff0c;在编译opencv4.9时,有个有关glog的warn&#xff0c;就下载编译google的glog库并把它编译成shared libaray。重新编译opencv4.9时&#xff0c;该warn解除。现把编译安装glog过程记录&#xff0c;以备后查。 以下操作全程以root身份或sudo执行。 cd…...

Linux环境安装配置nginx服务流程

Linux环境的Centos、麒麟、统信操作系统安装配置nginx服务流程操作&#xff1a; 1、官网下载 下载地址 或者通过命令下载 wget http://nginx.org/download/nginx-1.20.2.tar.gz 2、上传到指定的服务器并解压 tar -zxvf nginx-1.20.1.tar.gzcd nginx-1.20.1 3、编译并安装到…...

设计模式-模板模式

简介 模板方法模式是一种行为设计模式&#xff0c;它在父类中定义了一个操作的算法框架&#xff0c;允许子类在不改变算法结构的情况下重定义算法的某些步骤。这种模式是基于继承的&#xff0c;通过抽象类将通用的代码抽取到超类中&#xff0c;同时通过具体类实现或者改写算法…...

物理删除和逻辑删除区别

物理删除和逻辑删除是数据库管理中针对记录删除操作的两种不同方式&#xff0c;它们的主要区别在于数据的实际处理和后续影响&#xff1a; 物理删除&#xff1a; 操作实质&#xff1a;物理删除会将数据记录从数据库表中彻底移除&#xff0c;包括记录所占的磁盘空间都会被释放。…...

C# 警告 warning MSB3884: 无法找到规则集文件“MinimumRecommendedRules.ruleset”

警告 warning MSB3884: 无法找到规则集文件“MinimumRecommendedRules.ruleset” C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.CSharp.CurrentVersion.targets(129,9): warning MSB3884: 无法找到规则集文件“MinimumRe…...

Lua网站开发之文件表单上传

这个代码示例演示如何上传文件或图片&#xff0c;获取上传信息及保存文件到本地。 local fw require("fastweb") local request require("fastweb.request") local response require("fastweb.response") local cjson require("cjson&q…...

千益畅行,旅游卡,如何赚钱?

​ 赚钱这件事情&#xff0c;只有自己努力执行才会有结果。生活中没有幸运二字&#xff0c;每个光鲜亮丽的背后&#xff0c;都是不为人知的付出&#xff01; #旅游卡服务#...

Element-plus点击当前行之后获取数据显示跟随行数据

要实现点击当前行后&#xff0c;在当前行的下方显示数据&#xff0c;可以通过以下步骤来实现&#xff1a; 在表格的行点击事件中获取当前点击行的位置信息。根据位置信息动态计算并设置需要显示数据区域的位置。 下面是一个更新后的示例代码&#xff0c;演示如何在 Element-P…...

Docker与微服务实战2022 尚

Docker与微服务实战2022 尚硅谷讲师:周阳 1. 基础篇(零基小白) 1 1.1. Docker简介 2 1.2. Docker安装 15 1.3. Docker常用命令 29 1.4. Docker镜像 43 1.5. 本地镜像发布到阿里云 50 1.6. 本地镜像发布到私有库 57 1.7. Docker容器数据卷 64 1.8. Docker常规安装简介 …...

Spring @Cacheable缓存注解用法说明

注解Cacheable 是 Spring 框架中用于缓存数据的方法或类的注解。通过使用这个注解&#xff0c;你可以避免重复计算和重复获取数据&#xff0c;从而提高应用程序的性能。 基本用法 引入依赖 确保在你的项目中引入了 Spring Cache 相关的依赖。如果你使用的是 Spring Boot&…...

Redis如何实现主从复制

Redis主从复制包括全量复制和增量复制。主是主服务器&#xff0c;从是从服务器&#xff0c;主服务器(master &#xff09;的数据如果更新了也会同步到从服务器(slave)&#xff0c;一个主服务器可以搭配很多个从服务器&#xff0c;主服务器负责写入&#xff0c;从服务器只能读取…...

正则表达式以及文本三剑客grep、sed、awk

正则表达式匹配的是文本内容&#xff0c;文本三剑客都是针对文本内容。 grep&#xff1a;过滤文本内容 sed&#xff1a;针对文本内容进行增删改查 awk&#xff1a;按行取列 一、grep grep的作用使用正则表达式来匹配文本内容 1、grep选项 -m&#xff1a;匹配几次之后停止…...

HSRP热备份路由协议(VRRP虚拟路由冗余协议)配置以及实现负载均衡

1、相关原理 在网络中&#xff0c;如果一台作为默认网关的三层交换机或者路由器损坏&#xff0c;所有使用该网关为下一跳的主机通信必然中断&#xff0c;即使配置多个默认网关&#xff0c;在不重启终端的情况下&#xff0c;也不能彻底换到新网关。Cisco提出了HSRP热备份路由协…...

不同集成学习算法的比较:随机森林、AdaBoost、XGBoost、LightGBM

好的&#xff0c;我来为您比较一些常见的集成学习算法&#xff0c;并生成表格形式以便于对比&#xff1a; 算法主要思想和特点应用场景并行处理支持稳定性和鲁棒性主要优化策略和技术AdaBoost使用加权投票组合多个弱分类器&#xff0c;逐步提升分类器性能二分类和多分类问题&a…...

【聊聊原子性,中断,以及nodejs中的具体示例】

什么是原子性 从一个例子说起&#xff0c; x &#xff0c;读和写 &#xff0c; 如图假设多线程&#xff0c;线程1和线程2同时操作变量x&#xff0c;进行x的操作&#xff0c;那么由于写的过程中&#xff0c;都会先读一份x数据到cpu的寄存器中&#xff0c;所以这个时候cpu1 和 c…...

常见网络端口号

在网络工程领域&#xff0c;了解和掌握默认端口号是至关重要的。端口号是计算机网络中最基本的概念之 一&#xff0c;用于标识特定的网络服务或应用程序。 1、什么是端口号&#xff1f; 端口号是计算机网络中的一种标识&#xff0c;用于区分不同的网络服务和应用程序。每个端…...

【数值计算库-超长笔记】Python-Mpmath库:高精度数值计算

原文链接&#xff1a;https://www.cnblogs.com/aksoam/p/18279394 更多精彩&#xff0c;关注博客园主页&#xff0c;不断学习&#xff01;不断进步&#xff01; 我的主页 csdn很少看私信&#xff0c;有事请b站私信 博客园主页-发文字笔记-常用 有限元鹰的主页 内容&#xf…...

昇思25天学习打卡营第6天|函数式自动微分

函数式自动微分 相关前置知识复习 深度学习的重点之一是神经网络。而神经网络很重要的一环是反向传播算法&#xff0c;这个算法用于调整神经网络的权重。 反向传播算法 这里举例说明反向传播在做什么。 假设你是一个学生&#xff0c;一次考试过后&#xff0c;你收到了一份老…...

Python爬虫实战:研究MechanicalSoup库相关技术

一、MechanicalSoup 库概述 1.1 库简介 MechanicalSoup 是一个 Python 库,专为自动化交互网站而设计。它结合了 requests 的 HTTP 请求能力和 BeautifulSoup 的 HTML 解析能力,提供了直观的 API,让我们可以像人类用户一样浏览网页、填写表单和提交请求。 1.2 主要功能特点…...

在软件开发中正确使用MySQL日期时间类型的深度解析

在日常软件开发场景中&#xff0c;时间信息的存储是底层且核心的需求。从金融交易的精确记账时间、用户操作的行为日志&#xff0c;到供应链系统的物流节点时间戳&#xff0c;时间数据的准确性直接决定业务逻辑的可靠性。MySQL作为主流关系型数据库&#xff0c;其日期时间类型的…...

MMaDA: Multimodal Large Diffusion Language Models

CODE &#xff1a; https://github.com/Gen-Verse/MMaDA Abstract 我们介绍了一种新型的多模态扩散基础模型MMaDA&#xff0c;它被设计用于在文本推理、多模态理解和文本到图像生成等不同领域实现卓越的性能。该方法的特点是三个关键创新:(i) MMaDA采用统一的扩散架构&#xf…...

Redis数据倾斜问题解决

Redis 数据倾斜问题解析与解决方案 什么是 Redis 数据倾斜 Redis 数据倾斜指的是在 Redis 集群中&#xff0c;部分节点存储的数据量或访问量远高于其他节点&#xff0c;导致这些节点负载过高&#xff0c;影响整体性能。 数据倾斜的主要表现 部分节点内存使用率远高于其他节…...

Yolov8 目标检测蒸馏学习记录

yolov8系列模型蒸馏基本流程&#xff0c;代码下载&#xff1a;这里本人提交了一个demo:djdll/Yolov8_Distillation: Yolov8轻量化_蒸馏代码实现 在轻量化模型设计中&#xff0c;**知识蒸馏&#xff08;Knowledge Distillation&#xff09;**被广泛应用&#xff0c;作为提升模型…...

基于SpringBoot在线拍卖系统的设计和实现

摘 要 随着社会的发展&#xff0c;社会的各行各业都在利用信息化时代的优势。计算机的优势和普及使得各种信息系统的开发成为必需。 在线拍卖系统&#xff0c;主要的模块包括管理员&#xff1b;首页、个人中心、用户管理、商品类型管理、拍卖商品管理、历史竞拍管理、竞拍订单…...

使用LangGraph和LangSmith构建多智能体人工智能系统

现在&#xff0c;通过组合几个较小的子智能体来创建一个强大的人工智能智能体正成为一种趋势。但这也带来了一些挑战&#xff0c;比如减少幻觉、管理对话流程、在测试期间留意智能体的工作方式、允许人工介入以及评估其性能。你需要进行大量的反复试验。 在这篇博客〔原作者&a…...

站群服务器的应用场景都有哪些?

站群服务器主要是为了多个网站的托管和管理所设计的&#xff0c;可以通过集中管理和高效资源的分配&#xff0c;来支持多个独立的网站同时运行&#xff0c;让每一个网站都可以分配到独立的IP地址&#xff0c;避免出现IP关联的风险&#xff0c;用户还可以通过控制面板进行管理功…...

MacOS下Homebrew国内镜像加速指南(2025最新国内镜像加速)

macos brew国内镜像加速方法 brew install 加速formula.jws.json下载慢加速 &#x1f37a; 最新版brew安装慢到怀疑人生&#xff1f;别怕&#xff0c;教你轻松起飞&#xff01; 最近Homebrew更新至最新版&#xff0c;每次执行 brew 命令时都会自动从官方地址 https://formulae.…...

系统掌握PyTorch:图解张量、Autograd、DataLoader、nn.Module与实战模型

本文较长&#xff0c;建议点赞收藏&#xff0c;以免遗失。更多AI大模型应用开发学习视频及资料&#xff0c;尽在聚客AI学院。 本文通过代码驱动的方式&#xff0c;系统讲解PyTorch核心概念和实战技巧&#xff0c;涵盖张量操作、自动微分、数据加载、模型构建和训练全流程&#…...