updates on mp wrappers and some bugfixes
This commit is contained in:
@@ -7,10 +7,10 @@ from gym.utils import seeding
|
||||
from matplotlib import patches
|
||||
|
||||
from alr_envs.classic_control.utils import check_self_collision
|
||||
from alr_envs.utils.mps.mp_environments import MPEnv
|
||||
from alr_envs.utils.mps.mp_environments import AlrEnv
|
||||
|
||||
|
||||
class HoleReacherEnv(MPEnv):
|
||||
class HoleReacherEnv(AlrEnv):
|
||||
|
||||
def __init__(self, n_links: int, hole_x: Union[None, float] = None, hole_depth: Union[None, float] = None,
|
||||
hole_width: float = 1., random_start: bool = False, allow_self_collision: bool = False,
|
||||
@@ -71,11 +71,11 @@ class HoleReacherEnv(MPEnv):
|
||||
A single step with an action in joint velocity space
|
||||
"""
|
||||
|
||||
acc = (action - self._angle_velocity) / self.dt
|
||||
self._angle_velocity = action
|
||||
self._joint_angles = self._joint_angles + self.dt * self._angle_velocity
|
||||
self._update_joints()
|
||||
|
||||
acc = (action - self._angle_velocity) / self.dt
|
||||
reward, info = self._get_reward(acc)
|
||||
|
||||
info.update({"is_collided": self._is_collided})
|
||||
|
||||
@@ -5,10 +5,10 @@ import numpy as np
|
||||
from gym import spaces
|
||||
from gym.utils import seeding
|
||||
|
||||
from alr_envs.utils.mps.mp_environments import MPEnv
|
||||
from alr_envs.utils.mps.mp_environments import AlrEnv
|
||||
|
||||
|
||||
class SimpleReacherEnv(MPEnv):
|
||||
class SimpleReacherEnv(AlrEnv):
|
||||
"""
|
||||
Simple Reaching Task without any physics simulation.
|
||||
Returns no reward until 150 time steps. This allows the agent to explore the space, but requires precise actions
|
||||
|
||||
@@ -6,10 +6,10 @@ import numpy as np
|
||||
from gym.utils import seeding
|
||||
|
||||
from alr_envs.classic_control.utils import check_self_collision
|
||||
from alr_envs.utils.mps.mp_environments import MPEnv
|
||||
from alr_envs.utils.mps.mp_environments import AlrEnv
|
||||
|
||||
|
||||
class ViaPointReacher(MPEnv):
|
||||
class ViaPointReacher(AlrEnv):
|
||||
|
||||
def __init__(self, n_links, random_start: bool = True, via_target: Union[None, Iterable] = None,
|
||||
target: Union[None, Iterable] = None, allow_self_collision=False, collision_penalty=1000):
|
||||
|
||||
Reference in New Issue
Block a user