Skip to content

Commit

Permalink
[fix] fix seq retargeting reset bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqin committed Jul 3, 2024
1 parent 63f0a7c commit 953ead2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion dex_retargeting/retargeting_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ class RetargetingConfig:
# For example, Allegro is 1.6 times larger than normal human hand, then this scaling factor should be 1.6
scaling_factor: float = 1.0

# Optimization hyperparameter
# Optimization parameters
normal_delta: float = 4e-3
huber_delta: float = 2e-2

# DexPilot optimizer parameters
project_dist: float = 0.03
escape_dist: float = 0.05

# Joint limit tag
has_joint_limits: bool = True

Expand Down Expand Up @@ -191,6 +195,8 @@ def build(self) -> SeqRetargeting:
wrist_link_name=self.wrist_link_name,
target_link_human_indices=self.target_link_human_indices,
scaling=self.scaling_factor,
project_dist=self.project_dist,
escape_dist=self.escape_dist,
)
else:
raise RuntimeError()
Expand Down
2 changes: 1 addition & 1 deletion dex_retargeting/seq_retarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def verbose(self):
print(f"Last distance: {min_value}")

def reset(self):
self.last_qpos = self.joint_limits.mean(1)[self.optimizer.idx_pin2target]
self.last_qpos = self.joint_limits.mean(1).astype(np.float32)
self.num_retargeting = 0
self.accumulated_time = 0

Expand Down

0 comments on commit 953ead2

Please sign in to comment.