def restart_sim(self, ):
        """Restart the simulated Robot Server.
        """

        self._kill_sim()
        self._start_sim()
        self.client = rs_client.Client(self.robot_server_ip)
예제 #2
0
파일: ur5.py 프로젝트: pockerman/robo-gym
    def __init__(self, rs_address=None, max_episode_steps=1000, **kwargs):

        self.ur5 = ur_utils.UR5()
        self.max_episode_steps = max_episode_steps
        self.elapsed_steps = 0
        self.observation_space = self._get_observation_space()
        self.action_space = spaces.Box(low=np.full((3), -1.0),
                                       high=np.full((3), 1.0),
                                       dtype=np.float32)
        self.seed()
        self.distance_threshold = 0.1
        self.abs_joint_pos_range = self.ur5.get_max_joint_positions()

        self.prev_rs_state = None

        self.last_position_on_success = []

        # Connect to Robot Server
        if rs_address:
            self.client = rs_client.Client(rs_address)
        else:
            print(
                "WARNING: No IP and Port passed. Simulation will not be started"
            )
            print("WARNING: Use this only to get environment shape")
예제 #3
0
    def __init__(self, rs_address=None, max_episode_steps=500, **kwargs):

        self.mir100 = mir100_utils.Mir100()
        self.max_episode_steps = max_episode_steps
        self.elapsed_steps = 0
        self.observation_space = self._get_observation_space()
        self.action_space = spaces.Box(low=np.full((2), -1.0),
                                       high=np.full((2), 1.0),
                                       dtype=np.float32)
        self.seed()
        self.distance_threshold = 0.2
        self.min_target_dist = 1.0
        # Maximum linear velocity (m/s) of MiR
        max_lin_vel = 0.5
        # Maximum angular velocity (rad/s) of MiR
        max_ang_vel = 0.7
        self.max_vel = np.array([max_lin_vel, max_ang_vel])

        # Connect to Robot Server
        if rs_address:
            self.client = rs_client.Client(rs_address)
        else:
            print(
                "WARNING: No IP and Port passed. Simulation will not be started"
            )
            print("WARNING: Use this only to get environment shape")
예제 #4
0
    def __init__(self, rs_address=None, **kwargs):

        self.ur10 = ur_utils.UR10()
        self.observation_space = self._get_observation_space()
        self.action_space = spaces.Box(low=np.full((6), -1.0), high=np.full((6), 1.0), dtype=np.float32)
        self.seed()
        self.distance_threshold = 0.1
        self.abs_joint_pos_range = self.ur10.get_max_joint_positions()

        # Connect to Robot Server
        if rs_address:
            self.client = rs_client.Client(rs_address)
        else:
            print("WARNING: No IP and Port passed. Simulation will not be started")
            print("WARNING: Use this only to get environment shape")
예제 #5
0
    def __init__(self, rs_address=None, rs_state_to_info=True, **kwargs):
        self.elapsed_steps = 0

        self.rs_state_to_info = rs_state_to_info

        self.observation_space = self._get_observation_space()
        self.action_space = self._get_action_space()

        self.rs_state = None

        # Connect to Robot Server
        if rs_address:
            self.client = rs_client.Client(rs_address)
        else:
            print(
                "WARNING: No IP and Port passed. Simulation will not be started"
            )
            print("WARNING: Use this only to get environment shape")
예제 #6
0
    def __init__(self,
                 rs_address=None,
                 fix_base=False,
                 fix_shoulder=False,
                 fix_elbow=False,
                 fix_wrist_1=False,
                 fix_wrist_2=False,
                 fix_wrist_3=True,
                 ur_model='ur5',
                 rs_state_to_info=True,
                 **kwargs):
        self.ur = ur_utils.UR(model=ur_model)
        self.elapsed_steps = 0

        self.rs_state_to_info = rs_state_to_info

        self.fix_base = fix_base
        self.fix_shoulder = fix_shoulder
        self.fix_elbow = fix_elbow
        self.fix_wrist_1 = fix_wrist_1
        self.fix_wrist_2 = fix_wrist_2
        self.fix_wrist_3 = fix_wrist_3

        self.observation_space = self._get_observation_space()
        self.action_space = self._get_action_space()
        self.abs_joint_pos_range = self.ur.get_max_joint_positions()

        self.rs_state = None

        # Connect to Robot Server
        if rs_address:
            self.client = rs_client.Client(rs_address)
        else:
            print(
                "WARNING: No IP and Port passed. Simulation will not be started"
            )
            print("WARNING: Use this only to get environment shape")