Skip to content

Commit

Permalink
Merge pull request #593 from ARISE-Initiative/osc-position-fixes
Browse files Browse the repository at this point in the history
osc position fixes
  • Loading branch information
kevin-thankyou-lin authored Dec 17, 2024
2 parents b954444 + 8b02592 commit b59fa7a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions robosuite/controllers/parts/arm/osc.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,17 @@ def set_goal(self, action):
if self.input_type == "delta":
scaled_delta = self.scale_action(delta)
self.goal_pos = self.compute_goal_pos(scaled_delta[0:3])
self.goal_ori = self.compute_goal_ori(scaled_delta[3:6])
if self.use_ori is True:
self.goal_ori = self.compute_goal_ori(scaled_delta[3:6])
else:
self.goal_ori = self.compute_goal_ori(np.zeros(3))
# Else, interpret actions as absolute values
elif self.input_type == "absolute":
self.goal_pos = action[0:3]
self.goal_ori = Rotation.from_rotvec(action[3:6]).as_matrix()
if self.use_ori is True:
self.goal_ori = Rotation.from_rotvec(action[3:6]).as_matrix()
else:
self.goal_ori = self.compute_goal_ori(np.zeros(3))
else:
raise ValueError(f"Unsupport input_type {self.input_type}")

Expand Down

0 comments on commit b59fa7a

Please sign in to comment.