Skip to content

Commit

Permalink
new release
Browse files Browse the repository at this point in the history
  • Loading branch information
IanYangChina committed Nov 11, 2021
1 parent ac6ce19 commit c443c12
Show file tree
Hide file tree
Showing 11 changed files with 729 additions and 487 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Expired mujoco license got me here. I will also retrain those agents and pose pe

This package also provides some harder tasks for long-horizon sparse reward robotic arm manipulation tasks
on this package as well. All the environments have been summarised in a paper.
There are still on-going updates for this package, the [v1.0 release] is the one published on Taros 2021 and [ArXiv](https://arxiv.org/abs/2105.05985).
The newest release is the most recommended. There are still on-going updates for this package, the [v1.0 release] was the version published on Taros 2021 and
[ArXiv](https://arxiv.org/abs/2105.05985).

```
@article{xyangPMG,
Expand Down Expand Up @@ -64,6 +65,9 @@ See examples below.

### Try it out

See the [examples folder](https://github.com/IanYangChina/pybullet_multigoal_gym/tree/master/pybullet_multigoal_gym/examples)
for more scripts to play with.

```python
# Single-stage manipulation environments
# Reach, Push, PickAndPlace, Slide
Expand Down Expand Up @@ -91,36 +95,31 @@ camera_setup = [
env = pmg.make_env(
# task args ['reach', 'push', 'slide', 'pick_and_place',
# 'block_stack', 'block_rearrange', 'chest_pick_and_place', 'chest_push']
task='block_rearrange',
task='block_stack',
gripper='parallel_jaw',
num_block=4, # only meaningful for multi-block tasks
render=False,
num_block=4, # only meaningful for multi-block tasks, up to 5 blocks
render=True,
binary_reward=True,
max_episode_steps=5,
max_episode_steps=50,
# image observation args
image_observation=True,
depth_image=False,
goal_image=True,
visualize_target=True,
camera_setup=camera_setup,
observation_cam_id=0,
goal_cam_id=1,
# curriculum args
use_curriculum=True,
num_goals_to_generate=90)
goal_cam_id=1)

obs = env.reset()
t = 0
while True:
t += 1
action = env.action_space.sample()
obs, reward, done, info = env.step(action)
print('state: ', obs['state'], '\n',
'desired_goal: ', obs['desired_goal'], '\n',
'achieved_goal: ', obs['achieved_goal'], '\n',
'reward: ', reward, '\n')
plt.imshow(obs['observation'])
plt.pause(0.00001)
plt.pause(0.00001)
if done:
env.reset()
```
Expand All @@ -131,7 +130,7 @@ while True:

<img src="/src/MultiStepBenchmark.png" width="800"/>

### Updates
### Update log

2020.12.26 --- Add hierarchical environments for a pick and place task, with image observation and goal supported.
See the above example.
Expand All @@ -149,3 +148,5 @@ See the above example.
2021.03.17 --- Joint space control support

2021.03.18 --- Finish curriculum; add on-hand camera observation

2021.11.11 --- Finish task decomposition, subgoal generation codes and some compatibility issues, new release
7 changes: 3 additions & 4 deletions pybullet_multigoal_gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def print_id():


def make_env(task='reach', gripper='parallel_jaw', num_block=5, render=False, binary_reward=True,
task_decomposition=False, abstract_demonstration=False,
grip_informed_goal=False,
task_decomposition=False,
joint_control=False, max_episode_steps=50, distance_threshold=0.05,
image_observation=False, depth_image=False, goal_image=False, visualize_target=True,
camera_setup=None, observation_cam_id=0, goal_cam_id=0,
Expand Down Expand Up @@ -129,8 +130,6 @@ def make_env(task='reach', gripper='parallel_jaw', num_block=5, render=False, bi
max_episode_steps=max_episode_steps,
)
else:
# if task == 'block_stack':
# assert num_block >= 2, "need at least 2 blocks to stack"
assert num_block <= 5, "only support up to 5 blocks"
register(
id=env_id,
Expand All @@ -141,7 +140,6 @@ def make_env(task='reach', gripper='parallel_jaw', num_block=5, render=False, bi
'joint_control': joint_control,
'distance_threshold': distance_threshold,
'task_decomposition': task_decomposition,
'abstract_demonstration': abstract_demonstration,
'image_observation': image_observation,
'depth_image': depth_image,
'goal_image': goal_image,
Expand All @@ -150,6 +148,7 @@ def make_env(task='reach', gripper='parallel_jaw', num_block=5, render=False, bi
'observation_cam_id': observation_cam_id,
'goal_cam_id': goal_cam_id,
'gripper_type': gripper,
'grip_informed_goal': grip_informed_goal,
'num_block': num_block,
'use_curriculum': use_curriculum,
'num_goals_to_generate': int(num_goals_to_generate)
Expand Down
Loading

0 comments on commit c443c12

Please sign in to comment.