Skip to content

Commit 8408fba

Browse files
committed
fixup! ComputeIK supports attached-object ik frame
Avoid double lookup of transform
1 parent 77c3ae9 commit 8408fba

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

core/src/stages/compute_ik.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,12 @@ void ComputeIK::compute() {
288288
Eigen::Isometry3d ik_pose;
289289
tf2::fromMsg(ik_pose_msg.pose, ik_pose);
290290

291-
if (!scene->getCurrentState().knowsFrameTransform(ik_pose_msg.header.frame_id)) {
291+
bool found = false;
292+
ik_pose = scene->getCurrentState().getFrameTransform(ik_pose_msg.header.frame_id, &found) * ik_pose;
293+
if (!found) {
292294
ROS_WARN_STREAM_NAMED("ComputeIK", "ik frame unknown in robot: '" << ik_pose_msg.header.frame_id << "'");
293295
return;
294296
}
295-
ik_pose = scene->getCurrentState().getFrameTransform(ik_pose_msg.header.frame_id) * ik_pose;
296297

297298
#if MOVEIT_HAS_STATE_RIGID_PARENT_LINK
298299
link = scene->getCurrentState().getRigidlyConnectedParentLinkModel(ik_pose_msg.header.frame_id);

0 commit comments

Comments
 (0)