55 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
75 double stiffness = 5.0,
76 double weight = 1000.0,
77 bool showTarget =
true,
79 bool showCompliance =
true);
92 double stiffness = 5.0,
93 double weight = 1000.0,
94 bool showTarget =
true,
96 bool showCompliance =
true);
113 const sva::PTransformd &
targetPose() const noexcept {
return targetPoseW_; }
116 void targetPose(
const sva::PTransformd & pose) { targetPoseW_ = pose; }
119 const sva::MotionVecd &
targetVel() const noexcept {
return targetVelW_; }
122 void targetVel(
const sva::MotionVecd & worldVel)
override { targetVelW_ = worldVel; }
125 const sva::MotionVecd &
targetAccel() const noexcept {
return targetAccelW_; }
128 void targetAccel(
const sva::MotionVecd & accel) { targetAccelW_ = accel; }
141 sva::PTransformd T_0_d(targetPoseW_.rotation());
142 return T_0_d * deltaCompPoseW_ * T_0_d.inv() * targetPoseW_;
146 const sva::ForceVecd &
targetWrench() const noexcept {
return targetWrench_; }
152 void targetWrenchW(
const sva::ForceVecd & wrenchW) { targetWrench(frame_->position().dualMul(wrenchW)); }
155 void targetWrench(
const sva::ForceVecd & wrench) { targetWrench_ = wrench; }
169 cutoffPeriod_ = cutoffPeriod;
170 lowPass_.cutoffPeriod(cutoffPeriod_);
174 inline bool hold() const noexcept {
return hold_; }
186 inline void hold(
bool hold) noexcept { hold_ =
hold; }
194 bool showTarget_ =
true;
195 bool showPose_ =
true;
196 bool showCompliance_ =
true;
203 sva::PTransformd deltaCompPoseW_ = sva::PTransformd::Identity();
204 sva::MotionVecd deltaCompVelW_ = sva::MotionVecd::Zero();
205 sva::MotionVecd deltaCompAccelW_ = sva::MotionVecd::Zero();
209 double deltaCompPoseLinLimit_ = 1.0;
211 double deltaCompVelLinLimit_ = 1e3;
212 double deltaCompVelAngLimit_ = 1e3;
213 double deltaCompAccelLinLimit_ = 1e3;
214 double deltaCompAccelAngLimit_ = 1e3;
217 sva::PTransformd targetPoseW_ = sva::PTransformd::Identity();
218 sva::MotionVecd targetVelW_ = sva::MotionVecd::Zero();
219 sva::MotionVecd targetAccelW_ = sva::MotionVecd::Zero();
222 sva::ForceVecd targetWrench_ = sva::ForceVecd::Zero();
223 sva::ForceVecd measuredWrench_ = sva::ForceVecd::Zero();
224 sva::ForceVecd filteredMeasuredWrench_ = sva::ForceVecd::Zero();
226 double cutoffPeriod_ = 0.05;
250 void target(
const sva::PTransformd & pos)
override { targetPose(pos); }
253 sva::PTransformd target()
const override {
return targetPose(); }
#define MC_TASKS_DLLAPI
Definition: api.h:50
constexpr double PI
Definition: constants.h:18
Definition: StabilizerStandingState.h:12
Definition: RobotFrame.h:22
Simplify access to values hold within a JSON file.
Definition: Configuration.h:166
Logs controller data to disk.
Definition: Logger.h:30
Definition: StateBuilder.h:28
Definition: QPSolver.h:86
const Eigen::VectorXd & refAccel() const
Get the trajectory reference acceleration.
Represent impedance gains for an ImpedanceTask.
Definition: ImpedanceGains.h:96
static ImpedanceGains Default()
Definition: ImpedanceGains.h:132
Impedance control of the end-effector.
Definition: ImpedanceTask.h:53
void addToSolver(mc_solver::QPSolver &solver) override
Add the task to a solver.
void cutoffPeriod(double cutoffPeriod)
Set the cutoff period for the low-pass filter of measured wrench.
Definition: ImpedanceTask.h:167
void hold(bool hold) noexcept
Set hold mode.
Definition: ImpedanceTask.h:186
void addToLogger(mc_rtc::Logger &logger) override
bool hold() const noexcept
Get whether hold mode is enabled.
Definition: ImpedanceTask.h:174
const ImpedanceGains & gains() const noexcept
Access the impedance gains.
Definition: ImpedanceTask.h:107
mc_filter::LowPass< sva::ForceVecd > lowPass_
Definition: ImpedanceTask.h:227
void reset() override
Reset the task.
void targetWrenchW(const sva::ForceVecd &wrenchW)
Set the target wrench in the world frame. This function will convert the wrench from the world frame ...
Definition: ImpedanceTask.h:152
void targetAccel(const sva::MotionVecd &accel)
Set the target acceleration of the surface in the world frame.
Definition: ImpedanceTask.h:128
const sva::PTransformd & deltaCompliancePose() const
Get the relative pose from target frame to compliance frame represented in the world frame.
Definition: ImpedanceTask.h:131
void targetVel(const sva::MotionVecd &worldVel) override
Set the target velocity of the surface in the world frame.
Definition: ImpedanceTask.h:122
ImpedanceTask(const mc_rbdyn::RobotFrame &frame, double stiffness=5.0, double weight=1000.0, bool showTarget=true, bool showPose=true, bool showCompliance=true)
Constructor.
const sva::ForceVecd & targetWrench() const noexcept
Get the target wrench in the surface frame.
Definition: ImpedanceTask.h:146
const sva::MotionVecd & targetAccel() const noexcept
Get the target acceleration of the surface in the world frame.
Definition: ImpedanceTask.h:125
const sva::MotionVecd & targetVel() const noexcept
Get the target velocity of the surface in the world frame.
Definition: ImpedanceTask.h:119
const sva::PTransformd & targetPose() const noexcept
Get the target pose of the surface in the world frame.
Definition: ImpedanceTask.h:113
const sva::PTransformd compliancePose() const
Get the compliance pose of the surface in the world frame.
Definition: ImpedanceTask.h:139
void targetPose(const sva::PTransformd &pose)
Set the target pose of the surface in the world frame.
Definition: ImpedanceTask.h:116
void load(mc_solver::QPSolver &solver, const mc_rtc::Configuration &config) override
Load parameters from a Configuration object.
const sva::ForceVecd & filteredMeasuredWrench() const
Get the filtered measured wrench in the surface frame.
Definition: ImpedanceTask.h:161
void targetWrench(const sva::ForceVecd &wrench)
Set the target wrench in the surface frame.
Definition: ImpedanceTask.h:155
ImpedanceGains & gains() noexcept
Access the impedance gains.
Definition: ImpedanceTask.h:110
void update(mc_solver::QPSolver &solver) override
Update the task.
void addToGUI(mc_rtc::gui::StateBuilder &gui) override
double cutoffPeriod() const
Get the cutoff period for the low-pass filter of measured wrench.
Definition: ImpedanceTask.h:164
const sva::ForceVecd & measuredWrench() const
Get the measured wrench in the surface frame.
Definition: ImpedanceTask.h:158
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ImpedanceTask(const std::string &surfaceName, const mc_rbdyn::Robots &robots, unsigned robotIndex, double stiffness=5.0, double weight=1000.0, bool showTarget=true, bool showPose=true, bool showCompliance=true)
Constructor.