Go to the documentation of this file.
2 OPW_IGNORE_WARNINGS_PUSH
3 #include <gtest/gtest.h>
11 OPW_IGNORE_WARNINGS_POP
26 const static int width = 100;
27 int y =
index % width;
28 int z =
index / width;
31 p.translation() = Eigen::Vector3d(0.75, y * 0.01 - 0.5, 0.5 + z * 0.01);
45 double* pfree =
nullptr;
47 eetrans[0] = p.translation().x();
48 eetrans[1] = p.translation().y();
49 eetrans[2] = p.translation().z();
51 for (
int i = 0; i < 3; ++i)
53 for (
int j = 0; j < 3; ++j)
55 eerot[i * 3 + j] = p.matrix()(i, j);
69 std::size_t count = 0;
70 for (
const auto& s : opw)
86 return fmod(fmod(angle, 2.0 * M_PI) + 2.0 * M_PI, 2.0 * M_PI);
120 for (std::size_t i = 0; i < 8; ++i)
123 for (std::size_t j = 0; j < 6; ++j)
125 double value = opw[i][j];
143 std::cout << std::setprecision(5) << std::fixed;
144 for (
const auto& s : sols)
146 for (std::size_t i = 0; i < 6; ++i)
147 std::cout << s[i] <<
" ";
157 bool equal_num = num_ikf_sols == num_opw_sols;
158 EXPECT_TRUE(equal_num);
164 std::array<double, 6> v;
165 for (decltype(num_ikf_sols) i = 0; i < num_ikf_sols; ++i)
169 EXPECT_TRUE(found_sol_in_opw);
170 if (!found_sol_in_opw)
172 std::cout << v[0] <<
" " << v[1] <<
" " << v[2] <<
" " << v[3] <<
" " << v[4] <<
" " << v[5] <<
"\n";
179 TEST(ikfast_to_opw, similar_solutions)
184 const auto abb2400 = opw_kinematics::makeIrb2400_10<double>();
189 for (
int i = 0; i < 40000; ++i)
205 int main(
int argc,
char** argv)
207 testing::InitGoogleTest(&argc, argv);
208 return RUN_ALL_TESTS();
Default implementation of IkSolutionListBase.
bool isValid(const std::array< T, 6 > &qs)
IKFAST_API bool ComputeIk(const IkReal *eetrans, const IkReal *eerot, const IkReal *pfree, IkSolutionListBase< IkReal > &solutions)
void compare(ikfast::IkSolutionList< double > &ikf, Solutions &opw)
Eigen::Transform< T, 3, Eigen::Isometry > Transform
virtual size_t GetNumSolutions() const
returns the number of solutions stored
opw_kinematics::Transform< double > Transform
static double normalize_angle_positive(double angle)
normalize_angle_positive
std::array< std::array< T, 6 >, 8 > Solutions
opw_kinematics::Solutions< double > Solutions
std::size_t countValidSolutions(const Solutions &opw)
bool findSolInSet(const std::array< double, 6 > &s, const Solutions &opw)
void printResults(const Solutions &sols)
TEST(ikfast_to_opw, similar_solutions)
virtual const IkSolutionBase< T > & GetSolution(size_t index) const
returns the solution pointer
static double normalize_angle(double angle)
normalize
Solutions solveOPW(const opw_kinematics::Parameters< double > ¶m, const Transform &p)
int main(int argc, char **argv)
Solutions< T > inverse(const Parameters< T > ¶ms, const Transform< T > &pose) noexcept
Computes up to 8 kinematically unique joint solutions that put the tool flange of the robot described...
void solveIKFast(const Transform &p, ikfast::IkSolutionList< double > &sols)
static double shortest_angular_distance(double from, double to)
shortest_angular_distance
opw_kinematics
Author(s): Jon Meyer
, Jeroen De Maeyer
autogenerated on Thu Jan 16 2025 03:40:37