ocra-recipes
Doxygen documentation for the ocra-recipes repository
TaskConstructionManager.h
Go to the documentation of this file.
1 
11 #ifndef TASK_CONSTRUCTION_MANAGER_H
12 #define TASK_CONSTRUCTION_MANAGER_H
13 
14 #include <iostream>
15 #include <tinyxml.h>
16 #include <string>
17 #include <sstream>
18 #include <vector>
19 #include <cmath>
20 #include <boost/filesystem.hpp>
21 
22 #include <ocra/control/Model.h>
24 #include <ocra/util/Macros.h>
27 #include <ocra/util/XmlUtilities.h>
28 
29 
39 
40 namespace ocra {
41 
44 
45 public:
47 
48  TaskConstructionManager(Model::Ptr model, Controller::Ptr controller, std::vector<TaskBuilderOptions> optionsVector);
49 
50  TaskConstructionManager(Model::Ptr model, Controller::Ptr controller, const std::string& optionsXmlFilePath);
51 
52  virtual ~TaskConstructionManager();
53 
61  void addTasksToController(Model::Ptr model, Controller::Ptr controller, std::vector<TaskBuilderOptions> optionsVector);
62 
71  TaskBuilder::Ptr getBuilder(TaskBuilderOptions options, Model::Ptr model);
72 
81  std::vector<TaskBuilderOptions> parseTaskOptionsFromXml(const std::string& optionsXmlFilePath);
82 
83 private:
84 
92  std::vector<TaskBuilderOptions> parseTaskOptionsFromXml(TiXmlDocument* newTasksFile);
93 
100  bool parseTaskXmlElement(TiXmlElement* xmlTask, TaskBuilderOptions& options);
101 
110  bool parseTaskNameAndType(TiXmlElement* xmlTask, TaskBuilderOptions& options);
111 
126  void parseParamXmlElement(TiXmlElement* currentElem, TaskBuilderOptions& options);
127 
134  void parseOffsetXmlElement(TiXmlElement* offsetElement, TaskBuilderOptions& options);
135 
142  void parseDesiredXmlElement(TiXmlElement* desiredElement, TaskBuilderOptions& options);
143 
150  void parseSegmentXmlElement(TiXmlElement* segmentElement, TaskBuilderOptions& options);
151 
158  void parseJointIndexesXmlElement(TiXmlElement* jointIndexesElement, TaskBuilderOptions& options);
159 
166  void parseJointsXmlElement(TiXmlElement* jointsElement, TaskBuilderOptions& options);
167 
174  void parseWeightsXmlElement(TiXmlElement* weightsElement, TaskBuilderOptions& options);
175 
182  void correctArticularVariables(TaskBuilderOptions& options, Model::Ptr model);
183 
184 
185 };
186 
187 
188 } // namespace ocra
189 
190 #endif //TASK_CONSTRUCTION_MANAGER_H
Declaration file of the Model class.
#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::vector< TaskBuilderOptions > parseTaskOptionsFromXml(const std::string &optionsXmlFilePath)
void addTasksToController(Model::Ptr model, Controller::Ptr controller, std::vector< TaskBuilderOptions > optionsVector)
Controller interface.
TaskBuilder::Ptr getBuilder(TaskBuilderOptions options, Model::Ptr model)