在Google合作实验室上运行Gym-凉亭 [英] Run gym-gazebo on Google Colaboratory

查看:81
本文介绍了在Google合作实验室上运行Gym-凉亭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Google合作实验室上运行Gym-凉亭.
在Colab上运行凉亭服务器(没有gui的凉亭)时出现问题.
显示屏上显示警告:无法创建X窗口.渲染将被禁用,但我想我已经解决了.
也有关于声卡的警告.不确定是否与无法打开音频设备相关,
还有关于转换的警告不支持传感器类型[深度]的转换
这是一个示例
你能帮忙吗?

I am trying to run gym-gazebo on Google Colaboratory.
There is a problem to run gazebo server (gazebo without gui) on Colab.
There was warning on display: Unable to create X window. Rendering will be disabled but I think I fix it.
There also warning about sound card. not sure it related Unable to open audio device,
And there warning about conversion Conversion of sensor type[depth] not supported
Here is an example
Can you help?

推荐答案

要以无头模式运行凉亭,您需要运行 gserver 可执行文件,而不是 gazebo .不知道健身房凉亭工具包使用了哪一个.

In order to run gazebo in a headless mode you need to run gserver executable, instead of gazebo. Not sure which one is used by the gym-gazebo toolkit.

为了仍然在凉亭服务器(例如摄像机视图)中进行渲染,您需要使用Xvfb(X虚拟帧缓冲区).它是X服务器,可以在没有显示硬件和物理输入设备的机器上运行.它使用虚拟内存模拟哑帧缓冲区.

In order to still do rendering in gazebo server (e.g. camera view) you would need to use Xvfb (X Virtual Frame Buffer). It is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory.

对于您的特定colab笔记本,我通过添加

For your specific colab notebook I have changed last cell by adding

get_ipython().system_raw('Xvfb :1 -screen 0 1600x1200x16  &')

为了创建虚拟显示并将DISPLAY =:1.0添加到最后一行的开头,因此它看起来如下所示

in order to create virtual display and added DISPLAY=:1.0 to the beginning of the last line, so it looked as follows

DISPLAY=:1.0 python gym-gazebo/examples/turtlebot/circuit2c_turtlebot_camera_dqn.py

DISPLAY =:1.0 告诉凉亭使用的X Window客户端使用我们创建的虚拟显示,而不是默认的:0 .

DISPLAY=:1.0 tells X Window client used by gazebo to use virtual display we have created instead of default one :0.

Gazebo在colab上的完整安装并在具有渲染功能的无头服务器模式下运行可以通过以下方式实现:

A complete installation of Gazebo on colab and running it in headless server mode with rendering capability can be achieved the following way:

!curl -sSL http://get.gazebosim.org | sh # Install gazebo

!apt-get install -y xvfb # Install X Virtual Frame Buffer

get_ipython().system_raw('Xvfb :1 -screen 0 1600x1200x16  &') # create virtual display with size 1600x1200 and 16 bit color. Color can be changed to 24 or 8

!source /usr/share/gazebo-9/setup.sh && DISPLAY=:1.0 gzserver --verbose # Run gazebo and tell X client to use our virtual DISPLAY :1.0

还有一种方法可以在模拟器中以gzweb为头运行​​完整的凉亭,并使用ngrok.io(在此作为完全正常工作的笔记本)链接到它. https://colab.research.google.com/drive/1A-miW8cTRKzs7B0m1m4enfiFySz>

There is also a way to run full gazebo in simulator with gzweb as a head and link to it using ngrok.io explained here as a fully working notebook. https://colab.research.google.com/drive/1A-miW8cTRKzs7B0m1m4enfiFySzBhsgN

您需要使用可以在ngrok.com上创建的auth令牌对ngrok进行身份验证才能进行连接,因为它是作为午餐的背景并且不会打印到单元格

You would need to authenticate to ngrok using your auth token which can be created at ngrok.com in order to connect, because it is lunch as background and doesn't print to cell

 !./ngrok authtoken <token> 

这篇关于在Google合作实验室上运行Gym-凉亭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆