test.cpp
Go to the documentation of this file.
1 #include <iomanip>
2 #include <iostream>
3 #include <array>
4 
9 
10 void printResults(const std::array<double, 6 * 8>& sols)
11 {
12  std::cout << std::setprecision(5) << std::fixed;
13  for (int i = 0; i < 8; ++i)
14  {
15  for (int j = 0; j < 6; ++j)
16  std::cout << sols[i * 6 + j] << " ";
17  std::cout << "\n";
18  }
19 }
20 
21 int main()
22 {
23  const auto abb2400 = opw_kinematics::makeIrb2400_10<double>();
24 
26  pose.translation() = Eigen::Vector3d(0.7, 0.2, 0);
27 
28  std::array<double, 6 * 8> sols;
29  opw_kinematics::inverse(abb2400, pose, sols.data());
30 
31  opw_kinematics::isValid(sols.data());
32 
33  for (int i = 0; i < 8; ++i)
34  {
36  }
37 
38  printResults(sols);
39 
40  for (int i = 0; i < 8; ++i)
41  {
42  std::cout << i << ": " << opw_kinematics::isValid(&sols[i * 6]) << "\n";
43  std::cout << i << ":\n" << opw_kinematics::forward(abb2400, &sols[i * 6]).matrix() << "\n";
44  }
45 
46  return 0;
47 }
void printResults(const std::array< double, 6 *8 > &sols)
Definition: test.cpp:10
bool isValid(const T *qs)
Definition: opw_utilities.h:10
void harmonizeTowardZero(T *qs)
Definition: opw_utilities.h:17
int main()
Definition: test.cpp:21
Eigen::Transform< T, 3, Eigen::Isometry > Transform
void inverse(const Parameters< T > &params, const Transform< T > &pose, T *out) noexcept
Computes up to 8 kinematically unique joint solutions that put the tool flange of the robot described...
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...


moveit_opw_kinematics_plugin
Author(s): Jeroen De Maeyer, Simon Schmeisser (isys vision)
autogenerated on Wed Jun 3 2020 03:17:14