41 params.dt_constraint_dynamic_,
58 return k6D*k + dimension;
72 bounds.at(
GetRow(k,dim)) = ifopt::BoundZero;
82 Jacobian jac_model(
k6D,n);
89 jac_model =
model_->GetJacobianWrtBaseLin(jac_base_lin_pos,
99 for (
int ee=0; ee<
model_->GetEECount(); ++ee) {
102 Jacobian jac_ee_force =
ee_forces_.at(ee)->GetJacobianWrtNodes(t,
kPos);
103 jac_model =
model_->GetJacobianWrtForce(jac_ee_force, ee);
107 Jacobian jac_ee_pos =
ee_motion_.at(ee)->GetJacobianWrtNodes(t,
kPos);
108 jac_model =
model_->GetJacobianWrtEEPos(jac_ee_pos, ee);
112 Jacobian jac_f_dT =
ee_forces_.at(ee)->GetJacobianOfPosWrtDurations(t);
113 jac_model +=
model_->GetJacobianWrtForce(jac_f_dT, ee);
115 Jacobian jac_x_dT =
ee_motion_.at(ee)->GetJacobianOfPosWrtDurations(t);
116 jac_model +=
model_->GetJacobianWrtEEPos(jac_x_dT, ee);
132 int n_ee =
model_->GetEECount();
133 std::vector<Eigen::Vector3d> ee_pos;
134 std::vector<Eigen::Vector3d> ee_force;
135 for (
int ee=0; ee<n_ee; ++ee) {
136 ee_force.push_back(
ee_forces_.at(ee)->GetPoint(t).p());
137 ee_pos.push_back(
ee_motion_.at(ee)->GetPoint(t).p());
140 model_->SetCurrent(com.p(), com.a(), w_R_b, omega, omega_dot, ee_force, ee_pos);
DynamicConstraint(const DynamicModel::Ptr &model, const Parameters ¶ms, const SplineHolder &spline_holder)
Construct a Dynamic constraint.
Constraints evaluated at discretized times along a trajectory.
void UpdateModel(double t) const
Updates the model with the current state and forces.
virtual void UpdateConstraintAtInstance(double t, int k, VectorXd &g) const override
Sets the constraint value a specific time t, corresponding to node k.
EulerConverter base_angular_
angular base state
NodeSpline::Ptr base_linear_
lin. base pos/vel/acc in world frame
static std::string EESchedule(uint ee)
virtual void UpdateJacobianAtInstance(double t, int k, std::string, Jacobian &) const override
Sets Jacobian rows at a specific time t, corresponding to node k.
static const Dim6D AllDim6D[]
Vector3d GetAngularAccelerationInWorld(double t) const
Converts Euler angles, rates and rate derivatives o angular accelerations.
Holds pointers to fully constructed splines, that are linked to the optimization variables.
int GetNumberOfNodes() const
Converts Euler angles and derivatives to angular quantities.
NodeSpline::Ptr base_linear_
std::shared_ptr< DynamicModel > Ptr
static std::string EEMotionNodes(uint ee)
std::vector< NodeSpline::Ptr > ee_force_
NodeSpline::Ptr base_angular_
std::vector< NodeSpline::Ptr > ee_forces_
endeffector forces in world frame.
Vector3d GetAngularVelocityInWorld(double t) const
Converts Euler angles and Euler rates to angular velocities.
virtual void UpdateBoundsAtInstance(double t, int k, VecBound &bounds) const override
Sets upper/lower bound a specific time t, corresponding to node k.
std::vector< NodeSpline::Ptr > ee_motion_
endeffector position in world frame.
Holds the parameters to tune the optimization problem.
MatrixSXd GetRotationMatrixBaseToWorld(double t) const
Converts the Euler angles at time t to a rotation matrix.
static std::string EEForceNodes(uint ee)
static const std::string base_ang_nodes
DynamicModel::Ptr model_
the dynamic model (e.g. Centroidal)
std::vector< NodeSpline::Ptr > ee_motion_
static const std::string base_lin_nodes
int GetRow(int k, Dim6D dimension) const
The row in the overall constraint for this evaluation time.