ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

ROS-Melodic下 Gazebo+Turtlebot安装

2021-02-28 13:01:37  阅读:629  来源: 互联网

标签:Melodic Turtlebot ROS get sudo git turtlebot ros com


上一篇教程: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

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有