mirror of
https://github.com/wassname/kair_algorithms_draft.git
synced 2026-09-09 11:25:10 +08:00
Merge branch 'master' into feat/demo_refactoring
This commit is contained in:
@@ -76,15 +76,16 @@ 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()
|
||||
|
||||
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user