ocra-recipes
Doxygen documentation for the ocra-recipes repository
TaskBuilderOptions.h
Go to the documentation of this file.
1 
11 #ifndef TASK_BUILDER_OPTIONS_H
12 #define TASK_BUILDER_OPTIONS_H
13 
14 #include <Eigen/Dense>
15 #include <Eigen/Lgsm>
16 #include <ocra/util/Macros.h>
19 #include <yarp/os/Bottle.h>
20 
21 namespace ocra
22 {
23 
26 
27 public:
30  void putIntoBottle(yarp::os::Bottle& bottle);
31  bool extractFromBottle(yarp::os::Bottle& bottle, int& sizeOfOptions);
32 
33  std::string taskName, taskType, segment;
34  double kp, kd, weight, mu, margin;
38  Eigen::VectorXd desired;
39  Eigen::VectorXd indexDesired;
40  Eigen::VectorXd nameDesired;
41  Eigen::VectorXd weightVector;
42  Eigen::VectorXd indexWeightVector;
43  Eigen::VectorXd nameWeightVector;
44  Eigen::VectorXi jointIndexes;
45  std::vector<std::string> jointNames;
46  Eigen::Displacementd offset;
47 
48 
49  friend std::ostream& operator<<(std::ostream &out, const TaskBuilderOptions& tmOpts)
50  {
51  out << "Task name:\n" << tmOpts.taskName << std::endl << std::endl;
52  out << "Task type:\n" << tmOpts.taskType << std::endl << std::endl;
53  out << "Segment:\n" << tmOpts.segment << std::endl << std::endl;
54  out << "kp:\n" << tmOpts.kp << std::endl << std::endl;
55  out << "kd:\n" << tmOpts.kd << std::endl << std::endl;
56  out << "weight:\n" << tmOpts.weight << std::endl << std::endl;
57  out << "weights:\n" << tmOpts.weightVector.transpose() << std::endl << std::endl;
58  out << "axes:\n" << utils::cartesianDofToString(tmOpts.axes) << std::endl << std::endl;
59  out << "hierarchyLevel:\n" << tmOpts.hierarchyLevel << std::endl << std::endl;
60  out << "offset:\n" << tmOpts.offset << std::endl;
61  out << "jointIndexes:\n" << tmOpts.jointIndexes.transpose() << std::endl << std::endl;
62  out << "desired:\n" << tmOpts.desired.transpose() << std::endl << std::endl;
63  return out;
64  }
65 
66 private:
67 
68  const static int TASK_BUILDER_OPTIONS_BOTTLE = 123;
69 
70 };
71 
72 } // namespace ocra
73 #endif //TASK_BUILDER_OPTIONS_H
Eigen::VectorXd indexWeightVector
void putIntoBottle(yarp::os::Bottle &bottle)
friend std::ostream & operator<<(std::ostream &out, const TaskBuilderOptions &tmOpts)
#define DEFINE_CLASS_POINTER_TYPEDEFS(Class)
Definition: Macros.h:8
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
std::string cartesianDofToString(const ECartesianDof dofEnum)
Definition: ControlEnum.h:75
ECartesianDof
Definition: ControlEnum.h:18
std::vector< std::string > jointNames
bool extractFromBottle(yarp::os::Bottle &bottle, int &sizeOfOptions)
Eigen::VectorXd nameWeightVector
Eigen::Displacementd offset
Some enumerations for the control.