1 #include <gtest/gtest.h> 19 using Matrix = Eigen::Matrix<T, 3, 3>;
20 using Vector = Eigen::Matrix<T, 3, 1>;
22 Matrix Ra = Ta.rotation(), Rb = Tb.rotation();
23 for (
int i = 0; i < Ra.rows(); ++i)
25 for (
int j = 0; j < Ra.cols(); ++j)
31 Vector pa = Ta.translation(), pb = Tb.translation();
37 TEST(kuka_kr6, forward_kinematics)
39 const auto kuka = opw_kinematics::makeKukaKR6_R700_sixx<float>();
41 std::vector<float> joint_values = {0.2f, 0.2f, 0.2f, 0.2f, 0.2f, 0.2f};
46 actual_pose.matrix() << -0.5965795, 0.000371195, 0.8025539, 0,
47 -0.2724458, 0.9405218, -0.202958, 0,
48 -0.7548948, -0.3397331, -0.5609949, 0,
50 actual_pose.translation() << 0.7341169, -0.1520347, 0.182639;
55 TEST(kuka_kr6, inverse_kinematics)
60 const auto kuka = opw_kinematics::makeKukaKR6_R700_sixx<float>();
62 std::vector<float> joint_values = {0.2f, 0.2f, 0.2f, 0.2f, 0.2f, 0.2f};
65 std::array<float, 6 * 8> sols;
69 for (
int i = 0; i < 8; ++i)
80 int main(
int argc,
char **argv)
82 testing::InitGoogleTest(&argc, argv);
83 return RUN_ALL_TESTS();
TEST(kuka_kr6, forward_kinematics)
void comparePoses(const Transform< T > &Ta, const Transform< T > &Tb)
Compare every element of two eigen Isometry3 poses.
#define EXPECT_NEAR(a, b, prec)
int main(int argc, char **argv)
bool isValid(const T *qs)
Eigen::Transform< T, 3, Eigen::Isometry > Transform
void inverse(const Parameters< T > ¶ms, const Transform< T > &pose, T *out) noexcept
Computes up to 8 kinematically unique joint solutions that put the tool flange of the robot described...
opw_kinematics::Transform< double > Transform
Transform< T > forward(const Parameters< T > &p, const T *qs) noexcept
Computes the tool pose of the robot described by when said robot has the joint positions given by qs...