Skip to content

Commit fd3fbb4

Browse files
inverse_kinematics_async goal constraints
1 parent 59296f0 commit fd3fbb4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/compas_fab/backends/ros/planner_backend_moveit.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,22 @@ def inverse_kinematics_async(self, callback, errback, frame, base_link, group,
132132
for acm in attached_collision_meshes:
133133
aco = AttachedCollisionObject.from_attached_collision_mesh(acm)
134134
start_state.attached_collision_objects.append(aco)
135+
136+
# constraints
137+
ik_constraints = Constraints()
138+
for c in constraints:
139+
if c.type == c.JOINT:
140+
ik_constraints.joint_constraints.append(
141+
JointConstraint.from_joint_constraint(c))
142+
elif c.type == c.POSITION:
143+
ik_constraints.position_constraints.append(
144+
PositionConstraint.from_position_constraint(header, c))
145+
elif c.type == c.ORIENTATION:
146+
ik_constraints.orientation_constraints.append(
147+
OrientationConstraint.from_orientation_constraint(header, c))
148+
else:
149+
raise NotImplementedError
150+
constraints = ik_constraints
135151

136152
ik_request = PositionIKRequest(group_name=group,
137153
robot_state=start_state,

0 commit comments

Comments
 (0)