value_setter.h
Go to the documentation of this file.
1 
19 #ifndef __INC_VALUE_SETTER
20 #define __INC_VALUE_SETTER
21 
22 #include <vector>
23 #include <frame.h>
24 #include <vecmath.h>
25 #include <utils.h>
26 
27 namespace robotLibPbD
28 {
29 
31  {
32  public:
34  int x,y,z;
35  int a, b, g;
36  int qx,qy,qz,qw;
37 
39  {
40  a = b = g = x = y = z = qx = qw = qy = qz = -1;
41  }
42 
43  bool set(std::vector<double> &values)
44  {
45  if (frame == NULL)
46  return false;
47 
48  CMatrix pose;
49  if (a != -1 || b != -1 || g != -1)
50  {
51  /*double alpha, beta, gamma = 0.0;
52  if (a >= 0)
53  alpha = values[a];
54  if (b >= 0)
55  beta = values[b];
56  if (g >= 0)
57  gamma = values[g];*/
58  }
59  else
60  {
61  CVec quater;
62 
63  if (qw >= 0)
64  quater.w = values[qw];
65  if (qx >= 0)
66  quater.x = values[qx];
67  if (qy >= 0)
68  quater.y = values[qy];
69  if (qz >= 0)
70  quater.z = values[qz];
71 
72  CMathLib::matrixFromQuaternion(quater, pose);
73  }
74 
75  if (x >= 0)
76  pose.a[12] = values[x];
77  if (y >= 0)
78  pose.a[13] = values[y];
79  if (z >= 0)
80  pose.a[14] = values[z];
81 
82  frame->setPose(pose);
83  return true;
84  }
85  };
86 }
87 
88 #endif
PRECISION z
Definition: vecmath.h:60
PRECISION a[16]
Definition: vecmath.h:190
static void matrixFromQuaternion(CVec &quaternion, CMatrix &matrix)
Transforms a quaternion into homogenous matrix representation.
Definition: vecmath.cpp:372
PRECISION w
Definition: vecmath.h:60
Homogenous vector.
Definition: vecmath.h:57
Homogenous matrix.
Definition: vecmath.h:187
virtual void setPose(const CMatrix &pose)
Definition: frame.h:120
Robot types with implemented inverse kinematics.
Definition: frame.h:39
PRECISION y
Definition: vecmath.h:60
PRECISION x
Definition: vecmath.h:60


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