Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary solution for gym version update #40

Merged
merged 4 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyrcareworld/Examples/example_load_object.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pyrcareworld.envs import RCareWorld

env = RCareWorld(assets=["Cube"])
cube = env.create_object(id=2333, name="Cube", is_in_scene=False)
cube = env.create_object(id=12345, name="Cube", is_in_scene=False)
cube.load()
print(env.instance_channel.data)
# env.close()
while True:
for i in range(500):
env._step()
print(env.instance_channel.data)
env.close()
51 changes: 25 additions & 26 deletions pyrcareworld/pyrcareworld/envs/rcareworld_env.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from gym.utils import seeding

from abc import ABC

import pyrcareworld
Expand All @@ -11,7 +9,8 @@
from pyrcareworld.rfuniverse_channel import AssetChannel
from pyrcareworld.rfuniverse_channel import InstanceChannel
from pyrcareworld.rfuniverse_channel import DebugChannel
import gym
import gymnasium as gym
from gymnasium.utils import seeding
import os

from pyrcareworld.agents import Robot
Expand Down Expand Up @@ -233,29 +232,29 @@ def close(self):
RCareWorldBaseEnv.close(self)


class RCareWorldGymGoalWrapper(gym.GoalEnv, RCareWorldBaseEnv):
def __init__(
self,
executable_file: str = None,
scene_file: str = None,
custom_channels: list = [],
assets: list = [],
**kwargs
):
RCareWorldBaseEnv.__init__(
self,
executable_file=executable_file,
scene_file=scene_file,
custom_channels=custom_channels,
assets=assets,
**kwargs,
)

def reset(self):
gym.GoalEnv.reset(self)

def close(self):
RCareWorldBaseEnv.close(self)
# class RCareWorldGymGoalWrapper(gym.GoalEnv, RCareWorldBaseEnv):
# def __init__(
# self,
# executable_file: str = None,
# scene_file: str = None,
# custom_channels: list = [],
# assets: list = [],
# **kwargs
# ):
# RCareWorldBaseEnv.__init__(
# self,
# executable_file=executable_file,
# scene_file=scene_file,
# custom_channels=custom_channels,
# assets=assets,
# **kwargs,
# )

# def reset(self):
# gym.GoalEnv.reset(self)

# def close(self):
# RCareWorldBaseEnv.close(self)


class RCareWorld(RCareWorldBaseEnv):
Expand Down
2 changes: 0 additions & 2 deletions pyrcareworld/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
"protobuf==3.19.0",
"pyyaml>=3.1.0",
"pybullet",
"gym==0.21.0",
# "stable-baselines3"
"opencv-python",
],
python_requires=">=3.6.1",
Expand Down
Loading