其他分享
首页 > 其他分享> > ROS-Melodic下 Gazebo+Turtlebot安装

ROS-Melodic下 Gazebo+Turtlebot安装

作者:互联网

上一篇教程:Win10+Ubuntu18.04双系统安装 & ROS Melodic安装

一、Gazebo安装

在终端运行

sudo apt-get install ros-melodic-gazebo-ros-pkgs ros-melodic-ros-control

参考 https://blog.csdn.net/weixin_45839124/article/details/106367520
修改配置文件,在终端运行

sudo gedit ~/.ignition/fuel/config.yaml

url: https://api.ignitionfuel.org

用 # 注释掉

添加

url: https://api.ignitionrobotics.org

修改后如下图所示:

在这里插入图片描述

注:若使用VMWare虚拟机运行Gazebo,需要添加环境变量(若使用双系统则可忽略)

export SVGA_VGPU10=0
echo "export SVGA_VGPU10=0" >> ~/.bashrc

测试Gazebo:

终端运行

roscore

在新的终端运行

rosrun gazebo_ros gazebo

成功启动后界面如下图:

在这里插入图片描述

在实际使用Gazebo过程中,由于Gazebo默认在线加载模型,因此初次启动新地图与模型较慢,可将gazebo模型包复制于~/.gazebo/models 路径(若没有models文件夹则新建)下,

Gazebo模型包下载链接:https://jbox.sjtu.edu.cn/l/iFi6Wq

复制后如下图:

在这里插入图片描述

之后启动Gazebo时会明显加快。

二、Turtlebot包安装

参考 https://www.ncnynl.com/archives/201903/2884.html

a. 安装依赖项
sudo apt-get install ros-melodic-kobuki-*
sudo apt-get install ros-melodic-ecl-streams
sudo apt-get install ros-melodic-bfl
sudo apt-get install ros-melodic-map-server
sudo apt-get install ros-melodic-move-base
sudo apt-get install ros-melodic-amcl
sudo apt-get install ros-melodic-dwa-local-planner
sudo apt-get install libusb-dev
sudo apt-get install libspnav-dev
sudo apt-get install ros-melodic-joystick-drivers
sudo apt-get install bluetooth
sudo apt-get install libbluetooth-dev
sudo apt-get install libcwiid-dev
b. 新建工作空间,准备相关包
mkdir -p ~/turtlebot_ws/src 
cd ~/turtlebot_ws/src 
git clone git://github.com/turtlebot/turtlebot_simulator
git clone git://github.com/turtlebot/turtlebot.git
git clone git://github.com/turtlebot/turtlebot_apps.git
git clone git://github.com/udacity/robot_pose_ekf
git clone git://github.com/ros-perception/depthimage_to_laserscan.git 
git clone git://github.com/yujinrobot/kobuki_msgs.git
git clone git://github.com/yujinrobot/kobuki_desktop.git
git clone git://github.com/ncnynl/turtlebot_viz
git clone git://github.com/turtlebot/turtlebot_create.git
cd kobuki_desktop/
rm -r kobuki_qtestsuite
git clone git://github.com/toeklk/orocos-bayesian-filtering.git
git clone git://github.com/turtlebot/turtlebot_msgs.git
git clone git://github.com/ros-drivers/joystick_drivers.git
c. 复制kobuki和yujin_ocs依赖库到turtlebot_ws/src工作空间下
mkdir -p ~/repos/
cd ~/repos/
git clone git://github.com/yujinrobot/kobuki.git
cp -r kobuki/* ~/turtlebot_ws/src/
git clone git://github.com/yujinrobot/yujin_ocs.git
cp -r yujin_ocs/yocs_cmd_vel_mux/ yujin_ocs/yocs_controllers ~/turtlebot_ws/src/
d. 编译工作空间
cd ~/turtlebot_ws
catkin_make
e. 添加工作空间到bashrc文件并启用环境变量
echo "source ~/turtlebot_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc 
f. 尝试在Gazebo中启动Turtlebot

在终端执行

roscore

在新的终端执行

roslaunch turtlebot_gazebo turtlebot_world.launch

成功运行如下图所示:

在这里插入图片描述

标签:Melodic,Turtlebot,ROS,get,sudo,git,turtlebot,ros,com
来源: https://blog.csdn.net/qty2898734013/article/details/114217366