33 #include <Rcs_typedef.h> 34 #include <Rcs_macros.h> 35 #include <Rcs_kinematics.h> 36 #include <Rcs_basicMath.h> 37 #include <IkSolverConstraintRMR.h> 129 dq_ref = MatNd_create(graph->dof, 1);
130 dq_ref = MatNd_create(graph->dof, 1);
131 dH = MatNd_create(1, graph->nJ);
147 for (
auto task : tasks) {
167 RCHECK_MSG(!
solver,
"Cannot add a Task to the action model after the first reset() call.");
203 MatNd_constMul(
dx_des, x_dot_des, dt);
214 MatNd_printComment(
"dx_des (from controller->computeDX)",
dx_des);
223 MatNd* dH_ca = MatNd_create(1,
controller->getGraph()->nJ);
228 MatNd_addSelf(
dH, dH_ca);
229 MatNd_destroy(dH_ca);
252 MatNd_constMul(q_dot_des,
dq_ref, 1/dt);
275 if (modelToCopy !=
nullptr) {
313 unsigned int idx = 0;
316 for (
unsigned int tp = 0; tp < task->getDim(); ++tp) {
317 auto param = task->getParameter(tp);
318 min[idx] = param.minVal;
319 max[idx] = param.maxVal;
327 std::vector<std::string> result;
330 for (
unsigned int tp = 0; tp < task->getDim(); ++tp) {
331 auto param = task->getParameter(tp);
332 result.push_back(param.name);
340 MatNd* augmentedAction = MatNd_clone(action);
349 computeIK(q_des, q_dot_des, T_des, static_cast<const MatNd*>(augmentedAction), dt);
351 MatNd_destroy(augmentedAction);
356 MatNd* augmentedAction = MatNd_clone(action);
364 MatNd_destroy(augmentedAction);
371 res->addTask(task->clone(newGraph));
unsigned int dimFixedTasks
Store the cumulative number of task dimensions which are fixed to one target value.
void addFixedTask(Task *task, MatNd *value)
Add Rcs controller tasks that is always fixed to one target value. Do this after adding the regular t...
double alpha
Scaling factor for the nullspace gradient.
RcsGraph * getDesiredGraph() const
The graph holding the desired state of the IK solver.
virtual void computeCommand(MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *action, double dt)
IkSolverRMR * solver
IK solver (owned)
virtual void getMinMax(double *min, double *max) const
void setupCollisionModel(const RcsCollisionMdl *modelToCopy)
virtual void getStableAction(MatNd *action) const
double lambda
Regularization factor for the task space weighting.
void computeIKVel(MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *x_dot_des, double dt)
ActionModelIK(RcsGraph *graph)
void ikFromDX(MatNd *q_des, MatNd *q_dot_des, double dt) const
ControllerBase * controller
Holder for the IK tasks (owned)
virtual unsigned int getDim() const
void computeIK(MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *x_des, double dt)
RcsCollisionMdl * collisionMdl
virtual std::vector< std::string > getNames() const
unsigned int getNumActiveTasks() const
MatNd * fixedTasksValues
Store the target values of all fixed tasks.
ActionModel * clone() const
void setDesiredGraph(RcsGraph *newGraph)