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:
@@ -1,9 +1,9 @@
|
||||
#! usr/bin/env python
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
import numpy as np
|
||||
from gym.utils import seeding
|
||||
|
||||
from ros_interface import (
|
||||
OpenManipulatorRosGazeboInterface,
|
||||
OpenManipulatorRosRealInterface,
|
||||
@@ -78,16 +78,15 @@ class OpenManipulatorReacherEnv(gym.Env):
|
||||
# TODO: Add termination condition
|
||||
# if self.ros_interface.check_for_termination():
|
||||
# self.done = True
|
||||
if self.ros_interface.check_for_success():
|
||||
if (
|
||||
self.ros_interface.check_for_success()
|
||||
or self.episode_steps == self._max_episode_steps
|
||||
):
|
||||
self.done = True
|
||||
self.episode_steps = 0
|
||||
|
||||
obs = self.ros_interface.get_observation()
|
||||
|
||||
if self.episode_steps == self._max_episode_steps:
|
||||
self.done = False
|
||||
self.episode_steps = 0
|
||||
|
||||
return obs, self.reward_rescale_ratio * self.reward, self.done, None
|
||||
|
||||
def reset(self):
|
||||
|
||||
@@ -6,6 +6,8 @@ from math import cos, sin
|
||||
|
||||
import gym
|
||||
import numpy as np
|
||||
|
||||
import rospkg # noqa
|
||||
import rospy # noqa
|
||||
import tf # noqa
|
||||
import tf.transformations as tr # noqa
|
||||
@@ -16,8 +18,6 @@ from sensor_msgs.msg import JointState
|
||||
from std_msgs.msg import Float64
|
||||
from urdf_parser_py.urdf import URDF # noqa
|
||||
|
||||
import rospkg # noqa
|
||||
|
||||
|
||||
class OpenManipulatorRosBaseInterface(object):
|
||||
"""Open Manipulator Interface based on ROS."""
|
||||
|
||||
Reference in New Issue
Block a user