Go to the documentation of this file.
21 template<
bool StrictlyPositive>
24 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42 inline Eigen::Vector6d
vector() const noexcept {
return vec_.vector(); }
44 inline void vec(
const sva::ImpedanceVecd & v) noexcept
50 inline void vec(
const Eigen::Vector6d & v) noexcept
56 inline void vec(
const Eigen::Vector3d & a,
const Eigen::Vector3d & l) noexcept
62 inline void vec(
double a,
double l) noexcept
68 inline const sva::ImpedanceVecd &
vec() const noexcept {
return vec_; }
70 inline void angular(
const Eigen::Vector3d & v) noexcept { vec_.angular() = v.cwiseMax(limit); }
74 inline const Eigen::Vector3d &
angular() const noexcept {
return vec_.angular(); }
76 inline void linear(
const Eigen::Vector3d & v) noexcept { vec_.linear() = v.cwiseMax(limit); }
78 inline void linear(
double linear) noexcept { vec_.linear().setConstant(std::max(
linear, limit)); }
80 inline const Eigen::Vector3d &
linear() const noexcept {
return vec_.linear(); }
83 static constexpr
double limit = StrictlyPositive ? 1e-6 : 0.0;
84 sva::ImpedanceVecd vec_;
90 constexpr
double ImpedanceVecd<b>::limit;
97 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
166 if(config.
has(
"mass"))
168 sva::ImpedanceVecd M = config(
"mass");
171 if(config.
has(
"damper"))
173 sva::ImpedanceVecd D = config(
"damper");
176 if(config.
has(
"spring"))
178 sva::ImpedanceVecd K = config(
"spring");
181 if(config.
has(
"wrench"))
183 sva::ImpedanceVecd wrench = config(
"wrench");
192 out.
add(
"damper", ig.
D().
vec());
193 out.
add(
"spring", ig.
K().
vec());
void angular(const Eigen::Vector3d &v) noexcept
Definition: ImpedanceGains.h:70
details::ImpedanceVecd< false > & wrench() noexcept
Definition: ImpedanceGains.h:129
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
ImpedanceVecd(const sva::ImpedanceVecd &v)
Definition: ImpedanceGains.h:28
const sva::ImpedanceVecd & vec() const noexcept
Definition: ImpedanceGains.h:68
static mc_rtc::Configuration save(const mc_tasks::force::ImpedanceGains &ig)
Definition: ImpedanceGains.h:188
static ImpedanceGains Default()
Definition: ImpedanceGains.h:132
details::ImpedanceVecd< true > & mass() noexcept
Definition: ImpedanceGains.h:106
details::ImpedanceVecd< false > K_
Definition: ImpedanceGains.h:148
#define MC_TASKS_DLLAPI
Definition: api.h:50
const details::ImpedanceVecd< true > & mass() const noexcept
Definition: ImpedanceGains.h:104
const EIGEN_MAKE_ALIGNED_OPERATOR_NEW details::ImpedanceVecd< true > & M() const noexcept
Definition: ImpedanceGains.h:100
details::ImpedanceVecd< false > & damper() noexcept
Definition: ImpedanceGains.h:115
Definition: ImpedanceGains.h:22
const Eigen::Vector3d & angular() const noexcept
Definition: ImpedanceGains.h:74
Represent impedance gains for an ImpedanceTask.
Definition: ImpedanceGains.h:95
const details::ImpedanceVecd< false > & wrench() const noexcept
Definition: ImpedanceGains.h:127
details::ImpedanceVecd< false > & spring() noexcept
Definition: ImpedanceGains.h:124
void angular(double angular) noexcept
Definition: ImpedanceGains.h:72
details::ImpedanceVecd< false > wrench_
Definition: ImpedanceGains.h:150
void vec(const sva::ImpedanceVecd &v) noexcept
Definition: ImpedanceGains.h:44
const details::ImpedanceVecd< false > & spring() const noexcept
Definition: ImpedanceGains.h:122
const details::ImpedanceVecd< false > & K() const noexcept
Definition: ImpedanceGains.h:118
ImpedanceVecd(double angular_, double linear_)
Definition: ImpedanceGains.h:30
bool has(const std::string &key) const
Check if the key is part of the conf.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ImpedanceVecd()
Definition: ImpedanceGains.h:26
const details::ImpedanceVecd< false > & D() const noexcept
Definition: ImpedanceGains.h:109
void vec(const Eigen::Vector3d &a, const Eigen::Vector3d &l) noexcept
Definition: ImpedanceGains.h:56
static mc_tasks::force::ImpedanceGains load(const mc_rtc::Configuration &config)
Definition: ImpedanceGains.h:163
details::ImpedanceVecd< true > & M() noexcept
Definition: ImpedanceGains.h:102
void linear(double linear) noexcept
Definition: ImpedanceGains.h:78
void add(const std::string &key, bool value)
Add a bool element to the Configuration.
details::ImpedanceVecd< true > M_
Definition: ImpedanceGains.h:144
ImpedanceVecd & operator=(const sva::ImpedanceVecd &v)
Definition: ImpedanceGains.h:36
details::ImpedanceVecd< false > & K() noexcept
Definition: ImpedanceGains.h:120
const details::ImpedanceVecd< false > & damper() const noexcept
Definition: ImpedanceGains.h:113
void vec(double a, double l) noexcept
Definition: ImpedanceGains.h:62
const Eigen::Vector3d & linear() const noexcept
Definition: ImpedanceGains.h:80
void vec(const Eigen::Vector6d &v) noexcept
Definition: ImpedanceGains.h:50
details::ImpedanceVecd< false > & D() noexcept
Definition: ImpedanceGains.h:111
Definition: Configuration.h:55
details::ImpedanceVecd< false > D_
Definition: ImpedanceGains.h:146
Definition: StabilizerStandingState.h:11
void linear(const Eigen::Vector3d &v) noexcept
Definition: ImpedanceGains.h:76
Eigen::Vector6d vector() const noexcept
Definition: ImpedanceGains.h:42