From 47593785adf7146ae3aa877e1c22514a912090d2 Mon Sep 17 00:00:00 2001 From: Whi Kwon <30768596+whikwon@users.noreply.github.com> Date: Thu, 30 May 2019 22:01:43 +0900 Subject: [PATCH 1/4] Fix success_count not reset issue (#59) --- scripts/envs/open_manipulator/ros_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/envs/open_manipulator/ros_interface.py b/scripts/envs/open_manipulator/ros_interface.py index 1c681fc..e47c385 100755 --- a/scripts/envs/open_manipulator/ros_interface.py +++ b/scripts/envs/open_manipulator/ros_interface.py @@ -306,7 +306,6 @@ class OpenManipulatorRosBaseInterface(object): self.success_count += 1 if self.success_count == self.cfg["SUCCESS_COUNT"]: print ("Current episode succeeded") - self.success_count = 0 return True else: return False @@ -388,6 +387,7 @@ class OpenManipulatorRosGazeboInterface(OpenManipulatorRosBaseInterface): # self.delete_target_block() self.init_robot_pose() + self.success_count = 0 time.sleep(0.5) self.set_target_block(block_pose) From 09b1f2e9a8e57d5062e37abd0b002c29178d452a Mon Sep 17 00:00:00 2001 From: Whi Kwon <30768596+whikwon@users.noreply.github.com> Date: Thu, 30 May 2019 22:39:44 +0900 Subject: [PATCH 2/4] Fix episode unreset bug (#62) --- .../envs/open_manipulator/open_manipulator_reacher_env.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/envs/open_manipulator/open_manipulator_reacher_env.py b/scripts/envs/open_manipulator/open_manipulator_reacher_env.py index 1b2c730..7315b2f 100755 --- a/scripts/envs/open_manipulator/open_manipulator_reacher_env.py +++ b/scripts/envs/open_manipulator/open_manipulator_reacher_env.py @@ -76,10 +76,11 @@ class OpenManipulatorReacherEnv(gym.Env): if self.env_mode == "sim": self.reward = self.compute_reward() # TODO: Add termination condition - # if self.ros_interface.check_for_termination(): - # self.done = True + # if self.ros_interface.check_for_termination(): + # self.done = True if self.ros_interface.check_for_success(): self.done = True + self.episode_steps = 0 obs = self.ros_interface.get_observation() From 9264c03f76ddfaf7b5406776dae1892e12091267 Mon Sep 17 00:00:00 2001 From: Whi Kwon <30768596+whikwon@users.noreply.github.com> Date: Fri, 31 May 2019 15:23:59 +0900 Subject: [PATCH 3/4] Add installation guide for openmanipulator local training (#63) --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 35ed2fd..c92b750 100644 --- a/README.md +++ b/README.md @@ -97,8 +97,11 @@ wandb login #### OpenManipulator +Follow the ROS installation commands in [Dockerfile](https://github.com/kairproject/kair_algorithms_draft/blob/master/Dockerfile) to train. + ``` -python run_open_manipulator_reacher_v0.py --algo [algo] --off-render --log +roslaunch kair_algorithms open_manipulator_env.launch gui:=false & +rosrun run_open_manipulator_reacher_v0.py --algo [algo] --off-render --log ``` #### LunarLanderContinuous-v2 @@ -113,6 +116,27 @@ python run_lunarlander_continuous.py --algo [algo] --off-render --log python run_reacher_v1.py --algo [algo] --off-render --log ``` +## How to Test + +#### OpenManipulator + +``` +roslaunch kair_algorithms open_manipulator_env.launch gui:=false & +rosrun python run_open_manipulator_reacher_v0.py --algo [algo] --off-render --test --load-from [trained_weight_path] +``` + +#### LunarLanderContinuous-v2 + +``` +python run_lunarlander_continuous.py --algo [algo] --off-render --test --load-from [trained_weight_path] +``` + +#### Reacher-v1 + +``` +python run_reacher_v1.py --algo [algo] --off-render --test --load-from [trained_weight_path] +``` + ## How to Cite We are currently writing a white paper to summarize the results. We will add a BibTeX entry below once the paper is finalized. From 9c2475498cd0d4a9c49b45a90208f947a01b9bb2 Mon Sep 17 00:00:00 2001 From: Whi Kwon <30768596+whikwon@users.noreply.github.com> Date: Wed, 26 Jun 2019 23:33:38 +0900 Subject: [PATCH 4/4] Modify terminal done state (#65) --- scripts/envs/open_manipulator/open_manipulator_reacher_env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/envs/open_manipulator/open_manipulator_reacher_env.py b/scripts/envs/open_manipulator/open_manipulator_reacher_env.py index 7315b2f..3525ac3 100755 --- a/scripts/envs/open_manipulator/open_manipulator_reacher_env.py +++ b/scripts/envs/open_manipulator/open_manipulator_reacher_env.py @@ -85,7 +85,7 @@ class OpenManipulatorReacherEnv(gym.Env): obs = self.ros_interface.get_observation() if self.episode_steps == self._max_episode_steps: - self.done = True + self.done = False self.episode_steps = 0 return obs, self.reward_rescale_ratio * self.reward, self.done, None