前提是已经在ubuntu20.04上完成了ROS Noetic的安装
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
mkdir catkin_turtlebot3
cd catkin_turtlebot3
mkdir src
cd src
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ..
catkin_make
若git超时,可以尝试复制地址在浏览器打开下载,或下载我上传的资源
turtlebot3-master.zip-Ubuntu文档类资源-CSDN下载
turtlebot3_msgs-master.zip-Ubuntu文档类资源-CSDN下载
turtlebot3_simulations-master.zip-Ubuntu文档类资源-CSDN下载
为工作环境添加环境声明:
echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
echo "source ~/catkin_turtlebot3/devel/setup.bash" >> ~/.bashrc
测试环境配置是否成功
echo $ROS_PACKAGE_PATH
env | grep TURTLEBOT3
若两个命令出现对应的结果,则环境配置基本成功。
roslaunch turtlebot3_fake turtlebot3_fake.launch
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
roslaunch turtlebot3_gazebo turtlebot3_world.launch
roslaunch turtlebot3_gazebo turtlebot3_world.launch
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
rosrun map_server map_saver -f ~/map
roslaunch turtlebot3_gazebo turtlebot3_world.launch
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml
map_file:后面接上你存放地图的位置。
1.2D Pose Estimate
这个按键是控制放置小车初始位置的
2.2D Nav Goal
这个按键是控制小车的目的位置的
配置好起点与终点,小车会自动规划路径到达目标点。