Skip to content

Commit 7f3da9d

Browse files
committed
give reachy_config to ControlIK
1 parent 8140c0f commit 7f3da9d

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

pollen_kdl_kinematics/pollen_kdl_kinematics/pollen_kdl_kinematics_node.py

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from rclpy.qos import (HistoryPolicy, QoSDurabilityPolicy, QoSProfile,
1414
ReliabilityPolicy)
1515
from reachy2_symbolic_ik.control_ik import ControlIK
16+
17+
from reachy_utils.config import ReachyConfig
1618
from reachy2_symbolic_ik.symbolic_ik import SymbolicIK
1719
from reachy2_symbolic_ik.utils import (allow_multiturn,
1820
get_best_continuous_theta,
@@ -71,36 +73,12 @@ def __init__(self):
7173
)
7274

7375
self.orbita3D_max_angle = np.deg2rad(42.5) # 43.5 is too much
74-
# Symbolic IK inits.
75-
# A balanced position between elbow down and elbow at 90°
76-
# self.prefered_theta = -4 * np.pi / 6 # 5 * np.pi / 4 # np.pi / 4
77-
# self.nb_search_points = 20
78-
# self.previous_theta = {}
79-
# self.previous_sol = {}
8076

8177
for prefix in ("l", "r"):
8278
arm = f"{prefix}_arm"
8379

8480
chain, fk_solver, ik_solver = generate_solver(self.urdf, "torso", f"{prefix}_arm_tip")
8581

86-
# self.symbolic_ik_solver[arm] = SymbolicIK(
87-
# arm=arm,
88-
# upper_arm_size=0.28,
89-
# forearm_size=0.28,
90-
# gripper_size=0.10,
91-
# wrist_limit=np.rad2deg(self.orbita3D_max_angle),
92-
# # This is the "correct" stuff for alpha
93-
# # shoulder_orientation_offset=[10, 0, 15],
94-
# # elbow_orientation_offset=[0, 0, 0],
95-
# # This is the "wrong" values currently used by the alpha
96-
# # shoulder_orientation_offset=[0, 0, 15],
97-
# # shoulder_position=[-0.0479, -0.1913, 0.025],
98-
# )
99-
100-
# self.previous_theta[arm] = None
101-
# self.previous_sol[arm] = None
102-
# self.last_call_t[arm] = 0
103-
10482
# We automatically loads the kinematics corresponding to the config
10583
if chain.getNrOfJoints():
10684
self.logger.info(f'Found kinematics chain for "{arm}"!')
@@ -299,11 +277,15 @@ def __init__(self):
299277
self.chain["l_arm"].getNrOfJoints(),
300278
)
301279
current_pose = [current_pose_r, current_pose_l]
280+
281+
reachy_config = ReachyConfig()
282+
302283
self.control_ik = ControlIK(
303284
logger=self.logger,
304285
current_joints=current_joints,
305286
current_pose=current_pose,
306287
urdf=self.urdf,
288+
reachy_model=reachy_config.model,
307289
)
308290

309291
self.logger.info(f"Kinematics node ready!")

0 commit comments

Comments
 (0)