Skip to content

Commit 34e1ee9

Browse files
committed
changed inverse_kinematics to take instance of Configuration
1 parent 9ab48c8 commit 34e1ee9

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/compas_fab/backends/ros/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,14 @@ def load_robot(self, load_geometry=False, urdf_param_name='/robot_description',
170170
return Robot(model, semantics=semantics, client=self)
171171

172172
def inverse_kinematics(self, frame, base_link, group,
173-
joint_names, joint_positions, avoid_collisions=True,
173+
start_configuration, avoid_collisions=True,
174174
constraints=None, attempts=8,
175175
attached_collision_meshes=None):
176176
kwargs = {}
177177
kwargs['frame'] = frame
178178
kwargs['base_link'] = base_link
179179
kwargs['group'] = group
180-
kwargs['joint_names'] = joint_names
181-
kwargs['joint_positions'] = joint_positions
180+
kwargs['start_configuration'] = start_configuration
182181
kwargs['avoid_collisions'] = avoid_collisions
183182
kwargs['constraints'] = constraints
184183
kwargs['attempts'] = attempts

src/compas_fab/backends/ros/planner_backend_moveit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ def dispose_planner(self):
118118
# ==========================================================================
119119

120120
def inverse_kinematics_async(self, callback, errback, frame, base_link, group,
121-
joint_names, joint_positions, avoid_collisions=True,
121+
start_configuration, avoid_collisions=True,
122122
constraints=None, attempts=8, attached_collision_meshes=None):
123123
"""Asynchronous handler of MoveIt IK service."""
124124
header = Header(frame_id=base_link)
125125
pose = Pose.from_frame(frame)
126126
pose_stamped = PoseStamped(header, pose)
127127
joint_state = JointState(
128-
name=joint_names, position=joint_positions, header=header)
128+
name=start_configuration.joint_names, position=start_configuration.values, header=header)
129129
start_state = RobotState(
130130
joint_state, MultiDOFJointState(header=header))
131131
if attached_collision_meshes:

src/compas_fab/robots/robot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ def inverse_kinematics(self, frame_WCF, start_configuration=None,
963963

964964
# The returned joint names might be more than the requested ones if there are passive joints present
965965
joint_positions, joint_names = self.client.inverse_kinematics(frame_WCF_scaled, self.model.root.name,
966-
group, start_configuration_scaled.joint_names, start_configuration_scaled.values,
966+
group, start_configuration_scaled,
967967
avoid_collisions, constraints, attempts,
968968
attached_collision_meshes)
969969
if full_joint_state:

0 commit comments

Comments
 (0)