Go to the documentation of this file.
29 #define SOT_FULL_TO_REDUCED(sotName) \
30 sotName##FullSizeSIN(NULL, "GripperControl(" + name + \
31 ")::input(vector)::" + #sotName + "FullIN"), \
32 sotName##ReduceSOUT( \
33 SOT_INIT_SIGNAL_2(GripperControlPlugin::selector, \
34 sotName##FullSizeSIN, dynamicgraph::Vector, \
35 selectionSIN, Flags), \
36 "GripperControl(" + name + ")::input(vector)::" + #sotName + \
42 const double DT = 0.005;
49 calibrationStarted(false),
51 "GripperControl(" +
name +
")::input(vector)::position"),
53 NULL,
"GripperControl(" +
name +
")::input(vector)::positionDes"),
54 torqueSIN(NULL,
"GripperControl(" +
name +
")::input(vector)::torque"),
56 NULL,
"GripperControl(" +
name +
")::input(vector)::torqueLimit"),
57 selectionSIN(NULL,
"GripperControl(" +
name +
")::input(vector)::selec")
69 "GripperControl(" +
name +
")::output(vector)::reference") {
88 std::string docstring =
"Control of gripper.";
103 if (
factor.size() != SIZE) {
109 if (torques.size() == 0) {
110 dgRTLOG() <<
"torque is not provided " << std::endl;
117 if ((torques(
i) > torqueLimits(
i)) && (currentNormVel(
i) > 0)) {
119 }
else if ((torques(
i) < -torqueLimits(
i)) && (currentNormVel(
i) < 0)) {
146 sotDEBUG(25) <<
" velocity " << velocity << std::endl;
151 weightedVel = velocity *
factor;
152 sotDEBUG(25) <<
" weightedVel " << weightedVel << std::endl;
155 referencePos.resize(SIZE);
156 referencePos = currentPos + weightedVel *
DT;
165 if (selec(
i))
size++;
171 if (selec(
i)) desPos(curs++) = fullsize(
i);
181 namespace dc = ::dynamicgraph::command;
184 "set the offset (should be in )0, 1( )."));
191 throw std::invalid_argument(
"The offset should be in )0, 1(.");
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueSIN
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > desiredPositionSOUT
virtual void plug(SignalBase< Time > *ref)
dynamicgraph::Vector & computeDesiredPosition(const dynamicgraph::Vector ¤tPos, const dynamicgraph::Vector &desiredPos, const dynamicgraph::Vector &torques, const dynamicgraph::Vector &torqueLimits, dynamicgraph::Vector &referencePos)
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > torqueLimitReduceSOUT
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > torqueReduceSOUT
#define SOT_FULL_TO_REDUCED(sotName)
virtual ~GripperControlPlugin(void)
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > positionDesSIN
dynamicgraph::SignalPtr< Flags, sigtime_t > selectionSIN
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, sigtime_t > positionReduceSOUT
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePosture, "FeaturePosture")
#define sotDEBUGOUT(level)
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueLimitSIN
#define sotDEBUGIN(level)
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueFullSizeSIN
static dynamicgraph::Vector & selector(const dynamicgraph::Vector &fullsize, const Flags &selec, dynamicgraph::Vector &desPos)
select only some of the values of the vector fullsize, based on the Flags vector.
The goal of this entity is to ensure that the maximal torque will not be exceeded during a grasping t...
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > positionFullSizeSIN
#define SOT_MEMBER_SIGNAL_4(sotFunction, sotArg1, sotArg1Type, sotArg2, sotArg2Type, sotArg3, sotArg3Type, sotArg4, sotArg4Type)
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > torqueLimitFullSizeSIN
GripperControlPlugin(const std::string &name)
virtual std::string getDocString() const
void computeIncrement(const dynamicgraph::Vector &torques, const dynamicgraph::Vector &torqueLimits, const dynamicgraph::Vector ¤tNormVel)
Computes the.
static const double OFFSET_DEFAULT
void addCommand(const std::string &name, command::Command *command)
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > positionSIN
void signalRegistration(const SignalArray< sigtime_t > &signals)
void setOffset(const double &value)
dynamicgraph::Vector factor
The multiplication.
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31