摘要本文主要记录gym_gazebo安装的过程,想想每次安装都要一堆的百度,过程很痛苦,所以直接记录下我成功安装的过程,方便后面安装的参考。
具体内容如下:
解决ubuntu 中安装 gym_gazabe 遇到的各种水土不服 Basic requirements:这部分的安装请自行百度, 但是这部分的内容也要安装上,不然安装gym_gazebo会出错的。
ROS Kinetic dependencies1 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 Sophus1 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 gym1 2 3 4 cd git clone https://github.com/erlerobot/gym-gazebo cd gym-gazebosudo pip3 install -e .
Dependencies and libraries1 2 3 4 5 6 7 8 9 10 11 sudo pip3 install h5py sudo apt-get install python3-skimage cd ~/git clone git://github.com/Theano/Theano.git cd Theano/sudo python3 setup.py develop 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 环境,只需要执行如下命令:
效果如下:
安装前需要配置下Agent 的gazebo.repos
1 2 3 cd ~/gym-gazebo/gym_gazebo/envs/installation/cp ./gazebo.repos ./gazebo.repos.bakgedit ~/gym-gazebo/gym_gazebo/envs/installation/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: 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 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 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 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 navigation: type : git url: https://github.com/ros-planning/navigation version: indigo-devel pcl_ros: type : git url: https://github.com/ros-perception/perception_pcl.git version: indigo-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 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 比较好用。
1 2 cd gym_gazebo/envs/installationbash setup_kinetic.bash
Run the environment with a sample agent1 2 cd gym_gazebo/examples/scripts_turtlebotpython circuit2_turtlebot_lidar_qlearn.py