1#ifndef ROBOTOC_MPC_JUMP_HPP_
2#define ROBOTOC_MPC_JUMP_HPP_
89 const
double flying_time, const
double min_flying_time,
90 const
double ground_time, const
double min_ground_time);
101 void init(const
double t, const Eigen::VectorXd& q, const Eigen::VectorXd& v,
114 void reset(const Eigen::VectorXd& q, const Eigen::VectorXd& v);
127 void reset(const
double t, const Eigen::VectorXd& q, const Eigen::VectorXd& v,
146 const Eigen::VectorXd& v);
183 double KKTError(
const double t,
const Eigen::VectorXd& q,
184 const Eigen::VectorXd& v);
234 return contact_sequence_;
244 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
247 std::shared_ptr<ContactPlannerBase> foot_step_planner_;
248 std::shared_ptr<ContactSequence> contact_sequence_;
249 std::shared_ptr<CostFunction> cost_;
250 std::shared_ptr<Constraints> constraints_;
251 std::shared_ptr<robotoc::STOCostFunction> sto_cost_;
252 std::shared_ptr<robotoc::STOConstraints> sto_constraints_;
257 double flying_time_, min_flying_time_, ground_time_, min_ground_time_,
258 T_, dt_, dtm_, t_mpc_start_, eps_;
259 int N_, current_step_;
261 std::shared_ptr<ConfigurationSpaceCost> config_cost_;
262 std::shared_ptr<FrictionCone> friction_cone_;
263 std::shared_ptr<ContactWrenchCone> contact_wrench_cone_;
265 void resetMinimumDwellTimes(
const double t,
const double min_dt);
267 void resetGoalContactPlacements(
const Eigen::VectorXd& q);
269 void resetContactPlacements(
const double t,
const Eigen::VectorXd& q,
270 const Eigen::VectorXd& v);
The state feedback and feedforward policy of LQR subproblem at a time stage.
Definition: lqr_policy.hpp:16
MPC solver for the jump control.
Definition: mpc_jump.hpp:38
void setJumpPattern(const std::shared_ptr< ContactPlannerBase > &foot_step_planner, const double flying_time, const double min_flying_time, const double ground_time, const double min_ground_time)
Sets the gait pattern.
std::shared_ptr< ContactWrenchCone > getContactWrenchConeHandle()
Gets the contact wrench cone constraints handle.
const Eigen::VectorXd & getInitialControlInput() const
Get the initial control input.
void setRobotProperties(const RobotProperties &properties)
Sets a collection of the properties for robot model in this MPC.
void updateSolution(const double t, const double dt, const Eigen::VectorXd &q, const Eigen::VectorXd &v)
Updates the solution by iterationg the Newton-type method.
std::shared_ptr< FrictionCone > getFrictionConeHandle()
Gets the friction cone constraints handle.
void reset()
Resets the optimal control problem solover via the solution computed by init() or reset().
const Solution & getSolution() const
Get the solution over the horizon.
void init(const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const SolverOptions &solver_options, const bool sto=false)
Initializes the optimal control problem solover.
double KKTError(const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v)
Computes the KKT residual of the optimal control problem.
std::shared_ptr< CostFunction > getCostHandle()
Gets the cost function handle.
ControlPolicy getControlPolicy(const double t) const
Gets the control policy at the specified time.
Definition: mpc_jump.hpp:171
MPCJump(const MPCJump &)=default
Default copy constructor.
double KKTError() const
Returns the l2-norm of the KKT residuals. MPCJump::updateSolution() must be computed.
const aligned_vector< LQRPolicy > & getLQRPolicy() const
Gets of the local LQR policies over the horizon.
MPCJump(MPCJump &&) noexcept=default
Default move constructor.
void setSolverOptions(const SolverOptions &solver_options)
Sets the solver options.
MPCJump()
Default constructor.
const std::shared_ptr< ContactSequence > & getContactSequence() const
Gets the const handle of the contact sequence.
Definition: mpc_jump.hpp:233
MPCJump(const Robot &robot, const double T, const int N)
Construct MPC solver.
MPCJump & operator=(const MPCJump &)=default
Default copy assign operator.
const OCPSolver & getSolver() const
Gets the const handle of the MPC solver.
Definition: mpc_jump.hpp:227
std::shared_ptr< Constraints > getConstraintsHandle()
Gets the constraints handle.
std::shared_ptr< ConfigurationSpaceCost > getConfigCostHandle()
Gets the configuration space cost handle.
Optimal control problem solver by Riccati recursion.
Definition: ocp_solver.hpp:41
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Definition: constraint_component_base.hpp:17
aligned_vector< SplitSolution > Solution
Solution to the optimal control problem.
Definition: solution.hpp:16
std::vector< T, Eigen::aligned_allocator< T > > aligned_vector
std vector with Eigen::aligned_allocator.
Definition: aligned_vector.hpp:14
Control pocily constructed for the MPC solution.
Definition: control_policy.hpp:17
Collection of the robot properties, which can change after constructing robot models.
Definition: robot_properties.hpp:30
Options of optimal control solvers.
Definition: solver_options.hpp:17