sobec::WBC Class Reference

#include <sobec/walk-with-traj/wbc.hpp>

Collaboration diagram for sobec::WBC:

Public Member Functions

 WBC ()
 
 WBC (const WBCSettings &settings, const RobotDesigner &design, const HorizonManager &horizon, const Eigen::VectorXd &q0, const Eigen::VectorXd &v0, const std::string &actuationCostName)
 
void initialize (const WBCSettings &settings, const RobotDesigner &design, const HorizonManager &horizon, const Eigen::VectorXd &q0, const Eigen::VectorXd &v0, const std::string &actuationCostName)
 
void initializeSupportTiming ()
 
void updateSupportTiming ()
 
const supportSwitchgetSwitches (const unsigned long before, const unsigned long after)
 
const Eigen::VectorXd & shapeState (const Eigen::VectorXd &q, const Eigen::VectorXd &v)
 
void generateWalkingCycle (ModelMaker &mm)
 
void generateStandingCycle (ModelMaker &mm)
 
void generateWalkingCycleNoThinking (ModelMaker &mm)
 
void generateStandingCycleNoThinking (ModelMaker &mm)
 
void updateStepCycleTiming ()
 
bool timeToSolveDDP (int iteration)
 
void iterate (const Eigen::VectorXd &q_current, const Eigen::VectorXd &v_current, bool is_feasible)
 
void iterate (int iteration, const Eigen::VectorXd &q_current, const Eigen::VectorXd &v_current, bool is_feasible)
 
void iterateNoThinking (const Eigen::VectorXd &q_current, const Eigen::VectorXd &v_current, bool is_feasible)
 
void iterateNoThinking (int iteration, const Eigen::VectorXd &q_current, const Eigen::VectorXd &v_current, bool is_feasible)
 
void recedeWithCycle ()
 
void recedeWithCycle (HorizonManager &cycle)
 
void goToNextDoubleSupport ()
 
WBCSettingsget_settings ()
 
const Eigen::VectorXd & get_x0 () const
 
void set_x0 (const Eigen::VectorXd &x0)
 
HorizonManagerget_walkingCycle ()
 
void set_walkingCycle (const HorizonManager &walkingCycle)
 
HorizonManagerget_standingCycle ()
 
void set_standingCycle (const HorizonManager &standingCycle)
 
HorizonManagerget_horizon ()
 
void set_horizon (const HorizonManager &horizon)
 
RobotDesignerget_designer ()
 
void set_designer (const RobotDesigner &designer)
 
const std::vector< int > & get_land_LF ()
 
const std::vector< int > & get_land_RF ()
 
const std::vector< int > & get_takeoff_LF ()
 
const std::vector< int > & get_takeoff_RF ()
 
const int & get_land_LF_cycle ()
 
const int & get_land_RF_cycle ()
 
const int & get_takeoff_LF_cycle ()
 
const int & get_takeoff_RF_cycle ()
 
const std::vector< pinocchio::SE3 > & getPoseRef_LF ()
 
const pinocchio::SE3 & getPoseRef_LF (unsigned long time)
 
void setPoseRef_LF (const std::vector< pinocchio::SE3 > &ref_LF_poses)
 
void setPoseRef_LF (const pinocchio::SE3 &ref_LF_pose, unsigned long time)
 
const std::vector< pinocchio::SE3 > & getPoseRef_RF ()
 
const pinocchio::SE3 & getPoseRef_RF (unsigned long time)
 
void setPoseRef_RF (const std::vector< pinocchio::SE3 > &ref_RF_poses)
 
void setPoseRef_RF (const pinocchio::SE3 &ref_RF_pose, unsigned long time)
 
const eVector3getCoMRef ()
 
void setCoMRef (eVector3 ref_com)
 
const Eigen::Matrix3d & getBaseRotRef ()
 
void setBaseRotRef (Eigen::Matrix3d ref_base_rotation)
 
const eVector3getVelRef_COM ()
 
void setVelRef_COM (eVector3 ref_com_vel)
 
std::vector< pinocchio::SE3 > & ref_LF_poses ()
 
std::vector< pinocchio::SE3 > & ref_RF_poses ()
 
eVector3ref_com ()
 
Eigen::Matrix3d & ref_base_rot ()
 
eVector3ref_com_vel ()
 
void switchToWalk ()
 
void switchToStand ()
 
LocomotionType currentLocomotion ()
 

Protected Member Functions

void updateStepTrackerReferences ()
 
void updateStepTrackerLastReference ()
 
void updateNonThinkingReferences ()
 
void rewindWalkingCycle ()
 

Protected Attributes

WBCSettings settings_
 
RobotDesigner designer_
 
HorizonManager horizon_
 
HorizonManager walkingCycle_
 
HorizonManager standingCycle_
 
eVector3 ref_com_vel_
 
eVector3 ref_com_
 
eVector3 ref_dcm_
 
Eigen::Matrix3d ref_base_rotation_
 
Eigen::VectorXd x0_
 
LocomotionType now_ = WALKING
 
int nWalkingCycles_
 
double yaw_left_
 
double yaw_right_
 
std::vector< int > takeoff_RF_
 
std::vector< int > takeoff_LF_
 
std::vector< int > land_RF_
 
std::vector< int > land_LF_
 
int takeoff_RF_cycle_
 
int takeoff_LF_cycle_
 
int land_RF_cycle_
 
int land_LF_cycle_
 
std::vector< pinocchio::SE3 > ref_LF_poses_
 
std::vector< pinocchio::SE3 > ref_RF_poses_
 
bool initialized_ = false
 
std::vector< unsigned long > controlled_joints_id_
 
Eigen::VectorXd x_internal_
 
bool time_to_solve_ddp_ = false
 
bool first_switch_to_stand_ = true
 
std::set< std::string > contacts_before_
 
std::set< std::string > contacts_after_
 
supportSwitch switch_
 
int horizon_end_
 

Constructor & Destructor Documentation

◆ WBC() [1/2]

sobec::WBC::WBC ( )

◆ WBC() [2/2]

sobec::WBC::WBC ( const WBCSettings settings,
const RobotDesigner design,
const HorizonManager horizon,
const Eigen::VectorXd &  q0,
const Eigen::VectorXd &  v0,
const std::string &  actuationCostName 
)

Member Function Documentation

◆ currentLocomotion()

LocomotionType sobec::WBC::currentLocomotion ( )
inline

◆ generateStandingCycle()

void sobec::WBC::generateStandingCycle ( ModelMaker mm)
Todo:
: bind it

◆ generateStandingCycleNoThinking()

void sobec::WBC::generateStandingCycleNoThinking ( ModelMaker mm)
Todo:
: bind it

◆ generateWalkingCycle()

void sobec::WBC::generateWalkingCycle ( ModelMaker mm)

◆ generateWalkingCycleNoThinking()

void sobec::WBC::generateWalkingCycleNoThinking ( ModelMaker mm)

◆ get_designer()

RobotDesigner& sobec::WBC::get_designer ( )
inline

◆ get_horizon()

HorizonManager& sobec::WBC::get_horizon ( )
inline

◆ get_land_LF()

const std::vector<int>& sobec::WBC::get_land_LF ( )
inline

◆ get_land_LF_cycle()

const int& sobec::WBC::get_land_LF_cycle ( )
inline

◆ get_land_RF()

const std::vector<int>& sobec::WBC::get_land_RF ( )
inline

◆ get_land_RF_cycle()

const int& sobec::WBC::get_land_RF_cycle ( )
inline

◆ get_settings()

WBCSettings& sobec::WBC::get_settings ( )
inline

◆ get_standingCycle()

HorizonManager& sobec::WBC::get_standingCycle ( )
inline

◆ get_takeoff_LF()

const std::vector<int>& sobec::WBC::get_takeoff_LF ( )
inline

◆ get_takeoff_LF_cycle()

const int& sobec::WBC::get_takeoff_LF_cycle ( )
inline

◆ get_takeoff_RF()

const std::vector<int>& sobec::WBC::get_takeoff_RF ( )
inline

◆ get_takeoff_RF_cycle()

const int& sobec::WBC::get_takeoff_RF_cycle ( )
inline

◆ get_walkingCycle()

HorizonManager& sobec::WBC::get_walkingCycle ( )
inline

◆ get_x0()

const Eigen::VectorXd& sobec::WBC::get_x0 ( ) const
inline

◆ getBaseRotRef()

const Eigen::Matrix3d& sobec::WBC::getBaseRotRef ( )
inline

◆ getCoMRef()

const eVector3& sobec::WBC::getCoMRef ( )
inline

◆ getPoseRef_LF() [1/2]

const std::vector<pinocchio::SE3>& sobec::WBC::getPoseRef_LF ( )
inline

◆ getPoseRef_LF() [2/2]

const pinocchio::SE3& sobec::WBC::getPoseRef_LF ( unsigned long  time)
inline

◆ getPoseRef_RF() [1/2]

const std::vector<pinocchio::SE3>& sobec::WBC::getPoseRef_RF ( )
inline

◆ getPoseRef_RF() [2/2]

const pinocchio::SE3& sobec::WBC::getPoseRef_RF ( unsigned long  time)
inline

◆ getSwitches()

const supportSwitch & sobec::WBC::getSwitches ( const unsigned long  before,
const unsigned long  after 
)

◆ getVelRef_COM()

const eVector3& sobec::WBC::getVelRef_COM ( )
inline

◆ goToNextDoubleSupport()

void sobec::WBC::goToNextDoubleSupport ( )

◆ initialize()

void sobec::WBC::initialize ( const WBCSettings settings,
const RobotDesigner design,
const HorizonManager horizon,
const Eigen::VectorXd &  q0,
const Eigen::VectorXd &  v0,
const std::string &  actuationCostName 
)

The posture required here is the full robot posture in the order of pinicchio

Todo:
: Remove this from the initialization and provide it as a method.

◆ initializeSupportTiming()

void sobec::WBC::initializeSupportTiming ( )

◆ iterate() [1/2]

void sobec::WBC::iterate ( const Eigen::VectorXd &  q_current,
const Eigen::VectorXd &  v_current,
bool  is_feasible 
)

◆ iterate() [2/2]

void sobec::WBC::iterate ( int  iteration,
const Eigen::VectorXd &  q_current,
const Eigen::VectorXd &  v_current,
bool  is_feasible 
)

◆ iterateNoThinking() [1/2]

void sobec::WBC::iterateNoThinking ( const Eigen::VectorXd &  q_current,
const Eigen::VectorXd &  v_current,
bool  is_feasible 
)

◆ iterateNoThinking() [2/2]

void sobec::WBC::iterateNoThinking ( int  iteration,
const Eigen::VectorXd &  q_current,
const Eigen::VectorXd &  v_current,
bool  is_feasible 
)

◆ recedeWithCycle() [1/2]

void sobec::WBC::recedeWithCycle ( )

◆ recedeWithCycle() [2/2]

void sobec::WBC::recedeWithCycle ( HorizonManager cycle)

◆ ref_base_rot()

Eigen::Matrix3d& sobec::WBC::ref_base_rot ( )
inline

◆ ref_com()

eVector3& sobec::WBC::ref_com ( )
inline

◆ ref_com_vel()

eVector3& sobec::WBC::ref_com_vel ( )
inline

◆ ref_LF_poses()

std::vector<pinocchio::SE3>& sobec::WBC::ref_LF_poses ( )
inline

◆ ref_RF_poses()

std::vector<pinocchio::SE3>& sobec::WBC::ref_RF_poses ( )
inline

◆ rewindWalkingCycle()

void sobec::WBC::rewindWalkingCycle ( )
protected

This function brings the walking cycle to the beggining of a double support

◆ set_designer()

void sobec::WBC::set_designer ( const RobotDesigner designer)
inline

◆ set_horizon()

void sobec::WBC::set_horizon ( const HorizonManager horizon)
inline

◆ set_standingCycle()

void sobec::WBC::set_standingCycle ( const HorizonManager standingCycle)
inline

◆ set_walkingCycle()

void sobec::WBC::set_walkingCycle ( const HorizonManager walkingCycle)
inline

◆ set_x0()

void sobec::WBC::set_x0 ( const Eigen::VectorXd &  x0)
inline

◆ setBaseRotRef()

void sobec::WBC::setBaseRotRef ( Eigen::Matrix3d  ref_base_rotation)
inline

◆ setCoMRef()

void sobec::WBC::setCoMRef ( eVector3  ref_com)
inline

◆ setPoseRef_LF() [1/2]

void sobec::WBC::setPoseRef_LF ( const pinocchio::SE3 &  ref_LF_pose,
unsigned long  time 
)
inline

◆ setPoseRef_LF() [2/2]

void sobec::WBC::setPoseRef_LF ( const std::vector< pinocchio::SE3 > &  ref_LF_poses)
inline

◆ setPoseRef_RF() [1/2]

void sobec::WBC::setPoseRef_RF ( const pinocchio::SE3 &  ref_RF_pose,
unsigned long  time 
)
inline

◆ setPoseRef_RF() [2/2]

void sobec::WBC::setPoseRef_RF ( const std::vector< pinocchio::SE3 > &  ref_RF_poses)
inline

◆ setVelRef_COM()

void sobec::WBC::setVelRef_COM ( eVector3  ref_com_vel)
inline

◆ shapeState()

const Eigen::VectorXd & sobec::WBC::shapeState ( const Eigen::VectorXd &  q,
const Eigen::VectorXd &  v 
)

◆ switchToStand()

void sobec::WBC::switchToStand ( )
inline

◆ switchToWalk()

void sobec::WBC::switchToWalk ( )
inline

◆ timeToSolveDDP()

bool sobec::WBC::timeToSolveDDP ( int  iteration)

◆ updateNonThinkingReferences()

void sobec::WBC::updateNonThinkingReferences ( )
protected

◆ updateStepCycleTiming()

void sobec::WBC::updateStepCycleTiming ( )

◆ updateStepTrackerLastReference()

void sobec::WBC::updateStepTrackerLastReference ( )
protected

◆ updateStepTrackerReferences()

void sobec::WBC::updateStepTrackerReferences ( )
protected
Todo:
: the names must be provided by the user

◆ updateSupportTiming()

void sobec::WBC::updateSupportTiming ( )

Member Data Documentation

◆ contacts_after_

std::set<std::string> sobec::WBC::contacts_after_
protected

◆ contacts_before_

std::set<std::string> sobec::WBC::contacts_before_
protected

◆ controlled_joints_id_

std::vector<unsigned long> sobec::WBC::controlled_joints_id_
protected

◆ designer_

RobotDesigner sobec::WBC::designer_
protected

◆ first_switch_to_stand_

bool sobec::WBC::first_switch_to_stand_ = true
protected

◆ horizon_

HorizonManager sobec::WBC::horizon_
protected

◆ horizon_end_

int sobec::WBC::horizon_end_
protected

◆ initialized_

bool sobec::WBC::initialized_ = false
protected

◆ land_LF_

std::vector<int> sobec::WBC::land_LF_
protected

◆ land_LF_cycle_

int sobec::WBC::land_LF_cycle_
protected

◆ land_RF_

std::vector<int> sobec::WBC::land_RF_
protected

◆ land_RF_cycle_

int sobec::WBC::land_RF_cycle_
protected

◆ now_

LocomotionType sobec::WBC::now_ = WALKING
protected

◆ nWalkingCycles_

int sobec::WBC::nWalkingCycles_
protected

◆ ref_base_rotation_

Eigen::Matrix3d sobec::WBC::ref_base_rotation_
protected

◆ ref_com_

eVector3 sobec::WBC::ref_com_
protected

◆ ref_com_vel_

eVector3 sobec::WBC::ref_com_vel_
protected

◆ ref_dcm_

eVector3 sobec::WBC::ref_dcm_
protected

◆ ref_LF_poses_

std::vector<pinocchio::SE3> sobec::WBC::ref_LF_poses_
protected

◆ ref_RF_poses_

std::vector<pinocchio::SE3> sobec::WBC::ref_RF_poses_
protected

◆ settings_

WBCSettings sobec::WBC::settings_
protected

Form to use this class: 1) The function iterate produces the torques to command. 2) All cost references must be updated separtely in the control loop.

◆ standingCycle_

HorizonManager sobec::WBC::standingCycle_
protected

◆ switch_

supportSwitch sobec::WBC::switch_
protected

◆ takeoff_LF_

std::vector<int> sobec::WBC::takeoff_LF_
protected

◆ takeoff_LF_cycle_

int sobec::WBC::takeoff_LF_cycle_
protected

◆ takeoff_RF_

std::vector<int> sobec::WBC::takeoff_RF_
protected

◆ takeoff_RF_cycle_

int sobec::WBC::takeoff_RF_cycle_
protected

◆ time_to_solve_ddp_

bool sobec::WBC::time_to_solve_ddp_ = false
protected

◆ walkingCycle_

HorizonManager sobec::WBC::walkingCycle_
protected

◆ x0_

Eigen::VectorXd sobec::WBC::x0_
protected

◆ x_internal_

Eigen::VectorXd sobec::WBC::x_internal_
protected

◆ yaw_left_

double sobec::WBC::yaw_left_
protected

◆ yaw_right_

double sobec::WBC::yaw_right_
protected

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