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

Rddl wip functional #69

Open
wants to merge 38 commits into
base: RDDL
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
95b822d
taskmanager to be filled with RDDL
gabinsane Mar 27, 2024
255642b
tuna scenario fixed
gabinsane Apr 5, 2024
6f4a1b3
vision module part of EnvObject
gabinsane Apr 12, 2024
8c6582a
further integration
gabinsane Apr 24, 2024
74a2486
first incorporation of RDDLWorld
gabinsane May 24, 2024
ec94394
objects spawned according to rddl
gabinsane May 31, 2024
61fcf62
reachabe borders
gabinsane May 31, 2024
30c4fa4
small refactor and comments
gabinsane Jun 4, 2024
21219f7
gripper bound to rddl, compute reward functional
gabinsane Jun 9, 2024
c557551
traintf2.py works with the env and config
gabinsane Jun 9, 2024
c741002
comments and commented out old functions
gabinsane Jun 15, 2024
62a6cfe
Update rllib.yml
gabinsane Jun 20, 2024
d8923d7
Update rllib.yml
gabinsane Jun 20, 2024
f70d630
Update rllib.yml
gabinsane Jun 20, 2024
73a182b
env fix
Jun 20, 2024
2825fa7
self robot bugfix
michalvavrecka Jul 12, 2024
61b0de1
robot variables still inaccessible
Jul 15, 2024
f1bfda9
Fixing "self" bug when calling robot functions
radoskov Jul 15, 2024
d80d1a9
minimal pipeline functional, problems with gym
Jul 15, 2024
86c1a37
Merge branch 'wip-rddl' of https://github.com/incognite-lab/myGym int…
Jul 15, 2024
5e9482d
traintf2 actually trains
Aug 2, 2024
b5c2f41
bugfix - myGym now works with latest prag(rddl) commit - 327684d
michalvavrecka Nov 8, 2024
b2cc0b1
task interfacing - WIP
michalvavrecka Nov 11, 2024
85d26ec
conda env cleaning and update - newest gymnasium and torch working - …
michalvavrecka Nov 18, 2024
eef7ee9
root clean, robot debug mode added
michalvavrecka Nov 19, 2024
87b59c3
root cleaning, pkg_resources update - wip - working
michalvavrecka Nov 19, 2024
0446beb
pkg_resources replaced by importlib. Yolact imported only when vision…
michalvavrecka Nov 21, 2024
d9a78c5
mujoco engine removed from the code
michalvavrecka Nov 21, 2024
e32eaea
gym replaced by gymnasium, gym dependecy removed, trainprag renamed
michalvavrecka Nov 21, 2024
44703ac
small updates
michalvavrecka Dec 2, 2024
dac0faa
install script update
michalvavrecka Dec 2, 2024
3739aef
Fixed non-PEP format of version of torch.
radoskov Dec 6, 2024
b33828d
Improved config path handling to look in the main package dir.
radoskov Dec 6, 2024
5ac218a
Small changes to make it work with prag
radoskov Dec 6, 2024
040d89f
Adjusted methods names to work with current version of RDDLTask
radoskov Dec 6, 2024
bccd299
small bugfix in task.py
michalvavrecka Jan 24, 2025
15b0b63
config bugfix
michalvavrecka Feb 4, 2025
548733a
Fix robot argument passing
radoskov Feb 24, 2025
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
2 changes: 1 addition & 1 deletion myGym/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file was generated by the setup.py and will be rewritten at the next build
__version__ = "2.2.2.dev279+g20c5920"
__version__ = "2.2.2.dev316+gb2cc0b1.d20241118"
__name__ = "myGym"
33 changes: 0 additions & 33 deletions myGym/atari-ddppo.yaml

This file was deleted.

86 changes: 0 additions & 86 deletions myGym/condaenv.e218cqgt.requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion myGym/configs/rllib_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"task_type" :"reach",
"natural_language" :0,
"task_objects" :[{"init":{"obj_name":"null"},
"goal":{"obj_name":"cube_holes","fixed":1,"rand_rot":0, "sampling_area":[-0.5, 0.2, 0.3, 0.6, 0.1, 0.4]}}],
"goal":{"obj_name":"apple_target","fixed":1,"rand_rot":0, "sampling_area":[-0.5, 0.2, 0.3, 0.6, 0.1, 0.4]}}],
"used_objects" :{"num_range":[0,0], "obj_list":[]},
// Observation
// actual_state options (pick one): "endeff_xyz", "endeff_6D" (robot end effector), "obj_xyz", "obj_6D", "vae", "yolact", "voxel" or "dope"
Expand Down
44 changes: 44 additions & 0 deletions myGym/configs/train_rddl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
#Environment
"env_name" :"Gym-v0",
"workspace" :"table",
"engine" :"pybullet",
"render" :"opengl",
"camera" :1,
"gui" :1,
"visualize" :1,
"visgym" :0,
#Robot
"robot" :"kuka",
"robot_action" :"step",
"robot_init" :[0.0, 0.4, 0.4],
"max_velocity" :1,
"max_force" :70,
"action_repeat" :1,
#Task
"natural_language" :0,
"rddl": {"protoactions":["Approach", "Grasp", "Move", "Drop"], "num_task_range":[1,3], "allowed_objects":["Apple", "Tuna", "Banana"], "allowed_predicates":["Near"]},
"observation" : {"actual_state":"obj_xyz", "goal_state":"obj_xyz"}, # this is ignored
#Distractor
"distractors" : {"list":null, "moveable":1, "constant_speed":0, "movement_dims":3,
"movement_endpoints":[-0.3, 0.3, 0.4, 0.7, 0.1, 0.3]},
#Reward
"vae_path" :null,
"yolact_path" :null,
"yolact_config" :null,
#Train
"train_framework" :"pytorch",
"algo" :"ppo",
"num_networks" : 1,
"max_episode_steps" :1024,
"algo_steps" :1024,
"steps" :200000,
"pretrained_model" :null,
"multiprocessing" :false,
#Evaluation
"eval_freq" :10000,
"eval_episodes" :10,
#Saving and logging
"logdir" :"trained_models/test",
"record" :0
}
2 changes: 0 additions & 2 deletions myGym/env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ matplotlib 3.1.3
mdurl 0.1.2
mpi4py 3.1.4
msgpack 1.0.5
mujoco-py 2.1.2.14
myGym 2.2.2.dev32+gd0bbd2d /home/michal/code/myGym
networkx 2.6.3
numpy 1.18.5
Expand Down Expand Up @@ -221,7 +220,6 @@ mistune 0.8.4
mpi4py 3.1.4
mpmath 1.3.0
msgpack 1.0.5
mujoco-py 2.1.2.14
myGym 2.2.2.dev32+gd0bbd2d /home/michal/code/myGym
networkx 2.6.3
nicomotion 1.0
Expand Down
2 changes: 1 addition & 1 deletion myGym/envs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from gym.envs.registration import register
from gymnasium.envs.registration import register

register(
id="CrowWorkspaceEnv-v0",
Expand Down
16 changes: 8 additions & 8 deletions myGym/envs/base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import pybullet_utils.bullet_client as bc
import time
import numpy as np
from gym.utils import seeding
import gym
from gymnasium.utils import seeding
import gymnasium as gym
import inspect
from myGym.envs.camera import Camera
import pkg_resources
currentdir = pkg_resources.resource_filename("myGym", "envs")
repodir = pkg_resources.resource_filename("myGym", "./")

import importlib.resources as resources
currentdir = resources.files("myGym").joinpath("envs")
repodir = resources.files("myGym").parent

class BaseEnv(gym.Env):
"""
Expand All @@ -30,7 +29,7 @@ class BaseEnv(gym.Env):

def __init__(self,
gui_on=True,
objects_dir_path=pkg_resources.resource_filename("myGym", "envs/"),
objects_dir_path=resources.files("myGym").joinpath("envs"),
max_steps=1024,
show_bounding_boxes_gui=False,
changing_light_gui=False,
Expand Down Expand Up @@ -73,6 +72,7 @@ def __init__(self,
self._set_physics()
self._setup_scene()
self._set_action_space()
self.obsdim = self.check_obs_template()
self._set_observation_space()


Expand Down Expand Up @@ -197,7 +197,7 @@ def _restart_episode(self):
self.episode_reward = 0.0
self.episode_steps = 0

def reset(self, hard=False):
def reset(self, hard=False,options=None):
"""
Reset the state of the environment
"""
Expand Down
Loading