Skip to content

Commit 8fa878c

Browse files
committed
Updated arm AR demo
1 parent 85b8ec3 commit 8fa878c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

kits/arm/ar_control_sm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def __init__(self, arm: 'Arm'):
5858

5959
self.last_locked_xyz = self.arm_xyz_home.copy()
6060
self.last_locked_rot = self.arm_rot_home.copy()
61+
self.last_locked_seed = self.arm_home.copy()
6162

6263
self.locked = True
6364

@@ -101,9 +102,10 @@ def update(self, t_now: float, arm_input: 'Optional[ArmMobileIOInputs]'):
101102
self.phone_xyz_home = arm_input.phone_pos
102103
self.phone_rot_home = arm_input.phone_rot
103104

105+
self.last_locked_seed = np.array(self.arm.last_feedback.position)
104106
xyz = np.zeros(3)
105107
orientation = np.zeros((3,3))
106-
self.arm.FK(np.array(self.arm.last_feedback.position), xyz_out=xyz, orientation_out=orientation)
108+
self.arm.FK(self.arm.last_feedback.position, xyz_out=xyz, orientation_out=orientation)
107109

108110
self.last_locked_xyz = xyz
109111
self.last_locked_rot = orientation
@@ -127,9 +129,10 @@ def update(self, t_now: float, arm_input: 'Optional[ArmMobileIOInputs]'):
127129
self.phone_xyz_home = arm_input.phone_pos
128130
self.phone_rot_home = arm_input.phone_rot
129131

132+
self.last_locked_seed = np.array(self.arm.last_feedback.position)
130133
xyz = np.zeros(3)
131134
orientation = np.zeros((3,3))
132-
self.arm.FK(np.array(self.arm.last_feedback.position), xyz_out=xyz, orientation_out=orientation)
135+
self.arm.FK(self.arm.last_feedback.position, xyz_out=xyz, orientation_out=orientation)
133136

134137
self.last_locked_xyz = xyz
135138
self.last_locked_rot = orientation
@@ -171,7 +174,7 @@ def compute_arm_goal(self, arm_input: ArmMobileIOInputs):
171174
arm_rot_target = rot_mat.T @ arm_input.phone_rot @ self.last_locked_rot
172175

173176
joint_target = self.arm.ik_target_xyz_so3(
174-
self.arm_seed_ik,
177+
self.last_locked_seed,
175178
arm_xyz_target,
176179
arm_rot_target)
177180

0 commit comments

Comments
 (0)