robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::SplitDirection Class Reference

Newton direction of the solution to the optimal control problem split into a time stage. More...

#include <split_direction.hpp>

Public Member Functions

 SplitDirection (const Robot &robot)
 Construct a split solution. More...
 
 SplitDirection ()
 Default constructor.
More...
 
 ~SplitDirection ()=default
 Default destructor. More...
 
 SplitDirection (const SplitDirection &)=default
 Default copy constructor. More...
 
SplitDirectionoperator= (const SplitDirection &)=default
 Default copy operator. More...
 
 SplitDirection (SplitDirection &&) noexcept=default
 Default move constructor. More...
 
SplitDirectionoperator= (SplitDirection &&) noexcept=default
 Default move assign operator. More...
 
void setContactDimension (const int dimf)
 Sets contact status, i.e., set dimension of the contact forces. More...
 
void setSwitchingConstraintDimension (const int dims)
 Sets the dimension of the switching constraint. More...
 
Eigen::VectorBlock< Eigen::VectorXd > dq ()
 Newton direction of SplitSolution::q. Size is Robot::dimv(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dq () const
 const version of SplitDirection::dq(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > dv ()
 Newton direction of SplitSolution::gmm. Size is Robot::dimv(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dv () const
 const version of SplitDirection::dv(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > daf ()
 Stack of Newton direction of SplitSolution::a and SplitSolution::f. Size is Robot::dimv() + ContactStatus::dimf(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > daf () const
 const version of SplitDirection::daf(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > da ()
 Newton direction of SplitSolution::a. Size is Robot::dimv(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > da () const
 const version of SplitDirection::da(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > ddvf ()
 Stack of Newton direction of SplitSolution::dv and SplitSolution::f. Size is Robot::dimv() + ContactStatus::dimf(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > ddvf () const
 const version of SplitDirection::ddvf(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > ddv ()
 Newton direction of SplitSolution::dv. Size is Robot::dimv(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > ddv () const
 const version of SplitDirection::ddv(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > df ()
 Newton direction of SplitSolution::f_stack(). Size is ContactStatus::dimf(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > df () const
 const version of SplitDirection::df(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > dlmd ()
 Newton direction of SplitSolution::lmd. Size is Robot::dimv(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dlmd () const
 const version of SplitDirection::dlmd(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > dgmm ()
 Newton direction of SplitSolution::gmm. Size is Robot::dimv(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dgmm () const
 const version of SplitDirection::dgmm(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > dbetamu ()
 Stack of the Newton direction of SplitSolution::beta and SplitSolution::mu_stack(). Size is Robot::dimv() + SplitSolution::dimf(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dbetamu () const
 const version of SplitDirection::dbetamu(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > dbeta ()
 Newton direction of SplitSolution::beta. Size is Robot::dimv(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dbeta () const
 const version of SplitDirection::dbeta(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > dmu ()
 Newton direction of SplitSolution::mu_stack(). Size is SplitSolution::dimf(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dmu () const
 const version of SplitDirection::dmu(). More...
 
Eigen::VectorBlock< Eigen::VectorXd > dxi ()
 Newton direction of SplitSolution::xi_stack(). Size is SplitSolution::dims(). More...
 
const Eigen::VectorBlock< const Eigen::VectorXd > dxi () const
 const version of SplitDirection::dxi(). More...
 
void setZero ()
 Set the all directions zero. More...
 
int dimf () const
 Returns the dimension of the contact. More...
 
int dims () const
 Returns the dimension of the switching constraint. More...
 
bool isDimensionConsistent () const
 Checks dimensional consistency of each component. More...
 
bool isApprox (const SplitDirection &other) const
 Return true if two SplitDirection have the same values and false if not. More...
 
void setRandom ()
 Sets each component vector by random value based on the current contact status. More...
 
void setRandom (const ContactStatus &contact_status)
 Sets each component vector by random value. Contact status is reset. More...
 
void setRandom (const ImpactStatus &impact_status)
 Sets each component vector by random value. Impact status is reset. More...
 
void setRandom (const ContactStatus &contact_status, const ImpactStatus &impact_status)
 Sets each component vector by random value. Contact status and impact status are reset. More...
 
void disp (std::ostream &os) const
 Displays the split direction onto a ostream. More...
 

Static Public Member Functions

static SplitDirection Random (const Robot &robot)
 Generates split direction filled randomly. More...
 
static SplitDirection Random (const Robot &robot, const ContactStatus &contact_status)
 Generates split direction filled randomly. More...
 
static SplitDirection Random (const Robot &robot, const ImpactStatus &impact_status)
 Generates split direction filled randomly. More...
 
static SplitDirection Random (const Robot &robot, const ContactStatus &contact_status, const ImpactStatus &impact_status)
 Generates split direction filled randomly. More...
 

Public Attributes

Eigen::VectorXd dx
 Stack of the Newton directions of SplitSolution::q and SplitSolution::v. Size is 2 * Robot::dimv(). More...
 
Eigen::VectorXd du
 Newton direction of SplitSolution::u. Size is Robot::dimu(). More...
 
Eigen::VectorXd dlmdgmm
 Stack of the Newton direction of SplitSolution::lmd and SplitSolution::gmm. Size is 2 * Robot::dimv(). More...
 
Eigen::VectorXd dnu_passive
 Newton direction of SplitSolution::nu_passive. Size is Robot::dim_passive(). More...
 
double dts
 Newton direction of the switching time. More...
 
double dts_next
 Newton direction of the next switching time. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const SplitDirection &d)
 

Detailed Description

Newton direction of the solution to the optimal control problem split into a time stage.

Constructor & Destructor Documentation

◆ SplitDirection() [1/4]

robotoc::SplitDirection::SplitDirection ( const Robot robot)

Construct a split solution.

Parameters
[in]robotRobot model.

◆ SplitDirection() [2/4]

robotoc::SplitDirection::SplitDirection ( )

Default constructor.

◆ ~SplitDirection()

robotoc::SplitDirection::~SplitDirection ( )
default

Default destructor.

◆ SplitDirection() [3/4]

robotoc::SplitDirection::SplitDirection ( const SplitDirection )
default

Default copy constructor.

◆ SplitDirection() [4/4]

robotoc::SplitDirection::SplitDirection ( SplitDirection &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ da() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::da ( )
inline

Newton direction of SplitSolution::a. Size is Robot::dimv().

Returns
Reference to the Newton direction.

◆ da() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::da ( ) const
inline

const version of SplitDirection::da().

◆ daf() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::daf ( )
inline

Stack of Newton direction of SplitSolution::a and SplitSolution::f. Size is Robot::dimv() + ContactStatus::dimf().

Returns
Reference to the Newton direction.

◆ daf() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::daf ( ) const
inline

const version of SplitDirection::daf().

◆ dbeta() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dbeta ( )
inline

Newton direction of SplitSolution::beta. Size is Robot::dimv().

Returns
Reference to the Newton direction.

◆ dbeta() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dbeta ( ) const
inline

const version of SplitDirection::dbeta().

◆ dbetamu() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dbetamu ( )
inline

Stack of the Newton direction of SplitSolution::beta and SplitSolution::mu_stack(). Size is Robot::dimv() + SplitSolution::dimf().

Returns
Reference to the Newton direction.

◆ dbetamu() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dbetamu ( ) const
inline

const version of SplitDirection::dbetamu().

◆ ddv() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::ddv ( )
inline

Newton direction of SplitSolution::dv. Size is Robot::dimv().

Returns
Reference to the Newton direction.

◆ ddv() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::ddv ( ) const
inline

const version of SplitDirection::ddv().

◆ ddvf() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::ddvf ( )
inline

Stack of Newton direction of SplitSolution::dv and SplitSolution::f. Size is Robot::dimv() + ContactStatus::dimf().

Returns
Reference to the Newton direction.

◆ ddvf() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::ddvf ( ) const
inline

const version of SplitDirection::ddvf().

◆ df() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::df ( )
inline

Newton direction of SplitSolution::f_stack(). Size is ContactStatus::dimf().

Returns
Reference to the Newton direction.

◆ df() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::df ( ) const
inline

const version of SplitDirection::df().

◆ dgmm() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dgmm ( )
inline

Newton direction of SplitSolution::gmm. Size is Robot::dimv().

Returns
Reference to the Newton direction.

◆ dgmm() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dgmm ( ) const
inline

const version of SplitDirection::dgmm().

◆ dimf()

int robotoc::SplitDirection::dimf ( ) const
inline

Returns the dimension of the contact.

Returns
Dimension of the contact.

◆ dims()

int robotoc::SplitDirection::dims ( ) const
inline

Returns the dimension of the switching constraint.

Returns
Dimension of the switching constraint.

◆ disp()

void robotoc::SplitDirection::disp ( std::ostream &  os) const

Displays the split direction onto a ostream.

◆ dlmd() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dlmd ( )
inline

Newton direction of SplitSolution::lmd. Size is Robot::dimv().

Returns
Reference to the Newton direction.

◆ dlmd() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dlmd ( ) const
inline

const version of SplitDirection::dlmd().

◆ dmu() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dmu ( )
inline

Newton direction of SplitSolution::mu_stack(). Size is SplitSolution::dimf().

Returns
Reference to the Newton direction.

◆ dmu() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dmu ( ) const
inline

const version of SplitDirection::dmu().

◆ dq() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dq ( )
inline

Newton direction of SplitSolution::q. Size is Robot::dimv().

Returns
Reference to the Newton direction.

◆ dq() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dq ( ) const
inline

const version of SplitDirection::dq().

◆ dv() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dv ( )
inline

Newton direction of SplitSolution::gmm. Size is Robot::dimv().

Returns
Reference to the Newton direction.

◆ dv() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dv ( ) const
inline

const version of SplitDirection::dv().

◆ dxi() [1/2]

Eigen::VectorBlock< Eigen::VectorXd > robotoc::SplitDirection::dxi ( )
inline

Newton direction of SplitSolution::xi_stack(). Size is SplitSolution::dims().

Returns
Reference to the Newton direction.

◆ dxi() [2/2]

const Eigen::VectorBlock< const Eigen::VectorXd > robotoc::SplitDirection::dxi ( ) const
inline

const version of SplitDirection::dxi().

◆ isApprox()

bool robotoc::SplitDirection::isApprox ( const SplitDirection other) const

Return true if two SplitDirection have the same values and false if not.

Parameters
[in]otherSplit direction that is compared with this object.

◆ isDimensionConsistent()

bool robotoc::SplitDirection::isDimensionConsistent ( ) const

Checks dimensional consistency of each component.

Returns
true if the dimension is consistent. false if not.

◆ operator=() [1/2]

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

Default copy operator.

◆ operator=() [2/2]

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

Default move assign operator.

◆ Random() [1/4]

static SplitDirection robotoc::SplitDirection::Random ( const Robot robot)
static

Generates split direction filled randomly.

Returns
Split direction filled randomly.
Parameters
[in]robotRobot model. Must be initialized by URDF or XML.

◆ Random() [2/4]

static SplitDirection robotoc::SplitDirection::Random ( const Robot robot,
const ContactStatus contact_status 
)
static

Generates split direction filled randomly.

Returns
Split direction filled randomly.
Parameters
[in]robotRobot model. Must be initialized by URDF or XML.
[in]contact_statusContact status.

◆ Random() [3/4]

static SplitDirection robotoc::SplitDirection::Random ( const Robot robot,
const ContactStatus contact_status,
const ImpactStatus impact_status 
)
static

Generates split direction filled randomly.

Returns
Split direction filled randomly.
Parameters
[in]robotRobot model. Must be initialized by URDF or XML.
[in]contact_statusContact status.
[in]impact_statusImpact status.

◆ Random() [4/4]

static SplitDirection robotoc::SplitDirection::Random ( const Robot robot,
const ImpactStatus impact_status 
)
static

Generates split direction filled randomly.

Returns
Split direction filled randomly.
Parameters
[in]robotRobot model. Must be initialized by URDF or XML.
[in]impact_statusImpact status.

◆ setContactDimension()

void robotoc::SplitDirection::setContactDimension ( const int  dimf)
inline

Sets contact status, i.e., set dimension of the contact forces.

Parameters
[in]dimfThe dimension of the contact. Must be non-negative.

◆ setRandom() [1/4]

void robotoc::SplitDirection::setRandom ( )

Sets each component vector by random value based on the current contact status.

◆ setRandom() [2/4]

void robotoc::SplitDirection::setRandom ( const ContactStatus contact_status)

Sets each component vector by random value. Contact status is reset.

Parameters
[in]contact_statusContact status.

◆ setRandom() [3/4]

void robotoc::SplitDirection::setRandom ( const ContactStatus contact_status,
const ImpactStatus impact_status 
)

Sets each component vector by random value. Contact status and impact status are reset.

Parameters
[in]contact_statusContact status.
[in]impact_statusImpact status.

◆ setRandom() [4/4]

void robotoc::SplitDirection::setRandom ( const ImpactStatus impact_status)

Sets each component vector by random value. Impact status is reset.

Parameters
[in]impact_statusImpact status.

◆ setSwitchingConstraintDimension()

void robotoc::SplitDirection::setSwitchingConstraintDimension ( const int  dims)
inline

Sets the dimension of the switching constraint.

Parameters
[in]dimsThe dimension of the switching constraint. Must be non-negative.

◆ setZero()

void robotoc::SplitDirection::setZero ( )
inline

Set the all directions zero.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SplitDirection d 
)
friend

Member Data Documentation

◆ dlmdgmm

Eigen::VectorXd robotoc::SplitDirection::dlmdgmm

Stack of the Newton direction of SplitSolution::lmd and SplitSolution::gmm. Size is 2 * Robot::dimv().

◆ dnu_passive

Eigen::VectorXd robotoc::SplitDirection::dnu_passive

Newton direction of SplitSolution::nu_passive. Size is Robot::dim_passive().

◆ dts

double robotoc::SplitDirection::dts

Newton direction of the switching time.

◆ dts_next

double robotoc::SplitDirection::dts_next

Newton direction of the next switching time.

◆ du

Eigen::VectorXd robotoc::SplitDirection::du

Newton direction of SplitSolution::u. Size is Robot::dimu().

◆ dx

Eigen::VectorXd robotoc::SplitDirection::dx

Stack of the Newton directions of SplitSolution::q and SplitSolution::v. Size is 2 * Robot::dimv().


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