12 template <
class Dynamics>
16 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
21 const RBDState& desState =
RBDState(),
22 const Eigen::Matrix<double, 6, 1>& Kp = Eigen::Matrix<double, 6, 1>::Zero(),
23 const Eigen::Matrix<double, 6, 1>& Kd = Eigen::Matrix<double, 6, 1>::Zero())
24 : dynamics_(dynamics), desState_(desState), Kp_(Kp), Kd_(Kd)
29 void setPoseGains(
const Eigen::Matrix<double, 6, 1>& Kp) { Kp_ = Kp; }
34 kindr::RotationQuaternionD Bcurr_q_Bdes(
36 kindr::EulerAnglesXyzPD Bcurr_eul_Bdes(Bcurr_q_Bdes);
39 Eigen::Matrix<double, 6, 1> aDesEigen = Eigen::Matrix<double, 6, 1>::Zero();
42 aDesEigen.segment(0, 3) = Kp_.segment(0, 3).cwiseProduct(Bcurr_eul_Bdes.getUnique().toImplementation());
47 Eigen::Vector3d W_weightedPosError = Kp_.segment(3, 3).cwiseProduct(W_positionError);
64 bool gravityCompensation =
true)
70 if (gravityCompensation)
72 dynamics_->ProjectedInverseDynamics(eeInContact, currState, aDes, uId);
76 dynamics_->ProjectedInverseDynamicsNoGravity(eeInContact, currState, aDes, uId);
84 std::shared_ptr<Dynamics> dynamics_;
88 Eigen::Matrix<double, 6, 1> Kp_;
89 Eigen::Matrix<double, 6, 1> Kd_;
void setPoseGains(const Eigen::Matrix< double, 6, 1 > &Kp)
Definition: IDControllerFB.h:29
RigidBodyPose_t & basePose()
get base pose
Definition: RBDState.h:67
IDControllerFB(std::shared_ptr< Dynamics > dynamics=std::shared_ptr< Dynamics >(new Dynamics()), const RBDState &desState=RBDState(), const Eigen::Matrix< double, 6, 1 > &Kp=Eigen::Matrix< double, 6, 1 >::Zero(), const Eigen::Matrix< double, 6, 1 > &Kd=Eigen::Matrix< double, 6, 1 >::Zero())
Definition: IDControllerFB.h:20
Eigen::Matrix< SCALAR, NJOINTS, 1 > control_vector_t
Definition: Dynamics.h:62
RigidBodyState_t & base()
get base states
Definition: RBDState.h:63
Cored::Vector3 Vector3d
Definition: rbd.h:137
const Position3Tpl & position() const
This method returns the position of the Base frame in the inertia frame.
Definition: RigidBodyPose.h:246
Definition: IDControllerFB.h:13
void setTwistGains(const Eigen::Matrix< double, 6, 1 > &Kd)
Definition: IDControllerFB.h:30
RigidBodyVelocities< SCALAR > & velocities()
return the rigid body velocities
Definition: RigidBodyState.h:42
joint states and base states
Definition: RBDState.h:27
Vector3s rotateInertiaToBase(const Vector3s &vector) const
This methods rotates a 3D vector expressed in Inertia frame to Base Frame.
Definition: RigidBodyPose.h:339
void setDesiredState(const RBDState &desState)
Definition: IDControllerFB.h:28
Dynamics::control_vector_t computeTorque(const RBDState &currState, const typename Dynamics::EE_in_contact_t &eeInContact, bool gravityCompensation=true)
Definition: IDControllerFB.h:62
ct::rbd::Dynamics< RobCoGenContainer< SCALAR >, Utils< SCALAR >::N_EE > Dynamics
Definition: robcogenHelpers.h:773
joint acceleration and base acceleration
Definition: RBDAcceleration.h:23
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Dynamics::RBDState_t RBDState
Definition: IDControllerFB.h:18
kindr::RotationQuaternion< SCALAR > getRotationQuaternion() const
This method returns the quaternion rotation.
Definition: RigidBodyPose.h:134
void setZero()
Definition: RBDAcceleration.h:95
Dynamics::RBDAcceleration_t computeDesiredAcceleration(const RBDState &currBaseState)
Definition: IDControllerFB.h:31
RigidBodyAcceleration_t & base()
get base acceleration
Definition: RBDAcceleration.h:48
void fromVector6d(const Eigen::Matrix< SCALAR, 6, 1 > &in)
Definition: RigidBodyAcceleration.h:35