robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
Periodic reference configuration for MPC of legged robots. More...
#include <mpc_periodic_configuration_ref.hpp>
Public Member Functions | |
MPCPeriodicConfigurationRef (const Eigen::VectorXd &q, const double swing_start_time, const double period_active, const double period_inactive, const int num_phases_in_period=1) | |
Constructor. More... | |
~MPCPeriodicConfigurationRef () | |
Destructor. More... | |
void | setPeriod (const double swing_start_time, const double period_active, const double period_inactive, const int num_phases_in_period=1) |
Set period. More... | |
void | setConfigurationRef (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. Also, the CoM refs of the first and last contact phases are defined by user. More... | |
void | updateRef (const Robot &robot, const GridInfo &grid_info, Eigen::VectorXd &q_ref) const override |
Computes the reference configuration. More... | |
bool | isActive (const GridInfo &grid_info) const override |
Checks wheather the cost is active or not at the specified time. More... | |
Public Member Functions inherited from robotoc::ConfigurationSpaceRefBase | |
ConfigurationSpaceRefBase () | |
Default constructor. More... | |
virtual | ~ConfigurationSpaceRefBase () |
Destructor. More... | |
ConfigurationSpaceRefBase (const ConfigurationSpaceRefBase &)=default | |
Default copy constructor. More... | |
ConfigurationSpaceRefBase & | operator= (const ConfigurationSpaceRefBase &)=default |
Default copy operator. More... | |
ConfigurationSpaceRefBase (ConfigurationSpaceRefBase &&) noexcept=default | |
Default move constructor. More... | |
ConfigurationSpaceRefBase & | operator= (ConfigurationSpaceRefBase &&) noexcept=default |
Default move assign operator. More... | |
virtual void | updateRef (const Robot &robot, const GridInfo &grid_info, Eigen::VectorXd &q_ref) const =0 |
Computes the reference configuration. More... | |
virtual bool | isActive (const GridInfo &grid_info) const =0 |
Checks wheather the cost is active or not at the specified time. More... | |
Periodic reference configuration for MPC of legged robots.
robotoc::MPCPeriodicConfigurationRef::MPCPeriodicConfigurationRef | ( | const Eigen::VectorXd & | q, |
const double | swing_start_time, | ||
const double | period_active, | ||
const double | period_inactive, | ||
const int | num_phases_in_period = 1 |
||
) |
Constructor.
[in] | q | Reference configuration. |
[in] | swing_start_time | Start time of the reference tracking. |
[in] | period_active | Period where the tracking is active. |
[in] | period_inactive | Period where the tracking is inactive. |
[in] | num_phases_in_period | Number of phases in a period. Must be positive. Default is 1. |
robotoc::MPCPeriodicConfigurationRef::~MPCPeriodicConfigurationRef | ( | ) |
Destructor.
|
overridevirtual |
Checks wheather the cost is active or not at the specified time.
[in] | grid_info | Grid info. |
Implements robotoc::ConfigurationSpaceRefBase.
void robotoc::MPCPeriodicConfigurationRef::setConfigurationRef | ( | 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. Also, the CoM refs of the first and last contact phases are defined by user.
[in] | contact_sequence | Contact sequence. |
[in] | foot_step_planner | Foot step planner. |
void robotoc::MPCPeriodicConfigurationRef::setPeriod | ( | const double | swing_start_time, |
const double | period_active, | ||
const double | period_inactive, | ||
const int | num_phases_in_period = 1 |
||
) |
Set period.
[in] | swing_start_time | Start time of the reference tracking. |
[in] | period_active | Period where the tracking is active. |
[in] | period_inactive | Period where the tracking is inactive. |
[in] | num_phases_in_period | Number of phases in a period. Must be positive. Default is 1. |
|
overridevirtual |
Computes the reference configuration.
[in] | robot | Robot model. |
[in] | grid_info | Grid info. |
[in] | q_ref | Reference position. Size is Robot::dimq(). |
Implements robotoc::ConfigurationSpaceRefBase.