27 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
62 unsigned int robotIndex,
63 const std::string & body,
65 const Eigen::Matrix6d & dof = Eigen::Matrix6d::Identity(),
66 double stiffness = 5.0,
67 double weight = 1000.0,
68 double forceThresh = 3.,
69 double torqueThresh = 1.,
70 std::pair<double, double> forceGain = defaultFGain,
71 std::pair<double, double> torqueGain = defaultTGain);
100 unsigned int robotIndex,
101 const std::string & body,
103 double stiffness = 5.0,
104 double weight = 1000.0,
105 double forceThresh = 3.,
106 double torqueThresh = 1.,
107 std::pair<double, double> forceGain = defaultFGain,
108 std::pair<double, double> torqueGain = defaultTGain);
115 void reset()
override;
118 sva::ForceVecd getFilteredWrench()
const;
129 efTask_->positionTask->stiffness(s);
130 efTask_->orientationTask->stiffness(s);
133 double stiffness() {
return efTask_->positionTask->stiffness(); }
138 efTask_->positionTask->weight(w);
139 efTask_->orientationTask->weight(w);
142 double weight() {
return efTask_->positionTask->weight(); }
155 void forceGain(std::pair<double, double> t) { forceGain_ = t; }
157 std::pair<double, double>
forceGain() {
return forceGain_; }
160 void torqueGain(std::pair<double, double> t) { torqueGain_ = t; }
162 std::pair<double, double>
torqueGain() {
return torqueGain_; }
165 void dof(
const Eigen::Matrix6d & dof) { dof_ =
dof; }
167 Eigen::Matrix6d
dof() {
return dof_; }
169 void dimWeight(
const Eigen::VectorXd & dimW)
override;
171 Eigen::VectorXd dimWeight()
const override;
174 const std::vector<std::string> & activeJointsName,
175 const std::map<std::string, std::vector<std::array<int, 2>>> & activeDofs = {})
override;
178 const std::vector<std::string> & unactiveJointsName,
179 const std::map<std::string, std::vector<std::array<int, 2>>> & unactiveDofs = {})
override;
183 Eigen::VectorXd
eval()
const override {
return wrench_.vector(); }
185 Eigen::VectorXd
speed()
const override
187 return robots_.robot(rIndex_).mbc().bodyVelW[robots_.robot(rIndex_).bodyIndexByName(sensor_.parentBody())].vector();
191 sva::PTransformd computePose();
193 std::shared_ptr<EndEffectorTask> efTask_;
194 sva::ForceVecd wrench_;
196 sva::ForceVecd error_;
197 sva::ForceVecd errorD_;
199 unsigned int rIndex_;
202 double forceThresh_, torqueThresh_;
203 std::pair<double, double> forceGain_, torqueGain_;
204 Eigen::Matrix6d dof_;
205 std::function<double(
double)> clampTrans_, clampRot_;