Skip to content

Commit

Permalink
add version check in IK solver to support old versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mj-hwang committed Oct 24, 2023
1 parent f5344f8 commit be8c9bd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions omnigibson/utils/control_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lula
import numpy as np
import omnigibson.utils.transform_utils as T
from omnigibson.utils.sim_utils import meets_minimum_isaac_version


class IKSolver:
Expand Down Expand Up @@ -65,9 +66,15 @@ def solve(
self.config.cspace_seeds = [initial_joint_pos]
self.config.position_tolerance = tolerance_pos
self.config.orientation_tolerance = 100.0 if target_quat is None else tolerance_quat
self.config.ccd_position_weight = weight_pos
self.config.ccd_orientation_weight = 0.0 if target_quat is None else weight_quat
self.config.max_num_descents = max_iterations

if meets_minimum_isaac_version("2023.0.0"):
self.config.ccd_position_weight = weight_pos
self.config.ccd_orientation_weight = 0.0 if target_quat is None else weight_quat
self.config.max_num_descents = max_iterations
else:
self.config.position_weight = weight_pos
self.config.orientation_weight = 0.0 if target_quat is None else weight_quat
self.config.max_iterations_per_descent = max_iterations

# Compute target joint positions
ik_results = lula.compute_ik_ccd(self.kinematics, ik_target_pose, self.eef_name, self.config)
Expand Down

0 comments on commit be8c9bd

Please sign in to comment.