Ubuntu14.04 + ROS indigo环境安装更新版本Gazebo

  • Step1:先卸载 ros-indigo-desktop-full

如果之前安装ROS时,是使用如下命令安装,则需要先卸载。

sudo apt-get install ros-indigo-desktop-full
 
 

因为,ros-indigo-desktop-full不仅包含了ros-indigo-ros-base、ros-indigo-desktop这些基本包,还集成了很多的功能包,其中包括gazebo2 以及gazebo与ROS连接的相关的包。gazebo的版本太低,如果不先卸载,会导致gazebo2 与更新版本gazebo的冲突。

使用如下命令进行卸载:

sudo apt-get remove ros-indigo-desktop-full 
 
 

或者

sudo apt-get autoremove ros-indigo-desktop-full
 
 

 或者

sudo apt-get remove ros-*
 
 
  • Step2:添加源
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
 
 

查看是否添加成功

cat /etc/apt/sources.list.d/gazebo-stable.list 
 
 

如果输出如下,则说明添加源成功。

deb http://packages.osrfoundation.org/gazebo/ubuntu-stable trusty main
 
 
  • Step3:下载并添加秘钥
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
 
 
  • Step4:更新源
sudo apt-get update
 
 
  • Step5:选择版本下载

输入如下命令,并用tab键查看所有可供下载的版本

sudo apt-get install gazebo

 
 

输出如下结果


 
 
  1. gazebo2 gazebo6-common
  2. gazebo2-dbg gazebo6-dbg
  3. gazebo3 gazebo6-doc
  4. gazebo3-common gazebo6-plugin-base
  5. gazebo3-dbg gazebo6-robocup3ds
  6. gazebo3-doc gazebo6-robocup3ds-common
  7. gazebo3-plugin-base gazebo7
  8. gazebo4 gazebo7-common
  9. gazebo4-common gazebo7-dbg
  10. gazebo4-dbg gazebo7-doc
  11. gazebo4-doc gazebo7-haptix
  12. gazebo4-plugin-base gazebo7-haptix-common
  13. gazebo5 gazebo7-haptix-dbg
  14. gazebo5-common gazebo7-haptix-doc
  15. gazebo5-dbg gazebo7-haptix-plugin-base
  16. gazebo5-doc gazebo7-plugin-base
  17. gazebo5-plugin-base gazebo7-robocup3ds
  18. gazebo6 gazebo7-robocup3ds-common

或者,输入如下命令,并用tab键查看所有可供下载的版本

sudo apt-get install libgazebo
 
 

 输出如下结果


 
 
  1. libgazebo3 libgazebo5-dev libgazebo7-dev
  2. libgazebo4 libgazebo6 libgazebo7-haptix
  3. libgazebo4-dev libgazebo6-dev libgazebo7-haptix-dev
  4. libgazebo5 libgazebo6-robocup3ds libgazebo7-robocup3ds
  5. libgazebo5-dbg libgazebo7 libgazebo-dev

如果需要开发gazebo,则需安装libgazebo*-dev;如果只是使用gazebo,则只安装gazebo*即可

sudo apt-get install gazebo7
 
 

但是,可能会报错!!! 没报错跳过这一步


 
 
  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. Some packages could not be installed. This may mean that you have
  5. requested an impossible situation or if you are using the unstable
  6. distribution that some required packages have not yet been created
  7. or been moved out of Incoming.
  8. The following information may help to resolve the situation:
  9. The following packages have unmet dependencies:
  10. gazebo7 : Depends: libgazebo7 (= 7.12.0-1~trusty) but it is not going to be installed
  11. Depends: libsdformat4 but it is not going to be installed
  12. Depends: gazebo7-common (= 7.12.0-1~trusty) but it is not going to be installed
  13. Recommends: gazebo7-plugin-base
  14. E: Unable to correct problems, you have held broken packages.

那么应该改用如下命令进行安装

sudo aptitude install gazebo7
 
 

安装完成后,验证

gazebo --version
 
 

输出如下,说明安装成功


 
 
  1. Gazebo multi-robot simulator, version 7.12.0
  2. Copyright (C) 2012 Open Source Robotics Foundation.
  3. Released under the Apache 2 License.
  4. http://gazebosim.org
  • Step6:重新安装ROS
sudo apt-get install ros-indigo-desktop
 
 
  • Step7: 安装ros与gazebo接口库
sudo apt-get install ros-indigo-gazebo7-*
 
 

大功告成!

  • 注意

安装完之后,运行gazebo
可能会报错:VMware: vmw_ioctl_command error Invalid argument.
此错误是由于VMWare开了显示器的3D图形加速功能,具体解决方法:
先关闭虚拟机,然后通过右击VMWare虚拟机选择“设置”--“显示器”选项,关机“3D图形加速”功能;
重启虚拟机,重新运行gazebo即可。

See more:Gazebo官网http://gazebosim.org/tutorials?tut=ros_installing&cat=connect_ros

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值