Go to the documentation of this file.
21 #include "../src/task/task-command.h"
34 Task::Task(
const std::string &
n)
37 withDerivative(false),
38 controlGainSIN(NULL,
"sotTask(" +
n +
")::input(double)::controlGain"),
39 dampingGainSINOUT(NULL,
"sotTask(" +
n +
")::in/output(double)::damping")
42 controlSelectionSIN(NULL,
43 "sotTask(" +
n +
")::input(flag)::controlSelec"),
45 "sotTask(" +
n +
")::output(vector)::error"),
46 errorTimeDerivativeSOUT(
47 boost::bind(&
Task::computeErrorTimeDerivative, this, _1, _2),
49 std::string(
"sotTask(" +
n +
50 ")::output(vector)::errorTimeDerivative")) {
74 std::string docstring;
78 " Add a feature to the task\n"
81 " - name of the feature\n"
95 " Clear the list of features of the task\n"
103 " Returns the list of features of the task\n"
123 for (FeatureList_t::iterator iter =
featureList.begin();
175 error.resize(dimError);
183 for (FeatureList_t::iterator iter =
featureList.begin();
192 while (cursorError +
dim > dimError)
195 error.resize(dimError);
200 error(cursorError++) = partialError(k);
202 sotDEBUG(35) <<
"feature: " << partialError << std::endl;
203 sotDEBUG(35) <<
"error: " << error << std::endl;
207 error.conservativeResize(cursorError);
210 sotDEBUG(35) <<
"error_final: " << error << std::endl;
220 for (FeatureList_t::iterator iter =
featureList.begin();
226 res.segment(cursor,
dim) = partialErrorDot;
238 errorRef.resize(errSingleBound.size());
240 for (std::size_t
i = 0;
i < errorRef.size(); ++
i)
241 errorRef[
i] = -errSingleBound(
i) * gain;
245 for (std::size_t
i = 0;
i < errorRef.size(); ++
i)
246 errorRef[
i] = errorRef[
i].getSingleBound() - de(
i);
273 for (FeatureList_t::iterator iter =
featureList.begin();
281 sotDEBUG(25) <<
"Jp =" << endl << partialJacobian << endl;
284 nbc = partialJacobian.cols();
286 }
else if (partialJacobian.cols() != nbc)
289 "Features from the list don't have compatible-size jacobians.");
291 while (cursorJ + nbr >= dimJ) {
293 J.conservativeResize(dimJ, nbc);
301 J(cursorJ + k, kc) = partialJacobian(k, kc);
310 J.conservativeResize(cursorJ, nbc);
322 os <<
"Task " <<
name <<
": " << endl;
323 os <<
"--- LIST --- " << std::endl;
325 for (FeatureList_t::const_iterator iter =
featureList.begin();
327 os <<
"-> " << (*iter)->getName() << endl;
332 FeatureList_t::const_iterator itFeatureAbstract;
335 os <<
"\t\"" << (*itFeatureAbstract)->getName() <<
"\" -> \"" <<
getName()
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > errorTimeDerivativeSOUT
virtual std::ostream & writeGraph(std::ostream &os) const
dynamicgraph::SignalPtr< Flags, sigtime_t > controlSelectionSIN
bool getWithDerivative(void)
dynamicgraph::SignalPtr< double, sigtime_t > controlGainSIN
void setWithDerivative(const bool &s)
SignalTimeDependent< dynamicgraph::Vector, sigtime_t > errorSOUT
This signal returns the error between the desired value and the current value : .
VectorMultiBound & computeTaskExponentialDecrease(VectorMultiBound &errorRef, sigtime_t time)
std::vector< MultiBound > VectorMultiBound
void addControlSelection(const Flags &act)
dynamicgraph::Vector & computeError(dynamicgraph::Vector &error, sigtime_t time)
SignalTimeDependent< dynamicgraph::Matrix, sigtime_t > jacobianSOUT
Jacobian of the error wrt the robot state: .
void clearControlSelection(void)
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(Task, "Task")
This class gives the abstract definition of a feature.
FeatureList_t featureList
const std::string & getName() const
CommandVoid0< E > * makeCommandVoid0(E &entity, boost::function< void(E *)> function, const std::string &docString)
DirectGetter< E, T > * makeDirectGetter(E &entity, T *ptr, const std::string &docString)
dynamicgraph::Vector & computeErrorTimeDerivative(dynamicgraph::Vector &res, sigtime_t time)
virtual void addDependency(const SignalBase< Time > &signal)
dynamicgraph::SignalTimeDependent< dynamicgraph::Matrix, sigtime_t > jacobianSOUT
virtual void removeDependency(const SignalBase< Time > &signal)
std::string docDirectSetter(const std::string &name, const std::string &type)
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > errorSOUT
dynamicgraph::Matrix & computeJacobian(dynamicgraph::Matrix &J, sigtime_t time)
std::string docDirectGetter(const std::string &name, const std::string &type)
dynamicgraph::SignalTimeDependent< VectorMultiBound, sigtime_t > taskSOUT
Class that defines the basic elements of a task.
void display(std::ostream &os) const
static PoolStorage * getInstance()
virtual SignalTimeDependent< dynamicgraph::Vector, sigtime_t > & getErrorDot()
DirectSetter< E, T > * makeDirectSetter(E &entity, T *ptr, const std::string &docString)
void addCommand(const std::string &name, command::Command *command)
void addFeature(FeatureAbstract &s)
void clearFeatureList(void)
void signalRegistration(const SignalArray< sigtime_t > &signals)
DYNAMIC_GRAPH_DLLAPI SignalArray< sigtime_t > sotNOSIGNAL
dynamicgraph::SignalPtr< double, sigtime_t > dampingGainSINOUT
CommandVoid1< E, T > * makeCommandVoid1(E &entity, boost::function< void(const T &)> function, const std::string &docString)
void setControlSelection(const Flags &act)
void addFeatureFromName(const std::string &name)
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31