5 #include <dynamic-graph/factory.h> 6 #include <dynamic-graph/pool.h> 8 #include <boost/assign/list_of.hpp> 9 #include <boost/numeric/conversion/cast.hpp> 12 namespace dg = ::dynamicgraph;
18 using command::Command;
30 unsigned int dofId = values[0].value();
31 bool control = values[1].value();
39 state_(NULL,
"FeaturePosture(" + name +
")::input(Vector)::state"),
40 posture_(0,
"FeaturePosture(" + name +
")::input(Vector)::posture"),
41 postureDot_(0,
"FeaturePosture(" + name +
")::input(Vector)::postureDot"),
49 std::string docstring;
52 " Select degree of freedom to control\n" 55 " - positive integer: rank of degree of freedom,\n" 56 " - boolean: whether to control the selected degree of " 59 " Note: rank should be more than 5 since posture is " 61 " from freeflyer position.\n" 78 std::size_t
index = 0;
81 res(index) = state(i) - posture(i);
89 throw std::runtime_error(
90 "jacobian signal should be constant." 91 " This function should never be called");
98 std::size_t
index = 0;
108 std::size_t
dim(state.size());
110 if (
dim != (std::size_t)posture.size()) {
111 throw std::runtime_error(
"Posture and State should have same dimension.");
121 std::ostringstream oss;
122 oss <<
"dof id should less than state dimension: " <<
dim <<
". Received " 141 std::size_t
index = 0;
std::vector< bool > activeDofs_
FeaturePosture(const std::string &name)
virtual dynamicgraph::Vector & computeErrorDot(dynamicgraph::Vector &res, int time)
void signalRegistration(const SignalArray< int > &signals)
void selectDof(unsigned dofId, bool control)
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePosture, "FeaturePosture")
virtual void setConstant(const T &t)
SignalTimeDependent< dynamicgraph::Matrix, int > jacobianSOUT
Jacobian of the error wrt the robot state: .
unsigned int getDimension(void) const
Shortest method.
virtual const T & access(const Time &t)
SelectDof(FeaturePosture &entity, const std::string &docstring)
virtual Value doExecute()
virtual void addDependency(const SignalBase< Time > &signal)
virtual const T & accessCopy() const
std::size_t nbActiveDofs_
virtual dynamicgraph::Vector & computeError(dynamicgraph::Vector &res, int)
Compute the error between the desired feature and the current value of the feature measured or deduce...
This class gives the abstract definition of a feature.
const std::vector< Value > & getParameterValues() const
void addCommand(const std::string &name, command::Command *command)
virtual ~FeaturePosture()
SignalTimeDependent< dynamicgraph::Vector, int > errorSOUT
This signal returns the error between the desired value and the current value : . ...
virtual dynamicgraph::Matrix & computeJacobian(dynamicgraph::Matrix &res, int)
Compute the Jacobian of the error according the robot state.