33 #include <Rcs_typedef.h> 34 #include <Rcs_macros.h> 51 return task->getDim();
61 task->computeX(state);
67 minState[i] =
task->getParameter(i).minVal;
68 maxState[i] =
task->getParameter(i).maxVal;
76 std::vector<std::string> result;
79 std::string prefix =
task->getEffector()->name;
82 for (
auto param :
task->getParameters()) {
83 auto paramName = param.name;
84 auto spaceIdx = paramName.find(
' ');
86 if (spaceIdx != std::string::npos) {
87 paramName = paramName.substr(0, spaceIdx);
90 result.push_back(prefix + paramName);
98 task->getParameter(i).minVal = minState;
107 task->getParameter(i).minVal = minState[i];
115 task->getParameter(i).maxVal = maxState;
124 task->getParameter(i).maxVal = maxState[i];
131 if (effectorName != NULL) {
132 RcsBody* effector = RcsGraph_getBodyByName(
task->getGraph(), effectorName);
133 RCHECK_MSG(effector,
"Effector body %s not found!", effectorName);
134 task->setEffector(effector);
136 if (refBodyName != NULL) {
137 RcsBody* refBody = RcsGraph_getBodyByName(
task->getGraph(), refBodyName);
138 RCHECK_MSG(refBody,
"Reference body %s not found!", refBodyName);
139 task->setRefBody(refBody);
142 if (refFrameName == NULL) {
143 task->setRefFrame(refBody);
146 if (refFrameName != NULL) {
147 RcsBody* refFrame = RcsGraph_getBodyByName(
task->getGraph(), refFrameName);
148 RCHECK_MSG(refFrame,
"Reference frame %s not found!", refFrameName);
149 task->setRefFrame(refFrame);
virtual std::vector< std::string > getStateNames() const
virtual void getLimits(double *minState, double *maxState, double *maxVelocity) const
virtual unsigned int getStateDim() const
OMTaskPositions * setMinState(double minState)
OMTaskPositions(Task *task)
Task * task
Wrapped task object (owned!)
virtual void computeObservation(double *state, double *velocity, const MatNd *currentAction, double dt) const
virtual ~OMTaskPositions()
void initTaskBodyNames(const char *effectorName, const char *refBodyName, const char *refFrameName)
virtual unsigned int getVelocityDim() const
OMTaskPositions * setMaxState(double maxState)