3
3
4
4
#include " aligator/modelling/dynamics/multibody-constraint-fwd.hpp"
5
5
#include < aligator/modelling/dynamics/integrator-semi-euler.hpp>
6
- #include < aligator/modelling/multibody/center-of-mass-translation.hpp>
7
6
#include < aligator/modelling/multibody/centroidal-momentum.hpp>
8
7
#include < aligator/modelling/multibody/contact-force.hpp>
9
8
#include < aligator/modelling/multibody/dcm-position.hpp>
@@ -26,7 +25,6 @@ namespace simple_mpc
26
25
using FrameTranslationResidual = FrameTranslationResidualTpl<double >;
27
26
using FrameVelocityResidual = FrameVelocityResidualTpl<double >;
28
27
using DCMPositionResidual = DCMPositionResidualTpl<double >;
29
- using CenterOfMassTranslationResidual = CenterOfMassTranslationResidualTpl<double >;
30
28
using IntegratorSemiImplEuler = dynamics::IntegratorSemiImplEulerTpl<double >;
31
29
32
30
FullDynamicsOCP::FullDynamicsOCP (const FullDynamicsSettings & settings, const RobotModelHandler & model_handler)
@@ -423,9 +421,7 @@ namespace simple_mpc
423
421
424
422
term_cost.addCost (
425
423
" state_cost" , QuadraticStateCost (ter_space, nu_, model_handler_.getReferenceState (), settings_.w_x ));
426
- /* term_cost.addCost(
427
- "centroidal_cost",
428
- QuadraticResidualCost(ter_space, cent_mom, settings_.w_cent)); */
424
+ term_cost.addCost (" centroidal_cost" , QuadraticResidualCost (ter_space, cent_mom, settings_.w_cent * 10 ));
429
425
430
426
return term_cost;
431
427
}
@@ -436,30 +432,12 @@ namespace simple_mpc
436
432
{
437
433
throw std::runtime_error (" Create problem first!" );
438
434
}
439
- CenterOfMassTranslationResidual com_cstr =
440
- CenterOfMassTranslationResidual (ndx_, nu_, model_handler_.getModel (), com_ref);
441
435
442
436
double tau = sqrt (com_ref[2 ] / 9.81 );
443
437
DCMPositionResidual dcm_cstr = DCMPositionResidual (ndx_, nu_, model_handler_.getModel (), com_ref, tau);
444
438
445
439
problem_->addTerminalConstraint (dcm_cstr, EqualityConstraint ());
446
440
447
- Motion v_ref = Motion::Zero ();
448
- for (auto const & name : model_handler_.getFeetNames ())
449
- {
450
- FrameVelocityResidual frame_vel = FrameVelocityResidual (
451
- ndx_, nu_, model_handler_.getModel (), v_ref, model_handler_.getFootId (name), pinocchio::LOCAL_WORLD_ALIGNED);
452
- if (settings_.force_size == 6 )
453
- problem_->addTerminalConstraint (frame_vel, EqualityConstraint ());
454
- else
455
- {
456
- std::vector<int > vel_id = {0 , 1 , 2 };
457
-
458
- FunctionSliceXpr vel_slice = FunctionSliceXpr (frame_vel, vel_id);
459
- problem_->addTerminalConstraint (vel_slice, EqualityConstraint ());
460
- }
461
- }
462
-
463
441
terminal_constraint_ = true ;
464
442
}
465
443
0 commit comments