19 #ifndef __INC_OPTIMIZER_CONTAINER 20 #define __INC_OPTIMIZER_CONTAINER 30 std::vector<unsigned int>
dofs;
36 for (
unsigned int i=0; i<dofs.size(); i++)
38 LOG_MSG(11,
"DOF %d -> %d: %f ( %f %f )\n", i, dofs[i], x[index + i], dofs_min[dofs[i]], dofs_max[dofs[i]]);
42 position.
x = dofs_min[dofs[i]] + x[index + i] * (dofs_max[dofs[i]] - dofs_min[dofs[i]]);
45 position.
y = dofs_min[dofs[i]] + x[index + i] * (dofs_max[dofs[i]] - dofs_min[dofs[i]]);
48 position.
z = dofs_min[dofs[i]] + x[index + i] * (dofs_max[dofs[i]] - dofs_min[dofs[i]]);
51 axis.
x = dofs_min[dofs[i]] + x[index + i] * (dofs_max[dofs[i]] - dofs_min[dofs[i]]);
54 axis.
y = dofs_min[dofs[i]] + x[index + i] * (dofs_max[dofs[i]] - dofs_min[dofs[i]]);
57 axis.
z = dofs_min[dofs[i]] + x[index + i] * (dofs_max[dofs[i]] - dofs_min[dofs[i]]);
62 double angle = axis.
length();
65 pose.
a[12] = position.
x;
66 pose.
a[13] = position.
y;
67 pose.
a[14] = position.
z;
void setValue(double *x, unsigned int index)
static void getMatrixFromRotation(CMatrix &mat, const CVec &axis, double angle)
Transforms axis-angle representation into homogenous matrix representation.
std::string toString(bool round=false)
#define LOG_MSG(index, format,...)
virtual void setPose(const CMatrix &pose)
std::vector< unsigned int > dofs
Robot types with implemented inverse kinematics.
virtual void invalidate()
std::vector< double > dofs_min
std::vector< double > dofs_max