Skip to content

Commit 8970acf

Browse files
committed
feat: add tquat_flange to robot observation
1 parent 381ed09 commit 8970acf

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎python/rcs/envs/base.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ class TQuatDictType(RCSpaceType):
6565
dtype=np.float64,
6666
),
6767
]
68+
tquat_flange: Annotated[
69+
Vec7Type,
70+
gym.spaces.Box(
71+
low=np.array([-0.855, -0.855, -1] + [-1] + [-np.inf] * 3),
72+
high=np.array([0.855, 0.855, 1.188] + [1] + [np.inf] * 3),
73+
dtype=np.float64,
74+
),
75+
]
6876

6977

7078
class LimitedTQuatRelDictType(RCSpaceType):
@@ -346,6 +354,12 @@ def get_robot_obs(self) -> ArmObsType:
346354
),
347355
joints=self.robot.get_joint_position(),
348356
xyzrpy=self.robot.get_cartesian_position().xyzrpy(),
357+
tquat_flange=np.concatenate(
358+
[
359+
self.robot.get_cartesian_flange_position().translation(),
360+
self.robot.get_cartesian_flange_position().rotation_q(),
361+
]
362+
),
349363
)
350364

351365
def action(self, action: dict[str, Any]) -> dict[str, Any]:

0 commit comments

Comments
 (0)