optimizer_goal_orientation.h
Go to the documentation of this file.
1 
19 #ifndef __INC_OPTIMIZER_GOAL_ORIENTATION
20 #define __INC_OPTIMIZER_GOAL_ORIENTATION
21 
22 #include <vector>
23 #include <optimizer_goal.h>
24 
25 namespace robotLibPbD {
26 
27 
28 
30 {
31 public:
32  virtual double getDistance()
33  {
34  double angle;
35  CVec axis;
36  CMatrix pose;
37  LOG_MSG(10, "First:\n%s", first->getRelativeToBase().toString().c_str());
38  LOG_MSG(10, "Second:\n%s", second->getRelativeToBase().toString().c_str());
39 
40 
41  pose = first->getRelativeToBase();
42  pose.invert();
43  pose.mul(pose, second->getRelativeToBase());
44 
45  //LOG_MSG(5, "Difference:\n%s", pose.toString().c_str());
46 
47  CMathLib::getRotationFromMatrix(pose, axis, angle);
48  axis *= angle;
49 
50  return 57.295779513082325 * axis.length();
51  };
52 };
53 
54 };
55 
56 #endif
PRECISION length() const
Definition: vecmath.h:168
virtual CMatrix getRelativeToBase()
Returns pose in the base (frame with no predecessor) frame.
Definition: frame.h:508
static void getRotationFromMatrix(const CMatrix &mat, CVec &axis, double &angle)
Transforms homogenous matrix into axis-angle representation.
Definition: vecmath.cpp:463
Homogenous vector.
Definition: vecmath.h:57
Homogenous matrix.
Definition: vecmath.h:187
std::string toString(bool round=false)
Definition: vecmath.cpp:221
#define LOG_MSG(index, format,...)
Definition: log.h:32
void invert()
Inverts the matrix (only for homogenous matrices)
Definition: vecmath.h:461


asr_kinematic_chain_optimizer
Author(s): Aumann Florian, Heller Florian, Jäkel Rainer, Wittenbeck Valerij
autogenerated on Mon Jun 10 2019 12:35:36