Giter VIP home page Giter VIP logo

metagym's People

Contributors

banma12956 avatar dependabot[bot] avatar doublequeens avatar haojieshi98 avatar raindrops2sea avatar rical730 avatar tomorrowisanotherday avatar worldeditors avatar xueeinstein avatar yuechengliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metagym's Issues

无人机避障

请问这个无人机避障,可以在地图上显示障碍物吗?我设置了有障碍物的地图,但是看不到地图上有变化.

logic error in “Quadrotor” environment, maybe

In source code of rlschool/quadrotor/env.py, line 127 to line 140,

    def step(self, action):
        self.ct += 1
        cmd = np.asarray(action, np.float32)
        self.simulator.step(cmd.tolist(), self.dt)
        sensor_dict = self.simulator.get_sensor()
        state_dict = self.simulator.get_state()

        old_pos = [self.simulator.global_position[0] + self.x_offset,
                   self.simulator.global_position[1] + self.y_offset,
                   self.simulator.global_position[2] + self.z_offset]
        self._update_state(sensor_dict, state_dict)
        new_pos = [self.simulator.global_position[0] + self.x_offset,
                   self.simulator.global_position[1] + self.y_offset,
                   self.simulator.global_position[2] + self.z_offset]

where old_pos and new_pos are absolutely the same thing (might be unexpected).
Maybe the code should be like this?

    def step(self, action):
        self.ct += 1
        cmd = np.asarray(action, np.float32)

        # get the old_pos before calling the simulator.
        old_pos = [self.simulator.global_position[0] + self.x_offset,
                   self.simulator.global_position[1] + self.y_offset,
                   self.simulator.global_position[2] + self.z_offset]

        self.simulator.step(cmd.tolist(), self.dt)
        sensor_dict = self.simulator.get_sensor()
        state_dict = self.simulator.get_state()

        self._update_state(sensor_dict, state_dict)
        new_pos = [self.simulator.global_position[0] + self.x_offset,
                   self.simulator.global_position[1] + self.y_offset,
                   self.simulator.global_position[2] + self.z_offset]

自定义人流模式问题

mansion_flow.npy文件中准备了一天的人流分布数据,请问人流分布在时间考虑上是按泊松分布嘛?如果我只想训练一天中午两小时的人流数据有办法吗

关于liftsim时间特征

我注意到liftsim第二轮比赛是可以加入时间特征的,该怎么在提供的示例代码中加入时间特征呢?还是custom_generator中已经默认帮我加好了时间特征

NOTICE: We are changing the repo name and entrance of the environments.

As MetaGym will mainly focus on task generalization, we are changing the repo name from RLSchool to MetaGym (the PyPI package is changing from rlschool to metagym correspondingly), we apologize if this brings confusion to the developers.

The entrance for different environments also changed from "rlschool.make_env" to "gym.make". Check "README" in each environment carefully for more details

因仓库定位发展变化,我们的仓库名从“RLSchool” 已经更名为“MetaGym”. 如给开发者带来不便我们深表歉意。

仓库入口 rlschool.make_env 也变更为直接利用 gym.make 创建环境。详细信息请从环境README文件中获取。

电梯调度

电梯调度的事例太简单了,可以给了引入了强化学习算法的例子不

报错 python -m metagym.quadrotor.env hovering_control

python -m metagym.quadrotor.env hovering_control

/Users/chengmaoyu/anaconda3/envs/rl-3.9/lib/python3.9/runpy.py:127: RuntimeWarning: 'metagym.quadrotor.env' found in sys.modules after import of package 'metagym.quadrotor', but prior to execution of 'metagym.quadrotor.env'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Traceback (most recent call last):
File "/Users/chengmaoyu/anaconda3/envs/rl-3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/chengmaoyu/anaconda3/envs/rl-3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/chengmaoyu/code/test/rl/MetaGym/metagym/quadrotor/env.py", line 317, in
env.render()
File "/Users/chengmaoyu/code/test/rl/MetaGym/metagym/quadrotor/env.py", line 172, in render
raise RuntimeError('[Error] Cannot connect to display screen.')
RuntimeError: [Error] Cannot connect to display screen.

版本信息
gym 0.23.1
gym-notices 0.0.6
metagym 0.1.0
numpy 1.22.3

Big Sur import error: ValueError: dlsym(RTLD_DEFAULT, NSEventTrackingRunLoopMode): symbol not found

Environments:
system: Mac Big Sur 11.2.3
jupyter lab version: 2.2.6
python version: Python 3.8.5/3.9.2

当尝试import rlschool时,会报错ValueError: dlsym(RTLD_DEFAULT, NSEventTrackingRunLoopMode): symbol not found
详情如下。
大致搜索了下有的说是Python版本问题,有人通过升级Python至3.9.0解决了这个问题,issue 436,我也尝试了升级到3.9.2但是这个问题依然存在,所以,想来看下大家有遇到这个问题吗

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/opt/anaconda3/lib/python3.8/site-packages/pyglet/__init__.py in __getattr__(self, name)
    328         try:
--> 329             return getattr(self._module, name)
    330         except AttributeError:

AttributeError: 'NoneType' object has no attribute 'Window'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-10-c87ef756b229> in <module>
      1 # We show a simple example to start LiftSim here
----> 2 import rlschool

~/opt/anaconda3/lib/python3.8/site-packages/rlschool/__init__.py in <module>
     13 # limitations under the License.
     14 
---> 15 from rlschool.liftsim import *
     16 from rlschool.quadrotor import *
     17 

~/opt/anaconda3/lib/python3.8/site-packages/rlschool/liftsim/__init__.py in <module>
     13 # limitations under the License.
     14 
---> 15 from rlschool.liftsim.environment import *

~/opt/anaconda3/lib/python3.8/site-packages/rlschool/liftsim/environment/__init__.py in <module>
     14 
     15 from rlschool.liftsim.environment.env import *
---> 16 from rlschool.liftsim.environment.animation import *
     17 from rlschool.liftsim.environment.mansion import *

~/opt/anaconda3/lib/python3.8/site-packages/rlschool/liftsim/environment/animation/__init__.py in <module>
     13 # limitations under the License.
     14 
---> 15 from rlschool.liftsim.environment.animation.rendering import *
     16 from rlschool.liftsim.environment.animation.resources import *

~/opt/anaconda3/lib/python3.8/site-packages/rlschool/liftsim/environment/animation/rendering.py in <module>
     23 pyglet.resource.reindex()
     24 
---> 25 class Render(pyglet.window.Window):
     26     def __init__(self, shared):
     27         self.shared_mansion = shared

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/__init__.py in __getattr__(self, name)
    333 
    334             import_name = 'pyglet.%s' % self._module_name
--> 335             __import__(import_name)
    336             module = sys.modules[import_name]
    337             object.__setattr__(self, '_module', module)

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/window/__init__.py in <module>
   1863     # Try to determine which platform to use.
   1864     if pyglet.compat_platform == 'darwin':
-> 1865         from pyglet.window.cocoa import CocoaWindow as Window
   1866     elif pyglet.compat_platform in ('win32', 'cygwin'):
   1867         from pyglet.window.win32 import Win32Window as Window

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/window/cocoa/__init__.py in <module>
     42 from pyglet.event import EventDispatcher
     43 
---> 44 from pyglet.canvas.cocoa import CocoaCanvas
     45 
     46 from pyglet.libs.darwin import cocoapy, CGPoint

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/canvas/__init__.py in <module>
    100     from pyglet import compat_platform
    101     if compat_platform == 'darwin':
--> 102         from pyglet.canvas.cocoa import CocoaDisplay as Display
    103         from pyglet.canvas.cocoa import CocoaScreen as Screen
    104         from pyglet.canvas.cocoa import CocoaCanvas as Canvas

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/canvas/cocoa.py in <module>
     39 from .base import Display, Screen, ScreenMode, Canvas
     40 
---> 41 from pyglet.libs.darwin.cocoapy import CGDirectDisplayID, quartz, cf
     42 from pyglet.libs.darwin.cocoapy import cfstring_to_string, cfarray_to_list
     43 

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/libs/darwin/__init__.py in <module>
     34 # ----------------------------------------------------------------------------
     35 
---> 36 from .cocoapy import *

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/libs/darwin/cocoapy/__init__.py in <module>
     35 
     36 from .cocoatypes import *
---> 37 from .cocoalibs import *

~/opt/anaconda3/lib/python3.8/site-packages/pyglet/libs/darwin/cocoapy/cocoalibs.py in <module>
    198 
    199 NSDefaultRunLoopMode = c_void_p.in_dll(appkit, 'NSDefaultRunLoopMode')
--> 200 NSEventTrackingRunLoopMode = c_void_p.in_dll(appkit, 'NSEventTrackingRunLoopMode')
    201 NSApplicationDidHideNotification = c_void_p.in_dll(appkit, 'NSApplicationDidHideNotification')
    202 NSApplicationDidUnhideNotification = c_void_p.in_dll(appkit, 'NSApplicationDidUnhideNotification')

ValueError: dlsym(RTLD_DEFAULT, NSEventTrackingRunLoopMode): symbol not found

关于电梯调度模拟环境

您好,我在使用liftsim 仿真环境时,出现AttributeError:module 'pyglet.gt' has no attribute 'get_current_context'请问如何解决?

env.render()问题

您好,我正在使用的环境是:
python 3.7.9
gym 0.21.0
metagym 0.1.1
执行如下代码:
import gym
import metagym.quadrotor
env = gym.make("quadrotor-v0", task="no_collision")
env.reset()
env.render()
出现报错:
RuntimeError: [Error] Cannot connect to display screen.
经查找缺少:colour、trimesh 两个包
使用pip安装如下版本:
colour 0.1.5
trimesh 3.15.3
安装后解决上述问题,但是新增报错:
AttributeError: 'ColorVisuals' object has no attribute 'crc'
经查找问题出现在“metagym\quadrotor\utils.py”文件的“geometry_hash”函数中
查找“trimesh”官方API后,决定尝试用“geometry.crc()”代替“geometry.visual.crc()”;
我将第113行“md5 += str(geometry.visual.crc())”修改为“md5 = str(geometry.crc())”
修改后程序可以正常运行。
希望官方能够明确安装所需全部依赖及其版本,同时能否确认我遇到的第二个问题是否属于“trimesh”版本不匹配。
谢谢!

四旋翼飞行器

运行DDPG的例子出现以下问题
AttributeError: 'Quadrotor' object has no attribute 'reward_range'

MazeTaskSampler 导入失败

File "E:\projects\MetaGym\metagym\metamaze\test.py", line 7, in
from metagym.metamaze import MazeTaskSampler
ImportError: cannot import name 'MazeTaskSampler' from 'metagym.metamaze' (D:\Programs\Anaconda3\lib\site-packages\metagym\metamaze_init_.py)

请修复read.me

python 2.7.6 ,pip安装最新版RLSchool后,用read.me代码不能运行,改为以下代码通过:
from rlschool import env as make_env
env = make_env.LiftSim()
observation = env.reset()
action = [2, 0, 4, 0, 7, 0, 10, 0]
for i in range(100):
env.render() # use render to show animation
next_obs, reward, done, info = env.step(action)

代码存在困惑点

在quadrotorsim.py中256-258行

        self.coordination_converter_to_world = self.rotation_matrix
        self.coordination_converter_to_body = np.linalg.inv(
        self.rotation_matrix)

这个不是应该用 self._coordination_converter_to_world 和 self._coordination_converter_to_body 这两个吗,还是我理解的有问题呀,谢谢您的回答

install error

hi, maybe the setup.py is not robust enouph(or maybe it's just a tool can only be installed in Linux), I failed to install it until I made some changes.

environment:
platform: windows 10
python: python 3.6.1
error:
F:code\RLSchool-master>pip install .
Processing f:code\rlschool-master
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\JL\AppData\Local\Temp\pip-4flifg6e-build\setup.py", line 20, in
long_description = fh.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 22: illegal multibyte sequence

my sollution:
change setup.py, line 19 to : with open('README.md', 'r',encoding='utf-8') as fh:

LiftSim relation between DeliveredPersons, GeneratedPersons and 'AbandonedPersons in env.get.statastics() method

@WorldEditors @TomorrowIsAnOtherDay env.statastics() method gave the following output however i am unable to understand how the DeliveredPersons, GeneratedPersons and
'AbandonedPersons are related? Ideally my understanding is

GeneratedPersons = DeliveredPersons + AbandonedPersons

But that is not happening here could anyone please clarify?

{'DeliveredPersons(10Minutes)': 25, 'GeneratedPersons(10Minutes)': 56, 'EnergyConsumption(10Minutes)': 2333473.528360311, 'TotalWaitingTime(10Minutes)': 15122.5, 'AbandonedPersons(10Minutes)': 44}

In Velocity Control task, the next expected velocity is in global or body coordinate?

As README says, the next expected velocity is in the global coordinate.

For "velocity_control" task, it has:

next_target_g_v_x: next expected velocity of the drone in x direction, in global coordinate.
next_target_g_v_y: next expected velocity of the drone in y direction, in global coordinate.
next_target_g_v_z: next expected velocity of the drone in z direction, in global coordinate.

But in the code, it seems to be in the body coordinate.
https://github.com/PaddlePaddle/RLSchool/blob/d4fdae4c875638a0ca7018b70fd1ce0ac35938ca/rlschool/quadrotor/env.py#L262-L267
Above self.velocity_targets is in the body coordinate.
https://github.com/PaddlePaddle/RLSchool/blob/d4fdae4c875638a0ca7018b70fd1ce0ac35938ca/rlschool/quadrotor/quadrotorsim.py#L320

Import Error for Mac Big Sur

system: Mac Big Sur 11.4
python 3.6
pyglet 1.5.0

Error occurs when import rlschool:

from rlschool import make_env

Traceback (most recent call last):
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/init.py", line 329, in getattr
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'Window'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/Users/xxx/Documents/code/RLSchool/rlschool/init.py", line 15, in
from rlschool.liftsim import *
File "/Users/xxx/Documents/code/RLSchool/rlschool/liftsim/init.py", line 15, in
from rlschool.liftsim.environment import *
File "/Users/xxx/Documents/code/RLSchool/rlschool/liftsim/environment/init.py", line 16, in
from rlschool.liftsim.environment.animation import *
File "/Users/xxx/Documents/code/RLSchool/rlschool/liftsim/environment/animation/init.py", line 15, in
from rlschool.liftsim.environment.animation.rendering import *
File "/Users/xxx/Documents/code/RLSchool/rlschool/liftsim/environment/animation/rendering.py", line 25, in
class Render(pyglet.window.Window):
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/init.py", line 335, in getattr
import(import_name)
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/window/init.py", line 1865, in
from pyglet.window.cocoa import CocoaWindow as Window
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/window/cocoa/init.py", line 44, in
from pyglet.canvas.cocoa import CocoaCanvas
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/canvas/init.py", line 102, in
from pyglet.canvas.cocoa import CocoaDisplay as Display
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/canvas/cocoa.py", line 41, in
from pyglet.libs.darwin.cocoapy import CGDirectDisplayID, quartz, cf
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/libs/darwin/init.py", line 36, in
from .cocoapy import *
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/init.py", line 37, in
from .cocoalibs import *
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/site-packages/pyglet/libs/darwin/cocoapy/cocoalibs.py", line 20, in
cf.CFStringCreateWithCString.restype = c_void_p
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/ctypes/init.py", line 361, in getattr
func = self.getitem(name)
File "/Users/xxx/opt/miniconda3/envs/houseexpo/lib/python3.6/ctypes/init.py", line 366, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, CFStringCreateWithCString): symbol not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.