ROS 自主构图 使用turtlebot3仿真gmapping 学习记录

写在前面

Ros版本是ubuntu20.04上完成了ROS Noetic
参考
http://wiki.ros.org/explore_lite
https://blog.csdn.net/hanshuning/article/details/58143248

这个软件包提供了贪婪的前沿探索。当节点运行时,机器人将贪婪地探索其环境,直到找不到边界。移动命令将被发送到move_base。
与类似的软件包不同,explore_lite不创建自己的costmap,这使得配置更容易,效率更高(资源更轻)。Node只需订阅nav_msgs/OccupencyGrid消息。机器人移动命令被发送到移动基础节点。
可以在未遍历的地图上操作
先看效果 觉得不好就没必要看下面了

ROS 自主构图 使用turtlebot3仿真gmapping 学习记录

========================================================================================================================================================================================================================================================================================================================================================================================================================================++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

一、虚拟环境配置

1.相关功能包的配置

sudo apt install ros-noetic-gazebo-ros-pkgs ros-noetic-gazebo-ros-control
sudo apt-get install ros-noetic-turtlebot-*
sudo apt install ros-noetic-gmapping
sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc ros-noetic-rgbd-launch ros-noetic-depthimage-to-laserscan ros-noetic-rosserial-arduino ros-noetic-rosserial-python ros-noetic-rosserial-server ros-noetic-rosserial-client ros-noetic-rosserial-msgs ros-noetic-amcl ros-noetic-map-server ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro  ros-noetic-compressed-image-transport ros-noetic-rqt-image-view ros-noetic-gmapping ros-noetic-navigation  ros-noetic-interactive-markers rviz

2.工作环境的建立

mkdir catkin_turtlebot3
cd catkin_turtlebot3
mkdir src
cd src 
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
cd ..
catkin_make

为工作环境添加变量

echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
echo "source ~/catkin_turtlebot3/devel/setup.bash" >> ~/.bashrc

然后检查是否配置好了

echo $ROS_PACKAGE_PATH
env | grep TURTLEBOT3

这样就差不多了
请添加图片描述

二、利用Gazebo和RViz进行自主建图

开启SLAM仿真

roslaunch turtlebot3_slam tur3_gmapping.launch 

里面launch文件是根据自己的工作环境来修改的

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="configuration_basename" default="turtlebot3_lds_2d.lua"/>
  <arg name="set_base_frame" default="base_footprint"/>
  <arg name="set_odom_frame" default="odom"/>
  <arg name="set_map_frame"  default="map"/>
  <!-- gazebo -->
  <include file="$(find turtlebot3_gazebo)/launch/turtlebot3_world.launch" />
  <!-- Gmapping -->
  <node pkg="gmapping" type="slam_gmapping" name="turtlebot3_slam_gmapping" output="screen">
    <param name="base_frame" value="$(arg set_base_frame)"/>
    <param name="odom_frame" value="$(arg set_odom_frame)"/>
    <param name="map_frame"  value="$(arg set_map_frame)"/>
    <rosparam command="load" file="$(find turtlebot3_slam)/config/gmapping_params.yaml" />
  </node>
  <!-- Start move_base  -->
  <include file="$(find turtlebot3_navigation)/launch/move_base.launch" />
  <!--  rviz  -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot3_gazebo)/rviz/turtlebot3_gazebo_model.rviz" required="true" />
  
</launch>

然后其动自主探索的lanch就行了

roslaunch explore_lite explore.launch

这个软件包提供了贪婪的前沿探索。当节点运行时,机器人将贪婪地探索其环境,直到找不到边界,要是没有边界的地图如何探索,比如一定开阔的地面?
**

为之奈何?

**

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值