Skip to content

Commit

Permalink
[ROS-O] Fix Pilz unit tests (moveit#3561)
Browse files Browse the repository at this point in the history
* Avoid double-free of KDL::RotationalInterpolation in KDL >= 1.4.1
  The underlying memory leak was fixed in KDL with orocos/orocos_kinematics_dynamics#180
* Decrease accuracy of quaternion check
  • Loading branch information
rhaschke authored Feb 6, 2024
1 parent 62ff197 commit 95dd7fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ std::unique_ptr<KDL::Path> PathCircleGenerator::circleFromCenter(const KDL::Fram
}
catch (KDL::Error_MotionPlanning&)
{
delete rot_interpo; // in case we could not construct the Path object, avoid
// a memory leak
#if KDL_VERSION < ((1 << 16) | (4 << 8) | 1) // older than 1.4.1 ?
delete rot_interpo; // in case we could not construct the Path object,
// avoid a memory leak
#endif
KDL::epsilon = old_kdl_epsilon;
throw; // and pass the exception on to the caller
}
Expand Down Expand Up @@ -132,9 +134,11 @@ std::unique_ptr<KDL::Path> PathCircleGenerator::circleFromInterim(const KDL::Fra
// above,
// we keep these lines to be safe
{
delete rot_interpo; // in case we could not construct the Path object, avoid
// a memory leak
throw; // and pass the exception on to the caller
#if KDL_VERSION < ((1 << 16) | (4 << 8) | 1) // older than 1.4.1 ?
delete rot_interpo; // in case we could not construct the Path object,
// avoid a memory leak
#endif
throw; // and pass the exception on to the caller
// LCOV_EXCL_STOP
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ TEST_F(IntegrationTestCommandPlanning, PtpJointCart)
Eigen::Isometry3d exp_iso3d_pose;
tf2::fromMsg(expected_pose, exp_iso3d_pose);

EXPECT_TRUE(Eigen::Quaterniond(tf.rotation()).isApprox(Eigen::Quaterniond(exp_iso3d_pose.rotation()), EPSILON));
EXPECT_TRUE(Eigen::Quaterniond(tf.rotation()).isApprox(Eigen::Quaterniond(exp_iso3d_pose.rotation()), 2 * EPSILON));
}

/**
Expand Down

0 comments on commit 95dd7fb

Please sign in to comment.