《Deep Learning Series》
  • 深耕系列之深度学习笔记
  • 第一章 Linux学习环境相关配置
    • 1.1 Ubuntu18下有道词典的配置
    • 1.2 Ubuntu18 安装Gitbook
    • 1.3 Ubuntu18 git命令使用总结
    • 1.4 Latex 排版使用笔记
    • 1.5 Ubuntu下常用工具软件配置安装
    • 1.6 win10+ubuntu双系统修复ubuntu启动引导
    • 1.7 gitbook 插件等相关设置
    • 1.8 深度学习环境搭建
    • 1.9 hexo 实现本地图片加载
    • 1.10 hexo网页定制
    • 1.11 sublime text3插件介绍
    • 1.12 vsftpd.conf文件配置
    • 1.13 mysql 笔记
    • 1.14 ubuntu16_18安装peek工具录制gif
    • 1.15 ubuntu下goldendict有道爬虫小程序
    • 1.16 ubuntu18升级后部分应用不能中文输入的问题
    • 1.17 ubuntu下安装有道词典
    • 1.18 opencv 安装
    • 1.19 gym_gazabe安装配置
    • 1.20 docker 基础
    • 1.21 docker_配置权限问题
    • 1.22 jupyternotebook使用
  • 第二章 深度学习相关基础算法
    • 2.1 马尔科夫链
      • 2.1.1 马尔科夫简单模型预测实战笔记
      • 2.1.2 最大熵模型
      • 2.1.3 隐马尔科夫HMM
    • 2.2 矩阵相关基础知识
    • 2.3 线性回归
    • 2.4 决策树
    • 2.5 梯度下降和最小二乘法
    • 2.6 递归算法与迭代算法
    • 2.7 神经网络浅学笔记
    • 2.8 强化学习经验回放
    • 2.9 K近邻算法
    • 2.10 朴素贝叶斯法
    • 2.11 极大似然估计
    • 2.12 logistic regression
  • 第三章 深度学习框架学习
    • 3.1 PyTorch 学习
      • 3.1.2 Pytorch 之MNIST手写字识别分类
    • 3.2 tensorflow学习笔记
      • 3.2.1 tensorflow之MNIST
    • 3.3 matplotlib函数
    • 3.4 numpy函数
  • 第四章 ROS机器人
    • ROS室内仿真环境.md
    • ros and gazebo and gym_gazebo安装
    • ubuntu16 安装gym-gazebo
    • gym-gazebo安装后的测试
    • 基于DQN的gym_gazebo运行代码演示
  • 项目开发
    • Library占座小工具使用手册
  • 附录
    • Python 相关笔记
      • Python 帮助文档检索方法
      • Module篇使用future
    • Git 相关配置
      • git-推送新的文章到github其他分支上
      • gitignre 配置
      • gitignre 配置
      • Hexo 每次写好后deploy博客
      • MFC Socket 通信
      • python之tkinter入坑Pack
      • ubuntu 中安装sublime_text3
      • ubuntu18-正确-安装ShadowSocket
      • vultr+freenom实现主机域名的绑定.md
      • 值得收藏的网站
      • 搜索技巧
      • 第一篇博文
      • 简单的方法,越过付费获取在线的log设计.md
      • 网页设计基础笔记.md
      • 解决Chrome67版本以后不能离线安装插件的情况.md
    • 嵌入式相关笔记
      • STM32串口通信配置
      • STM32复位及通过函数判断是何种条件出发的复位
Powered by GitBook
On this page
  • 解决ubuntu 中安装 gym_gazabe 遇到的各种水土不服
  • Basic requirements:
  • ROS Kinetic dependencies
  • Install Sophus
  • Gazebo gym
  • Dependencies and libraries
  • Agent dependencies
  • Run the environment with a sample agent

Was this helpful?

  1. 第一章 Linux学习环境相关配置

1.19 gym_gazabe安装配置

Previous1.18 opencv 安装Next1.20 docker 基础

Last updated 5 years ago

Was this helpful?

本文主要记录gym_gazebo安装的过程,想想每次安装都要一堆的百度,过程很痛苦,所以直接记录下我成功安装的过程,方便后面安装的参考。

具体内容如下:

解决ubuntu 中安装 gym_gazabe 遇到的各种水土不服

Basic requirements:

  • ROS Kinetic (/rosversion: 1.12.7)

  • Gazebo 8.1.1

  • Python 3.5.2

  • OpenCV3, installed from sources for Python 3 (git clone )

  • OpenAI gym

这部分的安装请自行百度, 但是这部分的内容也要安装上,不然安装gym_gazebo会出错的。

ROS Kinetic dependencies

sudo pip3 install rospkg catkin_pkg

sudo apt-get install python3-pyqt4

sudo apt-get install \
cmake gcc g++ qt4-qmake libqt4-dev \
libusb-dev libftdi-dev \
python3-defusedxml python3-vcstool \
libbluetooth-dev libspnav-dev \
pyqt4-dev-tools libcwiid-dev \
ros-kinetic-octomap-msgs        \
ros-kinetic-joy                 \
ros-kinetic-geodesy             \
ros-kinetic-octomap-ros         \
ros-kinetic-control-toolbox     \
ros-kinetic-pluginlib           \
ros-kinetic-trajectory-msgs     \
ros-kinetic-control-msgs           \
ros-kinetic-std-srvs            \
ros-kinetic-nodelet           \
ros-kinetic-urdf               \
ros-kinetic-rviz               \
ros-kinetic-kdl-conversions     \
ros-kinetic-eigen-conversions   \
ros-kinetic-tf2-sensor-msgs     \
ros-kinetic-pcl-ros \
ros-kinetic-navigation \
ros-kinetic-ar-track-alvar-msgs

Install Sophus

cd
git clone https://github.com/stonier/sophus -b release/0.9.1-kinetic
cd sophus
mkdir build
cd build
cmake ..
make
sudo make install
echo "## Sophus installed ##\n"

Gazebo gym

cd 
git clone https://github.com/erlerobot/gym-gazebo
cd gym-gazebo
sudo pip3 install -e .

Dependencies and libraries

sudo pip3 install h5py
sudo apt-get install python3-skimage

# install Theano
cd ~/
git clone git://github.com/Theano/Theano.git
cd Theano/
sudo python3 setup.py develop

#install Keras
sudo pip3 install keras

Agent dependencies

这部分的安装可以参考我的github 仓库(gazebo.repos 已经修改过,并且在ubuntu16上正确编译安装通过,可以直接clone下来安装,我只修改了gazebo.repos,设置/usr/local/python3.5环境):

这部分的安装需要注意请尽量用"/usr/local/bin/python3.5"如果用anaconda的python环境下安装,会出现Cmake 报错,如果你有解决的办法可以忽略提示

切换python 环境,只需要执行如下命令:

vim ~/.bashrc
# 修改弹出的文本,将export anaconda这行注释掉,如下所示
# added by Anaconda3 4.2.0 installer
#export PATH="/home/porter/anaconda3/bin:$PATH"

效果如下:

安装前需要配置下Agent 的gazebo.repos

cd ~/gym-gazebo/gym_gazebo/envs/installation/
cp ./gazebo.repos ./gazebo.repos.bak
gedit ~/gym-gazebo/gym_gazebo/envs/installation/gazebo.repos
  • gazebo.repos 内容如下

    主要修改一些github 仓库对应版本release的分支问题, 解决安装时的错误, 修改后的内容如下:

repositories:
#  ardupilot_sitl_gazebo_plugin:
#    type: git
#    url: https://github.com/erlerobot/ardupilot_sitl_gazebo_plugin
#
#    version: master

  ar_track_alvar:
    type: git
    url: https://github.com/ros-perception/ar_track_alvar.git
    version: kinetic-devel

  mav_comm:
    type: git
    url: https://github.com/ethz-asl/mav_comm.git
    version: master
#  ar_track_alvar:
#    type: git
#    url: https://github.com/sniekum/ar_track_alvar
#    version: indigo-devel
#  ar_track_alvar_msgs:
#    type: git
#    url: https://github.com/sniekum/ar_track_alvar_msgs
#    version: indigo-devel
  catkin_simple:
    type: git
    url: https://github.com/catkin/catkin_simple.git
    version: master
  control_toolbox:
    type: git
    url: https://github.com/ros-controls/control_toolbox.git
    version: indigo-devel
#  drcsim:
#    type: hg
#    url: https://bitbucket.org/osrf/drcsim
#    version: default
  ecl_core:
    type: git
    url: https://github.com/stonier/ecl_core
    version: release/0.61-indigo-kinetic
  ecl_lite:
    type: git
    url: https://github.com/stonier/ecl_lite
    version: release/0.61-indigo-kinetic
  ecl_navigation:
    type: git
    url: https://github.com/stonier/ecl_navigation
    version: devel
  ecl_tools:
    type: git
    url: https://github.com/stonier/ecl_tools
    version: release/0.61-indigo-kinetic
  driver_base:
    type: git
    url: https://github.com/ros-drivers/driver_common.git
    version: indigo-devel
  gazebo_ros_pkgs:
    type: git
    url: https://github.com/ros-simulation/gazebo_ros_pkgs
    version: indigo-devel
#  glog_catkin:
#    type: git
#    url: https://github.com/ethz-asl/glog_catkin.git
#    version: master
  hector_gazebo:
    type: git
    url: https://github.com/tu-darmstadt-ros-pkg/hector_gazebo/
    version: indigo-devel
  image_common:
    type: git
    url: https://github.com/ros-perception/image_common.git
    version: hydro-devel
  joystick_drivers:
    type: git
    url: https://github.com/ros-drivers/joystick_drivers.git
    version: master
  kobuki:
    type: git
    url: https://github.com/yujinrobot/kobuki
    version: indigo
  kobuki_core:
    type: git
    url: https://github.com/yujinrobot/kobuki_core
    version: indigo
  kobuki_desktop:
    type: git
    url: https://github.com/erlerobot/kobuki_desktop
    version: indigo
  kobuki_msgs:
    type: git
    url: https://github.com/yujinrobot/kobuki_msgs
    version: indigo
#  mavros:
#    type: git
#    url: https://github.com/erlerobot/mavros.git
#    version: gazebo_udp
#  mav_comm:
#    type: git
#    url: https://github.com/PX4/mav_comm.git
#    version: master
  navigation:
    type: git
    url: https://github.com/ros-planning/navigation
    version: indigo-devel
#  osrf-common:
#    type: hg
#    url: https://bitbucket.org/osrf/osrf-common
#    version: default
  pcl_ros:
    type: git
    url: https://github.com/ros-perception/perception_pcl.git
    version: indigo-devel
#  python_qt_binding:
#    type: git
#    url: https://github.com/ros-visualization/python_qt_binding
#    version: kinetic-devel
#  qt_gui_core:
#    type: git
#    url: https://github.com/ros-visualization/qt_gui_core
#    version: groovy-devel
  realtime_tools:
    type: git
    url: https://github.com/ros-controls/realtime_tools
    version: indigo-devel
  ros_control:
    type: git
    url: https://github.com/ros-controls/ros_control
    version: indigo-devel
  roslint:
    type: git
    url: https://github.com/ros/roslint
    version: master
#  rqt:
#    type: git
#    url: https://github.com/ros-visualization/rqt
#    version: groovy-devel
#  rqt_common_plugins:
#    type: git
#    url: https://github.com/ros-visualization/rqt_common_plugins
#    version: master
#  rqt_robot_plugins:
#    type: git
#    url: https://github.com/ros-visualization/rqt_robot_plugins
#    version: master
  turtlebot:
    type: git
    url: https://github.com/turtlebot/turtlebot
    version: indigo
  turtlebot_create:
    type: git
    url: https://github.com/turtlebot/turtlebot_create
    version: indigo
  turtlebot_simulator:
    type: git
    url: https://github.com/turtlebot/turtlebot_simulator
    version: indigo
  xacro:
    type: git
    url: https://github.com/ros/xacro
    version: indigo-devel
  yocs_msgs:
    type: git
    url: https://github.com/yujinrobot/yocs_msgs
    version: release/0.6-kinetic
  yujin_ocs:
    type: git
    url: https://github.com/yujinrobot/yujin_ocs
    version: kinetic

具体的修改地方建议,通过code compare 工具查看,这里推荐一个好用而代码比较工具:Meld Diff 比较好用。

  • 接下来执行如下Agent dependences

cd gym_gazebo/envs/installation
bash setup_kinetic.bash

Run the environment with a sample agent

cd gym_gazebo/examples/scripts_turtlebot
python circuit2_turtlebot_lidar_qlearn.py
https://github.com/Itseez/opencv.git
摘要
解决ubuntu 中安装 gym_gazabe 遇到的各种水土不服
Basic requirements:
ROS Kinetic dependencies
Install Sophus
Gazebo gym
Dependencies and libraries
Agent dependencies
Run the environment with a sample agent
从anaconda 切换到系统自带的python3.5
gym_gazebo 正确安装过程