3.1 Hector_mapping初体验

1.初体验

下载依赖

复制代码
sudo apt install ros-noetic-hector-mapping

构建仿真环境

复制代码
roslaunch wpr_simulation wpb_stage_slam.launch 

运行SLAM

复制代码
rosrun hector_mapping hector_mapping 

再新建终端

复制代码
rosrun rviz rviz

注意终端管理

新建终端,打开操作杆

复制代码
osrun rqt_robot_steering rqt_robot_steering 

可视化效果

2.launch启动

新建SLAM包

复制代码
catkin_create_pkg slam_pkg roscpp rospy std_msgs

新建launch'文件,键入以下代码

复制代码
<launch>

<includev file="$(find wpr_simulation)/launch/wpb_stage_slam.launch"/>
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping"/>
<node pkg="rviz" type="rviz" name="rviz"/>
<node pkg="rqt_robot_steering" type="rqt_robot_steering" name="rqt_robot_steering"/>

</launch>

保存后编译,并运行命令

复制代码
roslaunch slam_pkg hector.launch

使用配置文件启动rviz

复制代码
rosrun rviz rviz -d /home/wisdom/catkin_ws/src/slam_pkg/rviz/slam.rviz

或者直接launch文件,增加rviz参数args

复制代码
<launch>

<include file="$(find wpr_simulation)/launch/wpb_stage_slam.launch"/>
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping"/>
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find slam_pkg)/rviz/slam.rviz"/>
<node pkg="rqt_robot_steering" type="rqt_robot_steering" name="rqt_robot_steering"/>

</launch>

实现一条指令实现所有平台加载对应参数启动

3.参数设置

复制代码
<launch>

<include file="$(find wpr_simulation)/launch/wpb_stage_slam.launch"/>
<node pkg="hector_mapping" type="hector_mapping" name="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 pkg="rviz" type="rviz" name="rviz" args="-d $(find slam_pkg)/rviz/slam.rviz"/>
<node pkg="rqt_robot_steering" type="rqt_robot_steering" name="rqt_robot_steering"/>

</launch>

文件结构

相关推荐
tokepson1 小时前
Mysql下载部署方法备份(Windows/Linux)
linux·服务器·windows·mysql
nbsaas-boot2 小时前
SQL Server 存储过程开发规范(公司内部模板)
java·服务器·数据库
C_心欲无痕3 小时前
Dockerfile:构建 Docker 镜像
运维·docker·容器
zz_nj3 小时前
工作的环境
linux·运维·服务器
极客先躯3 小时前
如何自动提取Git指定时间段的修改文件?Win/Linux双平台解决方案
linux·git·elasticsearch
C_心欲无痕4 小时前
nginx - 实现域名跳转的几种方式
运维·前端·nginx
suijishengchengde4 小时前
****LINUX时间同步配置*****
linux·运维
willhuo4 小时前
基于xray的匿名、授权、IP白名单代理访问研究
服务器·网络·tcp/ip
幻云20104 小时前
AI自动化编排:从入门到精通(基于Dify构建AI智能系统)
运维·人工智能·自动化
qiuqyue4 小时前
基于虹软Linux Pro SDK的多路RTSP流并发接入、解码与帧级处理实践
linux·运维·网络