humoto
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
humoto::pepper_ik::Model< t_features > Class Template Reference

Detailed Description

template<int t_features>
class humoto::pepper_ik::Model< t_features >

Model.

Template Parameters
t_featuresthese features identify model

Definition at line 57 of file model.h.

#include <model.h>

Inheritance diagram for humoto::pepper_ik::Model< t_features >:
Inheritance graph

Classes

class  Constraints
 
class  SavedState
 

Public Member Functions

void checkCurrentState () const
 Checks validity of the current state. More...
 
void checkStateTransition (const humoto::pepper_ik::GeneralizedCoordinates< t_features > &generalized_coordinates_from, const double dt, const double error_tol=1e-7) const
 Check validity of translation from one state to another in the given time interval. 'generalized_coordinates_to' is assumed to be model's current state. More...
 
void checkStateTransition (const humoto::pepper_ik::GeneralizedCoordinates< t_features > &generalized_coordinates_from, const humoto::pepper_ik::GeneralizedCoordinates< t_features > &generalized_coordinates_to, const double dt, const double error_tol=1e-7) const
 Check validity of translation from one state to another in the given time interval. More...
 
void correct (const RobotCommand &command, const double time_interval)
 Correct state if the actual sampling interval is different from the expected. More...
 
void correct (const humoto::pepper_ik::GeneralizedCoordinates< t_features > &generalized_coordinates, const RobotCommand &command, const double time_interval)
 Correct state if the actual sampling interval is different from the expected. More...
 
typedef EIGENTOOLS_CONSTANT_SIZE_VECTOR (ModelDescription< t_features >::JOINTS_DOF_NUMBER) JointAnglesVector
 
etools::Vector3 getBaseCoM () const
 Get position of the base CoM. More...
 
void getBaseCoMJacobian (Eigen::MatrixXd &jacobian) const
 Get Jacobian of the base CoM. More...
 
double getBaseMass () const
 Get base mass. More...
 
etools::Matrix3 getBaseOrientation () const
 Get base orientation. More...
 
void getBaseOrientationJacobian (Eigen::MatrixXd &jacobian) const
 Get base orientation Jacobian. More...
 
etools::Vector3 getBasePosition () const
 Get base position. More...
 
double getBaseYaw () const
 Return Yaw angle of base orientation. More...
 
etools::Vector3 getBodyCoM () const
 Get position of the upper body CoM. More...
 
void getBodyCoMJacobian (Eigen::MatrixXd &jacobian) const
 Get Jacobian of the upper body CoM. More...
 
double getBodyMass () const
 Get body mass. More...
 
etools::Vector3 getCoM () const
 Get position of the robot's CoM. More...
 
void getCoMJacobian (Eigen::MatrixXd &jacobian) const
 Get Jacobian of the upper body CoM. More...
 
rbdl::TagLinkPtr getLinkTag (const std::string &id) const
 Get tag. More...
 
double getMass () const
 Get mass of the robot. More...
 
void getRobotCommand (RobotCommand &command, const double dt, const double error_tol=1e-7) const
 Compute robot command. More...
 
const GeneralizedCoordinates< t_features > & getState () const
 Return current model state. More...
 
void getStateError (MotionParameters &motion_param_errors, const MotionParameters &motion_param) const
 Computes errors with respect to the given motion parameters. More...
 
void getTagCompleteJacobian (Eigen::MatrixXd &jacobian, const rbdl::TagLinkPtr tag) const
 Get tag complete Jacobian. More...
 
etools::Matrix3 getTagOrientation (const rbdl::TagLinkPtr tag) const
 Get tag orientation. More...
 
void getTagOrientationJacobian (Eigen::MatrixXd &jacobian, const rbdl::TagLinkPtr tag) const
 Get tag orientation Jacobian. More...
 
etools::Vector3 getTagPosition (const rbdl::TagLinkPtr tag) const
 Get tag position. More...
 
rigidbody::RigidBodyPose getTorsoRootPose ()
 Returns pose of the root of the default robot model (root = torso) More...
 
void loadParameters (const std::string &filename)
 Initialize model based on an URDF file. More...
 
void log (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="model") const
 Log. More...
 
void noop () const
 
void saveCurrentState ()
 Make internal copy of the current state to avoid losing it while iteratively solving IK. More...
 
void updateState (const humoto::ModelState &model_state)
 Update model state. More...
 

Public Attributes

Constraints constraints_
 
humoto::rbdl::Model rbdl_model_
 

Private Member Functions

void initialize ()
 Initialize tags. More...
 

Private Attributes

rbdl::TagPartialCoMPtr base_com_tag_
 
rbdl::TagLinkPtr base_orientation_tag_
 
rbdl::TagLinkPtr base_position_tag_
 
rbdl::TagPartialCoMPtr body_com_tag_
 
humoto::pepper_ik::GeneralizedCoordinates< t_features > generalized_coordinates_
 state of the model More...
 
etools::Matrix3 root_motion_to_wheels_
 
SavedState saved_state_
 

Member Function Documentation

◆ checkCurrentState()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::checkCurrentState ( ) const
inline

Checks validity of the current state.

Definition at line 643 of file model.h.

◆ checkStateTransition() [1/2]

template<int t_features>
void humoto::pepper_ik::Model< t_features >::checkStateTransition ( const humoto::pepper_ik::GeneralizedCoordinates< t_features > &  generalized_coordinates_from,
const double  dt,
const double  error_tol = 1e-7 
) const
inline

Check validity of translation from one state to another in the given time interval. 'generalized_coordinates_to' is assumed to be model's current state.

Parameters
[in]generalized_coordinates_from
[in]dt
[in]error_tol

Definition at line 658 of file model.h.

◆ checkStateTransition() [2/2]

template<int t_features>
void humoto::pepper_ik::Model< t_features >::checkStateTransition ( const humoto::pepper_ik::GeneralizedCoordinates< t_features > &  generalized_coordinates_from,
const humoto::pepper_ik::GeneralizedCoordinates< t_features > &  generalized_coordinates_to,
const double  dt,
const double  error_tol = 1e-7 
) const
inline

Check validity of translation from one state to another in the given time interval.

Parameters
[in]generalized_coordinates_from
[in]generalized_coordinates_to
[in]dt
[in]error_tol

Definition at line 675 of file model.h.

◆ correct() [1/2]

template<int t_features>
void humoto::pepper_ik::Model< t_features >::correct ( const RobotCommand command,
const double  time_interval 
)
inline

Correct state if the actual sampling interval is different from the expected.

Parameters
[in]command
[in]time_interval
Todo:
Implement correction of the base position for the models where the root does not coincide with the base.

Definition at line 569 of file model.h.

◆ correct() [2/2]

template<int t_features>
void humoto::pepper_ik::Model< t_features >::correct ( const humoto::pepper_ik::GeneralizedCoordinates< t_features > &  generalized_coordinates,
const RobotCommand command,
const double  time_interval 
)
inline

Correct state if the actual sampling interval is different from the expected.

Parameters
[in]generalized_coordinates
[in]command
[in]time_interval
Note
This version of correct() function updates the state and then corrects it, in some cases this allows to avoid update of the kinematic model.

Definition at line 624 of file model.h.

◆ EIGENTOOLS_CONSTANT_SIZE_VECTOR()

template<int t_features>
typedef humoto::pepper_ik::Model< t_features >::EIGENTOOLS_CONSTANT_SIZE_VECTOR ( ModelDescription< t_features >::JOINTS_DOF_NUMBER  )

◆ getBaseCoM()

template<int t_features>
etools::Vector3 humoto::pepper_ik::Model< t_features >::getBaseCoM ( ) const
inline

Get position of the base CoM.

Returns
com_position

Definition at line 317 of file model.h.

◆ getBaseCoMJacobian()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getBaseCoMJacobian ( Eigen::MatrixXd &  jacobian) const
inline

Get Jacobian of the base CoM.

Parameters
[out]jacobian

Definition at line 383 of file model.h.

◆ getBaseMass()

template<int t_features>
double humoto::pepper_ik::Model< t_features >::getBaseMass ( ) const
inline

Get base mass.

Returns
mass

Definition at line 328 of file model.h.

◆ getBaseOrientation()

template<int t_features>
etools::Matrix3 humoto::pepper_ik::Model< t_features >::getBaseOrientation ( ) const
inline

Get base orientation.

Returns
rotation matrix

Definition at line 427 of file model.h.

◆ getBaseOrientationJacobian()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getBaseOrientationJacobian ( Eigen::MatrixXd &  jacobian) const
inline

Get base orientation Jacobian.

Parameters
[out]jacobian

Definition at line 416 of file model.h.

◆ getBasePosition()

template<int t_features>
etools::Vector3 humoto::pepper_ik::Model< t_features >::getBasePosition ( ) const
inline

Get base position.

Returns
rotation matrix

Definition at line 514 of file model.h.

◆ getBaseYaw()

template<int t_features>
double humoto::pepper_ik::Model< t_features >::getBaseYaw ( ) const
inline

Return Yaw angle of base orientation.

Returns
Yaw angle

Definition at line 438 of file model.h.

◆ getBodyCoM()

template<int t_features>
etools::Vector3 humoto::pepper_ik::Model< t_features >::getBodyCoM ( ) const
inline

Get position of the upper body CoM.

Returns
com_position

Definition at line 339 of file model.h.

◆ getBodyCoMJacobian()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getBodyCoMJacobian ( Eigen::MatrixXd &  jacobian) const
inline

Get Jacobian of the upper body CoM.

Parameters
[out]jacobian

Definition at line 405 of file model.h.

◆ getBodyMass()

template<int t_features>
double humoto::pepper_ik::Model< t_features >::getBodyMass ( ) const
inline

Get body mass.

Returns
mass

Definition at line 350 of file model.h.

◆ getCoM()

template<int t_features>
etools::Vector3 humoto::pepper_ik::Model< t_features >::getCoM ( ) const
inline

Get position of the robot's CoM.

Returns
com_position

Definition at line 361 of file model.h.

◆ getCoMJacobian()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getCoMJacobian ( Eigen::MatrixXd &  jacobian) const
inline

Get Jacobian of the upper body CoM.

Parameters
[out]jacobian

Definition at line 394 of file model.h.

◆ getLinkTag()

template<int t_features>
rbdl::TagLinkPtr humoto::pepper_ik::Model< t_features >::getLinkTag ( const std::string &  id) const
inline

Get tag.

Parameters
[in]idid (string)
Returns
tag

Definition at line 451 of file model.h.

◆ getMass()

template<int t_features>
double humoto::pepper_ik::Model< t_features >::getMass ( ) const
inline

Get mass of the robot.

Returns
mass of the upper body

Definition at line 372 of file model.h.

◆ getRobotCommand()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getRobotCommand ( RobotCommand command,
const double  dt,
const double  error_tol = 1e-7 
) const
inline

Compute robot command.

Parameters
[out]command
[in]dttime interval between the new and the saved state
[in]error_toltolerance for checking satisfaction of the bounds

Definition at line 527 of file model.h.

◆ getState()

template<int t_features>
const GeneralizedCoordinates<t_features>& humoto::pepper_ik::Model< t_features >::getState ( ) const
inline

Return current model state.

Returns
current state

Definition at line 733 of file model.h.

◆ getStateError()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getStateError ( MotionParameters motion_param_errors,
const MotionParameters motion_param 
) const
inline

Computes errors with respect to the given motion parameters.

Parameters
[out]motion_param_errors
[in]motion_param
Returns
MotionParameters class, where all members represent errors instead of the actual values.

Definition at line 748 of file model.h.

◆ getTagCompleteJacobian()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getTagCompleteJacobian ( Eigen::MatrixXd &  jacobian,
const rbdl::TagLinkPtr  tag 
) const
inline

Get tag complete Jacobian.

Parameters
[out]jacobian
[in]tag

Definition at line 502 of file model.h.

◆ getTagOrientation()

template<int t_features>
etools::Matrix3 humoto::pepper_ik::Model< t_features >::getTagOrientation ( const rbdl::TagLinkPtr  tag) const
inline

Get tag orientation.

Parameters
[in]tag
Returns
rotation matrix

Definition at line 464 of file model.h.

◆ getTagOrientationJacobian()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::getTagOrientationJacobian ( Eigen::MatrixXd &  jacobian,
const rbdl::TagLinkPtr  tag 
) const
inline

Get tag orientation Jacobian.

Parameters
[out]jacobian
[in]tag

Definition at line 489 of file model.h.

◆ getTagPosition()

template<int t_features>
etools::Vector3 humoto::pepper_ik::Model< t_features >::getTagPosition ( const rbdl::TagLinkPtr  tag) const
inline

Get tag position.

Parameters
[in]tag
Returns
position vector

Definition at line 477 of file model.h.

◆ getTorsoRootPose()

template<int t_features>
rigidbody::RigidBodyPose humoto::pepper_ik::Model< t_features >::getTorsoRootPose ( )
inline

Returns pose of the root of the default robot model (root = torso)

Returns
root pose

Definition at line 768 of file model.h.

◆ initialize()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::initialize ( )
inlineprivate

Initialize tags.

Definition at line 96 of file model.h.

◆ loadParameters()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::loadParameters ( const std::string &  filename)
inline

Initialize model based on an URDF file.

Parameters
[in]filename

Definition at line 274 of file model.h.

◆ log()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::log ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "model" 
) const
inlinevirtual

Log.

Parameters
[in,out]loggerlogger
[in]parentparent
[in]namename

Implements humoto::Model.

Definition at line 786 of file model.h.

◆ noop()

void humoto::Model::noop ( ) const
inlineinherited

Definition at line 57 of file model.h.

◆ saveCurrentState()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::saveCurrentState ( )
inline

Make internal copy of the current state to avoid losing it while iteratively solving IK.

Definition at line 303 of file model.h.

◆ updateState()

template<int t_features>
void humoto::pepper_ik::Model< t_features >::updateState ( const humoto::ModelState model_state)
inlinevirtual

Update model state.

Parameters
[in]model_statemodel state.

Implements humoto::Model.

Definition at line 717 of file model.h.

Member Data Documentation

◆ base_com_tag_

template<int t_features>
rbdl::TagPartialCoMPtr humoto::pepper_ik::Model< t_features >::base_com_tag_
private

Definition at line 78 of file model.h.

◆ base_orientation_tag_

template<int t_features>
rbdl::TagLinkPtr humoto::pepper_ik::Model< t_features >::base_orientation_tag_
private

Definition at line 81 of file model.h.

◆ base_position_tag_

template<int t_features>
rbdl::TagLinkPtr humoto::pepper_ik::Model< t_features >::base_position_tag_
private

Definition at line 82 of file model.h.

◆ body_com_tag_

template<int t_features>
rbdl::TagPartialCoMPtr humoto::pepper_ik::Model< t_features >::body_com_tag_
private

Definition at line 79 of file model.h.

◆ constraints_

template<int t_features>
Constraints humoto::pepper_ik::Model< t_features >::constraints_

Definition at line 264 of file model.h.

◆ generalized_coordinates_

template<int t_features>
humoto::pepper_ik::GeneralizedCoordinates<t_features> humoto::pepper_ik::Model< t_features >::generalized_coordinates_
private

state of the model

Definition at line 89 of file model.h.

◆ rbdl_model_

template<int t_features>
humoto::rbdl::Model humoto::pepper_ik::Model< t_features >::rbdl_model_

Definition at line 262 of file model.h.

◆ root_motion_to_wheels_

template<int t_features>
etools::Matrix3 humoto::pepper_ik::Model< t_features >::root_motion_to_wheels_
private

Definition at line 84 of file model.h.

◆ saved_state_

template<int t_features>
SavedState humoto::pepper_ik::Model< t_features >::saved_state_
private

Definition at line 86 of file model.h.


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