Skip to content

Commit

Permalink
Change src folder name
Browse files Browse the repository at this point in the history
- adjust setup and versioning for pypi
  • Loading branch information
frankroeder committed Jun 30, 2022
1 parent bb4c27d commit e2056da
Show file tree
Hide file tree
Showing 34 changed files with 87 additions and 83 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pip install git+ssh://[email protected]/frankroeder/lanro-gym.git

```python
import gym
import lanro
import lanro_gym

env = gym.make('PandaStack2-v0', render=True)

Expand All @@ -46,7 +46,7 @@ env.close()

## Environments

[Click here for the environments README](./lanro/environments/README.md)
[Click here for the environments README](./lanro_gym/environments/README.md)

## Keyboard and mouse control
It is also possible to manipulate the robot with sliders
Expand Down
2 changes: 1 addition & 1 deletion examples/scripted_grasping.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A script to demonstrate grasping."""
import gym
import lanro
import lanro_gym
import numpy as np

env = gym.make("PandaNLLift3Shape-v0", render=True)
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions lanro/__init__.py → lanro_gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
}
register(
id=f'{robot}Reach{_r_type}-v0',
entry_point='lanro.environments:{}ReachEnv'.format(robot),
entry_point='lanro_gym.environments:{}ReachEnv'.format(robot),
max_episode_steps=50,
kwargs=kwargs,
)
register(
id=f'{robot}Push{_r_type}-v0',
entry_point='lanro.environments:{}PushEnv'.format(robot),
entry_point='lanro_gym.environments:{}PushEnv'.format(robot),
max_episode_steps=50,
kwargs=kwargs,
)
register(
id=f'{robot}Slide{_r_type}-v0',
entry_point='lanro.environments:{}SlideEnv'.format(robot),
entry_point='lanro_gym.environments:{}SlideEnv'.format(robot),
max_episode_steps=50,
kwargs=kwargs,
)
register(
id=f'{robot}PickAndPlace{_r_type}-v0',
entry_point='lanro.environments:{}StackEnv'.format(robot),
entry_point='lanro_gym.environments:{}StackEnv'.format(robot),
max_episode_steps=50,
kwargs={
**kwargs,
Expand All @@ -37,7 +37,7 @@
for num_obj in [2, 3, 4]:
register(
id=f'{robot}Stack{num_obj}{_r_type}-v0',
entry_point='lanro.environments:{}StackEnv'.format(robot),
entry_point='lanro_gym.environments:{}StackEnv'.format(robot),
max_episode_steps=50 * num_obj,
kwargs={
**kwargs, 'num_obj': num_obj
Expand Down Expand Up @@ -72,18 +72,18 @@
param_combination = f"{num_obj}{_current_mode}{_current_obstype}{_current_h_instr}"

register(id=f'{robot}NLReach{param_combination}-v0',
entry_point='lanro.environments:{}NLReachEnv'.format(robot),
entry_point='lanro_gym.environments:{}NLReachEnv'.format(robot),
max_episode_steps=_max_episode_steps,
kwargs=_kwargs)
register(id=f'{robot}NLPush{param_combination}-v0',
entry_point='lanro.environments:{}NLPushEnv'.format(robot),
entry_point='lanro_gym.environments:{}NLPushEnv'.format(robot),
max_episode_steps=_max_episode_steps,
kwargs=_kwargs)
register(id=f'{robot}NLGrasp{param_combination}-v0',
entry_point='lanro.environments:{}NLGraspEnv'.format(robot),
entry_point='lanro_gym.environments:{}NLGraspEnv'.format(robot),
max_episode_steps=_max_episode_steps,
kwargs=_kwargs)
register(id=f'{robot}NLLift{param_combination}-v0',
entry_point='lanro.environments:{}NLLiftEnv'.format(robot),
entry_point='lanro_gym.environments:{}NLLiftEnv'.format(robot),
max_episode_steps=_max_episode_steps,
kwargs=_kwargs)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from lanro.robotenv import RobotEnv
from lanro.simulation import PyBulletSimulation
from lanro.robots import Panda
from lanro.tasks import Reach, Push, Stack, Slide
from lanro_gym.robotenv import RobotEnv
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.robots import Panda
from lanro_gym.tasks import Reach, Push, Stack, Slide


class PandaReachEnv(RobotEnv):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from lanro.robotenv import RobotLanguageEnv
from lanro.simulation import PyBulletSimulation
from lanro.robots import Panda
from lanro.tasks import NLReach, NLLift, NLGrasp, NLPush
from lanro_gym.robotenv import RobotLanguageEnv
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.robots import Panda
from lanro_gym.tasks import NLReach, NLLift, NLGrasp, NLPush


class PandaNLReachEnv(RobotLanguageEnv):
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions lanro/robotenv.py → lanro_gym/robotenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from gym import spaces
import numpy as np

from lanro.language_utils import Vocabulary, parse_instructions
from lanro.robots import PyBulletRobot
from lanro.simulation import PyBulletSimulation
from lanro.tasks.core import LanguageTask, Task
from lanro_gym.language_utils import Vocabulary, parse_instructions
from lanro_gym.robots import PyBulletRobot
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.core import LanguageTask, Task

gym.logger.set_level(40)

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions lanro/robots/panda.py → lanro_gym/robots/panda.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List
from lanro.simulation import PyBulletSimulation
import numpy as np
from lanro.robots.pybrobot import PyBulletRobot
import lanro.utils as play_utils
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.robots.pybrobot import PyBulletRobot
import lanro_gym.utils as play_utils


class Panda(PyBulletRobot):
Expand Down
4 changes: 2 additions & 2 deletions lanro/robots/pybrobot.py → lanro_gym/robots/pybrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from gym import spaces
from typing import Callable, Dict, List, Optional
import numpy as np
from lanro.simulation import PyBulletSimulation
from lanro.utils import RGBCOLORS
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.utils import RGBCOLORS

DEBUG = int("DEBUG" in os.environ and os.environ["DEBUG"])
JointInfo = namedtuple('JointInfo', [
Expand Down
2 changes: 1 addition & 1 deletion lanro/simulation.py → lanro_gym/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pybullet_utils import bullet_client
from contextlib import contextmanager
import time
import lanro.utils as play_utils
import lanro_gym.utils as play_utils
import numpy as np
import warnings

Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions lanro/tasks/core.py → lanro_gym/tasks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from gym import utils as gym_utils
import numpy as np

from lanro.robots.pybrobot import PyBulletRobot
from lanro.simulation import PyBulletSimulation
from lanro.tasks.scene import basic_scene
import lanro.utils as play_utils
from lanro.utils import TaskObjectList
from lanro.language_utils import create_commands
from lanro_gym.robots.pybrobot import PyBulletRobot
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.scene import basic_scene
from lanro_gym.utils import TaskObjectList
from lanro_gym.language_utils import create_commands
import lanro_gym.utils as play_utils


class Task:
Expand Down
6 changes: 3 additions & 3 deletions lanro/tasks/nlgrasp.py → lanro_gym/tasks/nlgrasp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from lanro.robots import PyBulletRobot
from lanro.simulation import PyBulletSimulation
from lanro.tasks.nllift import NLLift
from lanro_gym.robots import PyBulletRobot
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.nllift import NLLift


class NLGrasp(NLLift):
Expand Down
8 changes: 4 additions & 4 deletions lanro/tasks/nllift.py → lanro_gym/tasks/nllift.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from lanro.robots import PyBulletRobot
from lanro.simulation import PyBulletSimulation
from lanro.tasks.core import LanguageTask
from lanro.tasks.scene import basic_scene
from lanro_gym.robots import PyBulletRobot
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.core import LanguageTask
from lanro_gym.tasks.scene import basic_scene


class NLLift(LanguageTask):
Expand Down
10 changes: 5 additions & 5 deletions lanro/tasks/nlpush.py → lanro_gym/tasks/nlpush.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from lanro.robots import PyBulletRobot
from lanro.simulation import PyBulletSimulation
from lanro.tasks.core import LanguageTask
from lanro.tasks.scene import basic_scene
from lanro.utils import goal_distance
from lanro_gym.robots import PyBulletRobot
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.core import LanguageTask
from lanro_gym.tasks.scene import basic_scene
from lanro_gym.utils import goal_distance


class NLPush(LanguageTask):
Expand Down
8 changes: 4 additions & 4 deletions lanro/tasks/nlreach.py → lanro_gym/tasks/nlreach.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from lanro.robots import PyBulletRobot
import numpy as np
from lanro.tasks.core import LanguageTask
from lanro.simulation import PyBulletSimulation
from lanro.utils import goal_distance
from lanro_gym.robots import PyBulletRobot
from lanro_gym.tasks.core import LanguageTask
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.utils import goal_distance


class NLReach(LanguageTask):
Expand Down
8 changes: 4 additions & 4 deletions lanro/tasks/push.py → lanro_gym/tasks/push.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from lanro.tasks.core import Task
from lanro.simulation import PyBulletSimulation
from lanro.tasks.scene import basic_scene
from lanro.utils import RGBCOLORS
from lanro_gym.tasks.core import Task
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.scene import basic_scene
from lanro_gym.utils import RGBCOLORS


class Push(Task):
Expand Down
8 changes: 4 additions & 4 deletions lanro/tasks/reach.py → lanro_gym/tasks/reach.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from typing import Callable
from lanro.tasks.core import Task
from lanro.simulation import PyBulletSimulation
from lanro.tasks.scene import basic_scene
from lanro.utils import RGBCOLORS
from lanro_gym.tasks.core import Task
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.scene import basic_scene
from lanro_gym.utils import RGBCOLORS


class Reach(Task):
Expand Down
2 changes: 1 addition & 1 deletion lanro/tasks/scene.py → lanro_gym/tasks/scene.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from lanro.simulation import PyBulletSimulation
from lanro_gym.simulation import PyBulletSimulation

PLANE_COLOR = [0.37, 0.37, 0.37, 1]
TABLE_COLOR = [0.95, 0.95, 0.95, 1]
Expand Down
8 changes: 4 additions & 4 deletions lanro/tasks/slide.py → lanro_gym/tasks/slide.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from lanro.tasks.core import Task
from lanro.simulation import PyBulletSimulation
from lanro.tasks.scene import basic_scene
from lanro.utils import RGBCOLORS
from lanro_gym.tasks.core import Task
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.scene import basic_scene
from lanro_gym.utils import RGBCOLORS

SLIDE_OBJ_SIZE: float = 0.06

Expand Down
8 changes: 4 additions & 4 deletions lanro/tasks/stack.py → lanro_gym/tasks/stack.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from typing import Tuple
from lanro.tasks.core import Task
from lanro.simulation import PyBulletSimulation
from lanro.tasks.scene import basic_scene
from lanro.utils import RGBCOLORS
from lanro_gym.tasks.core import Task
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.tasks.scene import basic_scene
from lanro_gym.utils import RGBCOLORS


class Stack(Task):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gym
import os
import numpy as np
import lanro
import lanro_gym
import argparse
import glfw

Expand Down
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import os
from setuptools import setup, find_packages

with open("README.md", "r") as f:
long_description = f.read()

with open(os.path.join("lanro_gym", "VERSION"), "r") as f:
__version__ = f.read().strip()

setup(
name="lanro_gym",
description="OpenAI Gym multi-goal environments for goal-conditioned and language-conditioned deep reinforcement learning build with PyBullet",
Expand All @@ -12,10 +16,10 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/frankroeder/lanro-gym",
packages=find_packages(),
package_data={},
packages=[package for package in find_packages() if package.startswith("lanro_gym")],
package_data={ "lanro_gym": ["VERSION"] },
include_package_data=True,
version=open("LANRO_VERSION").read().strip(),
version=__version__,
install_requires=["gym", "pybullet", "numpy"],
extras_require={"dev": ["pytest", "yapf", "ipdb", "glfw"]},
python_requires=">=3.6",
Expand Down
2 changes: 1 addition & 1 deletion test/env_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gym
import numpy as np
import lanro
import lanro_gym


def test_env_open_close():
Expand Down
4 changes: 2 additions & 2 deletions test/nl_env_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import gym
import lanro
from lanro.language_utils import parse_instructions
import lanro_gym
from lanro_gym.language_utils import parse_instructions


def check_instruction(env, obs):
Expand Down
4 changes: 2 additions & 2 deletions test/nl_utils_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from lanro.language_utils import parse_instructions, create_commands, Vocabulary
from lanro.utils import SHAPES, RGBCOLORS
from lanro_gym.language_utils import parse_instructions, create_commands, Vocabulary
from lanro_gym.utils import SHAPES, RGBCOLORS


def test_parse_instruction():
Expand Down
4 changes: 2 additions & 2 deletions test/pybrobot_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lanro.simulation import PyBulletSimulation
from lanro.robots import Panda
from lanro_gym.simulation import PyBulletSimulation
from lanro_gym.robots import Panda


def test_panda_robot_state_obs():
Expand Down
2 changes: 1 addition & 1 deletion test/simulation_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from lanro.simulation import PyBulletSimulation
from lanro_gym.simulation import PyBulletSimulation


def test_init_step_close():
Expand Down
4 changes: 2 additions & 2 deletions test/utils_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from lanro.utils import TaskObject, TaskObjectList, RGBCOLORS, SHAPES, get_one_hot_list
from lanro.simulation import PyBulletSimulation
from lanro_gym.utils import TaskObject, TaskObjectList, RGBCOLORS, SHAPES, get_one_hot_list
from lanro_gym.simulation import PyBulletSimulation


def test_task_object():
Expand Down

0 comments on commit e2056da

Please sign in to comment.