robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::TrotFootStepPlanner Class Referencefinal

Foot step planner for the trot gait of quadrupeds. More...

#include <trot_foot_step_planner.hpp>

Inheritance diagram for robotoc::TrotFootStepPlanner:
Collaboration diagram for robotoc::TrotFootStepPlanner:

Public Member Functions

 TrotFootStepPlanner (const Robot &quadruped_robot)
 Constructs the planner. More...
 
 TrotFootStepPlanner ()
 Default constructor. More...
 
 ~TrotFootStepPlanner ()
 Destructor. More...
 
 TrotFootStepPlanner (const TrotFootStepPlanner &)=default
 Default copy constructor. More...
 
TrotFootStepPlanneroperator= (const TrotFootStepPlanner &)=default
 Default copy assign operator. More...
 
 TrotFootStepPlanner (TrotFootStepPlanner &&) noexcept=default
 Default move constructor. More...
 
TrotFootStepPlanneroperator= (TrotFootStepPlanner &&) noexcept=default
 Default move assign operator. More...
 
void setGaitPattern (const Eigen::Vector3d &step_length, const double step_yaw, const bool enable_stance_phase)
 Sets the gait pattern by step length and yaw step command. More...
 
void setRaibertGaitPattern (const Eigen::Vector3d &vcom_cmd, const double yaw_rate_cmd, const double swing_time, const double stance_time, const double gain)
 Sets the gait pattern by Raibert heuristic. More...
 
void setContactSurfaces (const std::vector< Eigen::Matrix3d > &contact_surfaces)
 Sets the rotation of the contact surfaces. More...
 
void setContactSurfaces (const std::vector< std::vector< Eigen::Matrix3d > > &contact_surfaces)
 Sets the rotation of the contact surfaces over the mutiple steps. More...
 
void init (const Eigen::VectorXd &q) override
 Initializes the planner. More...
 
bool plan (const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const ContactStatus &contact_status, const int planning_steps) override
 Plans the foot steps in the MPC (receding-horizon) fashion. More...
 
const aligned_vector< SE3 > & contactPlacements (const int step) const override
 This is invalid in TrotFootStepPlanner. More...
 
const std::vector< Eigen::Vector3d > & contactPositions (const int step) const override
 Gets the contact positions of a specified step. More...
 
const std::vector< Eigen::Matrix3d > & contactSurfaces (const int step) const override
 Gets the contact surfaces of a specified step. More...
 
const Eigen::Vector3d & CoM (const int step) const override
 Gets the CoM position of a specified step. More...
 
const Eigen::Matrix3d & R (const int step) const override
 Gets the rotation matrix of the base at a specified step. More...
 
int size () const override
 Gets the size of each planned quantities. More...
 
- Public Member Functions inherited from robotoc::ContactPlannerBase
 ContactPlannerBase ()
 Default constructor. More...
 
virtual ~ContactPlannerBase ()
 Destructor. More...
 
 ContactPlannerBase (const ContactPlannerBase &)=default
 Default copy constructor. More...
 
ContactPlannerBaseoperator= (const ContactPlannerBase &)=default
 Default copy assign operator. More...
 
 ContactPlannerBase (ContactPlannerBase &&) noexcept=default
 Default move constructor. More...
 
ContactPlannerBaseoperator= (ContactPlannerBase &&) noexcept=default
 Default move assign operator. More...
 
virtual void init (const Eigen::VectorXd &q)=0
 Initializes the planner. More...
 
virtual bool plan (const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const ContactStatus &contact_status, const int planning_steps)=0
 Plans the foot steps in the MPC (receding-horizon) fashion. More...
 
virtual const aligned_vector< SE3 > & contactPlacements (const int step) const =0
 Gets the contact placements of a specified step. More...
 
virtual const std::vector< Eigen::Vector3d > & contactPositions (const int step) const =0
 Gets the contact positions of a specified step. More...
 
virtual const std::vector< Eigen::Matrix3d > & contactSurfaces (const int step) const =0
 Gets the contact surfaces of a specified step. More...
 
virtual const Eigen::Vector3d & CoM (const int step) const =0
 Gets the CoM position of a specified step. More...
 
virtual const Eigen::Matrix3d & R (const int step) const =0
 Gets the rotation matrix of the base at a specified step. More...
 
virtual int size () const =0
 Gets the size of each planned quantities. More...
 
void disp (std::ostream &os) const
 

Friends

std::ostream & operator<< (std::ostream &os, const TrotFootStepPlanner &planner)
 
std::ostream & operator<< (std::ostream &os, const std::shared_ptr< TrotFootStepPlanner > &planner)
 

Detailed Description

Foot step planner for the trot gait of quadrupeds.

Constructor & Destructor Documentation

◆ TrotFootStepPlanner() [1/4]

robotoc::TrotFootStepPlanner::TrotFootStepPlanner ( const Robot quadruped_robot)

Constructs the planner.

Parameters
[in]quadruped_robotQuadruped robot model.

◆ TrotFootStepPlanner() [2/4]

robotoc::TrotFootStepPlanner::TrotFootStepPlanner ( )

Default constructor.

◆ ~TrotFootStepPlanner()

robotoc::TrotFootStepPlanner::~TrotFootStepPlanner ( )

Destructor.

◆ TrotFootStepPlanner() [3/4]

robotoc::TrotFootStepPlanner::TrotFootStepPlanner ( const TrotFootStepPlanner )
default

Default copy constructor.

◆ TrotFootStepPlanner() [4/4]

robotoc::TrotFootStepPlanner::TrotFootStepPlanner ( TrotFootStepPlanner &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ CoM()

const Eigen::Vector3d & robotoc::TrotFootStepPlanner::CoM ( const int  step) const
overridevirtual

Gets the CoM position of a specified step.

Parameters
[in]stepStep of interest.
Returns
const reference to CoM position of a specified step.
Remarks
step=0: previous step, step=1: initial step.

Implements robotoc::ContactPlannerBase.

◆ contactPlacements()

const aligned_vector< SE3 > & robotoc::TrotFootStepPlanner::contactPlacements ( const int  step) const
overridevirtual

This is invalid in TrotFootStepPlanner.

Implements robotoc::ContactPlannerBase.

◆ contactPositions()

const std::vector< Eigen::Vector3d > & robotoc::TrotFootStepPlanner::contactPositions ( const int  step) const
overridevirtual

Gets the contact positions of a specified step.

Parameters
[in]stepStep of interest.
Returns
const reference to the contact positions of a specified step.
Remarks
step=0: previous step, step=1: initial step.

Implements robotoc::ContactPlannerBase.

◆ contactSurfaces()

const std::vector< Eigen::Matrix3d > & robotoc::TrotFootStepPlanner::contactSurfaces ( const int  step) const
overridevirtual

Gets the contact surfaces of a specified step.

Parameters
[in]stepStep of interest.
Returns
const reference to the contact surfaces of a specified step.
Remarks
step=0: previous step, step=1: initial step.

Implements robotoc::ContactPlannerBase.

◆ init()

void robotoc::TrotFootStepPlanner::init ( const Eigen::VectorXd &  q)
overridevirtual

Initializes the planner.

Parameters
[in]qInitial configuration. Size must be Robot::dimq().

Implements robotoc::ContactPlannerBase.

◆ operator=() [1/2]

TrotFootStepPlanner & robotoc::TrotFootStepPlanner::operator= ( const TrotFootStepPlanner )
default

Default copy assign operator.

◆ operator=() [2/2]

TrotFootStepPlanner & robotoc::TrotFootStepPlanner::operator= ( TrotFootStepPlanner &&  )
defaultnoexcept

Default move assign operator.

◆ plan()

bool robotoc::TrotFootStepPlanner::plan ( const double  t,
const Eigen::VectorXd &  q,
const Eigen::VectorXd &  v,
const ContactStatus contact_status,
const int  planning_steps 
)
overridevirtual

Plans the foot steps in the MPC (receding-horizon) fashion.

Parameters
[in]tInitial time.
[in]qInitial configuration. Size must be Robot::dimq().
[in]vInitial velocity. Size must be Robot::dimv().
[in]contact_statusInitial contact status.
[in]planning_stepsNumber of planning steps. Must be non-negative.
Returns
True if the planning is succeeded. False if not.
Remarks
The linear and angular velocities of the floating base are assumed to be expressed in the body local coordinate.
The implementation must follow: step=0: previous step, step=1: initial step (specified as q and contact_status).

Implements robotoc::ContactPlannerBase.

◆ R()

const Eigen::Matrix3d & robotoc::TrotFootStepPlanner::R ( const int  step) const
overridevirtual

Gets the rotation matrix of the base at a specified step.

Parameters
[in]stepStep of interest.
Returns
const reference to rotation matrix of the base at a specified step.
Remarks
step=0: previous step, step=1: initial step.

Implements robotoc::ContactPlannerBase.

◆ setContactSurfaces() [1/2]

void robotoc::TrotFootStepPlanner::setContactSurfaces ( const std::vector< Eigen::Matrix3d > &  contact_surfaces)

Sets the rotation of the contact surfaces.

Parameters
[in]contact_surfacesRotation of the contact surfaces.

◆ setContactSurfaces() [2/2]

void robotoc::TrotFootStepPlanner::setContactSurfaces ( const std::vector< std::vector< Eigen::Matrix3d > > &  contact_surfaces)

Sets the rotation of the contact surfaces over the mutiple steps.

Parameters
[in]contact_surfacesRotation of the contact surfaces.

◆ setGaitPattern()

void robotoc::TrotFootStepPlanner::setGaitPattern ( const Eigen::Vector3d &  step_length,
const double  step_yaw,
const bool  enable_stance_phase 
)

Sets the gait pattern by step length and yaw step command.

Parameters
[in]step_lengthStep length of the gait.
[in]step_yawYaw command at each step of the gait.
[in]enable_stance_phaseEnables the stance phase or not.

◆ setRaibertGaitPattern()

void robotoc::TrotFootStepPlanner::setRaibertGaitPattern ( const Eigen::Vector3d &  vcom_cmd,
const double  yaw_rate_cmd,
const double  swing_time,
const double  stance_time,
const double  gain 
)

Sets the gait pattern by Raibert heuristic.

Parameters
[in]vcom_cmdCommand of the COM velocity.
[in]yaw_rate_cmdCommand of the yaw-rate of the body.
[in]swing_timeSwing time of the gait.
[in]stance_timeStance time of the gait.
[in]gainThe feedback gain of the vcom_cmd.

◆ size()

int robotoc::TrotFootStepPlanner::size ( ) const
inlineoverridevirtual

Gets the size of each planned quantities.

Returns
Size of planning.

Implements robotoc::ContactPlannerBase.

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  os,
const std::shared_ptr< TrotFootStepPlanner > &  planner 
)
friend

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  os,
const TrotFootStepPlanner planner 
)
friend

The documentation for this class was generated from the following file: