安装gym gazebo

安装gym-gazebo

cd /opt/ros/kinetic/lib/python2.7/dist-packages
sudo rm cv2.so`
  • 1
  • 2
cd /home/zhw/gym-gazebo/gym_gazebo/envs/installation
bash setup_kinetic.bash
bash turtlebot_setup.bash
bash turtlebot_nn_setup.bash
  • 1
  • 2
  • 3
  • 4

安装的时候可能出现的问题

  • 问题1 先出现的是msg的问题
    解决方法:
cd /home/zhw/gym-gazebo/gym_gazebo/envs/installation
  • 1

然后open gazebo.repos文件
在其中加入:

  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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 问题2:
    在使用bash setup_kinetic.bash进行安装的过程中,会出现make j-1等错误,找到问题点之后,一对一解决:
    1)spacenav_node not compiling. CATKIN_IGNOREd.
touch /home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/joystick_drivers/spacenav_node/CATKIN_IGNORE
  • 1

2) wiimote not compiling. CATKIN_IGNOREd.

touch /home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/joystick_drivers/wiimote/CATKIN_IGNORE
  • 1

3)kobuki_qtestsuite not compiling. CATKIN_IGNOREd.

touch /home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/kobuki_desktop/kobuki_qtestsuite/CATKIN_IGNORE
  • 1

当测试安装是否完成时,使用

cd /home/zhw/gym-gazebo/examples/turtlebot
export ROS_PORT_SIM=11311
python3 circuit2_turtlebot_lidar_qlearn.py
  • 1
  • 2
  • 3
  • 4

这是因为没有把 ROS_PORT_SIM设置成为环境变量,导致了在gazebo_env.py文件中的

port = os.environ["ROS_PORT_SIM"]
  • 1

不能正确识别ROS_PORT_SIM这个变量

  • 问题3:
    在运行 ‘python circuit2_turtlebot_lidar_qlearn.py ’ 报错
while processing /home/harish/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/turtlebot_simulator/turtlebot_gazebo/launch/includes/kobuki.launch.xml:
Invalid tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/lib/xacro/xacro --inorder '/home/harish/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/turtlebot/turtlebot_description/robots/kobuki_hexagons_asus_xtion_pro.urdf.xacro'] returned with code [2].
Param xml is 
The traceback for the exception was written to the log file
  • 1
  • 2
  • 3
  • 4

解决方法

使用gedit打开kobuki.launch.xml文件

gedit /home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/turtlebot_simulator/turtlebot_gazebo/launch/includes/kobuki.launch.xml
  • 1

然后,将第六行替换成:

<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find turtlebot_description)/robots/$(arg base)_$(arg stacks)_$(arg 3d_sensor).urdf.xacro'"/>
  • 1

2018年1月6日补充:

看到github有人给了安装教程,解决python2和python3不兼容的问题, 有如下解决方案:

2to3 -w /home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/control_toolbox/cfg/Parameters.cfg

2to3 -w /home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/spawn_model

2to3 -w /home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/src/gazebo_ros/gazebo_interface.py

猜你喜欢

转载自blog.csdn.net/jianghao_ava/article/details/81096177
今日推荐