1.19 gym_gazabe安装配置

摘要

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

具体内容如下:

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

Basic requirements:

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

ROS Kinetic dependencies

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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

1
2
3
4
5
6
7
8
9
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

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

Dependencies and libraries

1
2
3
4
5
6
7
8
9
10
11
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 环境,只需要执行如下命令:

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

效果如下:

从anaconda 切换到系统自带的python3.5

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

1
2
3
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的分支问题, 解决安装时的错误, 修改后的内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
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
1
2
cd gym_gazebo/envs/installation
bash setup_kinetic.bash

gym_gazebo 正确安装过程

Run the environment with a sample agent

1
2
cd gym_gazebo/examples/scripts_turtlebot
python circuit2_turtlebot_lidar_qlearn.py
文章目录
  1. 1. 摘要
    1. 1.1. 解决ubuntu 中安装 gym_gazabe 遇到的各种水土不服
      1. 1.1.1. Basic requirements:
      2. 1.1.2. ROS Kinetic dependencies
      3. 1.1.3. Install Sophus
      4. 1.1.4. Gazebo gym
      5. 1.1.5. Dependencies and libraries
      6. 1.1.6. Agent dependencies
      7. 1.1.7. Run the environment with a sample agent
|