robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
mpc_periodic_com_ref.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_MPC_PERIODIC_COM_REF_HPP_
2#define ROBOTOC_MPC_PERIODIC_COM_REF_HPP_
3
4#include <vector>
5#include <memory>
6
7#include "Eigen/Core"
8
13
14
15namespace robotoc {
16
21class MPCPeriodicCoMRef final : public CoMRefBase {
22public:
31 MPCPeriodicCoMRef(const double swing_start_time, const double period_active,
32 const double period_inactive,
33 const int num_phases_in_period=1);
34
39
48 void setPeriod(const double swing_start_time, const double period_active,
49 const double period_inactive,
50 const int num_phases_in_period=1);
51
59 void setCoMRef(const std::shared_ptr<ContactSequence>& contact_sequence,
60 const std::shared_ptr<ContactPlannerBase>& foot_step_planner);
61
62 void updateRef(const GridInfo& grid_info,
63 Eigen::VectorXd& com_ref) const override;
64
65 bool isActive(const GridInfo& grid_info) const override;
66
67private:
68 std::vector<Eigen::Vector3d> com_;
69 std::vector<bool> has_inactive_contacts_;
70 double swing_start_time_, period_active_, period_inactive_, period_;
71 int num_phases_in_period_;
72};
73
74} // namespace robotoc
75
76#endif // ROBOTOC_MPC_PERIODIC_COM_REF_HPP_
Base class of reference position of the center of mass (CoM).
Definition: com_ref_base.hpp:15
Periodic reference positions of the center of mass.
Definition: mpc_periodic_com_ref.hpp:21
void setPeriod(const double swing_start_time, const double period_active, const double period_inactive, const int num_phases_in_period=1)
Set period.
void updateRef(const GridInfo &grid_info, Eigen::VectorXd &com_ref) const override
Computes the reference CoM position.
~MPCPeriodicCoMRef()
Destructor.
MPCPeriodicCoMRef(const double swing_start_time, const double period_active, const double period_inactive, const int num_phases_in_period=1)
Constructor.
bool isActive(const GridInfo &grid_info) const override
Checks wheather the cost is active or not for the given grid info.
void setCoMRef(const std::shared_ptr< ContactSequence > &contact_sequence, const std::shared_ptr< ContactPlannerBase > &foot_step_planner)
Set the reference positions of CoM from the contact positions of the contact sequence....
Definition: constraint_component_base.hpp:17
Grid information.
Definition: grid_info.hpp:24