ocra-wbi-plugins
Doxygen documentation for the ocra-wbi-plugins repository
StepController Class Reference

#include <StepController.h>

List of all members.

Public Member Functions

 StepController (int periodms, ocra::Model::Ptr model)
virtual ~StepController ()
bool initialize ()
void deactivateFeetContacts (FOOT foot)
void activateFeetContacts (FOOT foot)
bool doStepWithMaxVelocity (FOOT foot, Eigen::Vector3d target, double stepHeight)
void step (FOOT foot, Eigen::Vector3d target, double stepDuration, double stepHeight)
bool isStepFinished (FOOT foot)
double getFootTrajError (FOOT foot, double &error)
Eigen::Vector3d getLeftFootPosition ()
Eigen::Vector3d getRightFootPosition ()
void computeMidPoint (FOOT foot, Eigen::Vector3d target, double stepHeight, Eigen::Vector3d &midPoint)
void doComputeMidPoint (Eigen::Vector3d currentFootPosition, Eigen::Vector3d target, double stepHeight, Eigen::Vector3d &midPoint)
bool isTrajectoryFinished (FOOT foot)
void stop ()
Eigen::MatrixXd getContact2DCoordinates ()

Private Attributes

std::vector
< ocra_recipes::TaskConnection::Ptr > 
_contactsCollection
ocra_recipes::TaskConnection::Ptr _LeftFootContact_BackLeft
ocra_recipes::TaskConnection::Ptr _LeftFootContact_FrontLeft
ocra_recipes::TaskConnection::Ptr _LeftFootContact_BackRight
ocra_recipes::TaskConnection::Ptr _LeftFootContact_FrontRight
ocra_recipes::TaskConnection::Ptr _RightFootContact_BackLeft
ocra_recipes::TaskConnection::Ptr _RightFootContact_FrontLeft
ocra_recipes::TaskConnection::Ptr _RightFootContact_BackRight
ocra_recipes::TaskConnection::Ptr _RightFootContact_FrontRight
std::shared_ptr
< ocra_recipes::TrajectoryThread > 
_leftFoot_TrajThread
std::shared_ptr
< ocra_recipes::TrajectoryThread > 
_rightFoot_TrajThread
Eigen::Vector3d target
Eigen::Vector3d _leftFootPosition
Eigen::Vector3d _rightFootPosition
ocra::Model::Ptr _model
int _period

Detailed Description

Note:
Author:
Jorhabib Eljaik
Warning:
Work in progress! This is still a barebone class in the process of being tested.

Constructor & Destructor Documentation

StepController::StepController ( int  periodms,
ocra::Model::Ptr  model 
)

Member Function Documentation

This method asks the ocra-icub-server to activate one by one the feet "corner" contact tasks for the specified foot.

Parameters:
footLEFT_FOOT or RIGHT_FOOT.
void StepController::computeMidPoint ( FOOT  foot,
Eigen::Vector3d  target,
double  stepHeight,
Eigen::Vector3d &  midPoint 
)

Remember the right and left feet contact tasks? created in initialize(). This method asks the ocra-icub-server to deactivate one by one the feet "corner" contact tasks for the specified foot.

Parameters:
footLEFT_FOOT or RIGHT_FOOT.
void StepController::doComputeMidPoint ( Eigen::Vector3d  currentFootPosition,
Eigen::Vector3d  target,
double  stepHeight,
Eigen::Vector3d &  midPoint 
)
bool StepController::doStepWithMaxVelocity ( FOOT  foot,
Eigen::Vector3d  target,
double  stepHeight 
)

Returns the 2D coordinates of the contacts defined at the task level.

Returns:
Matrix of 2D coordinates of the contact points defined at task level.
double StepController::getFootTrajError ( FOOT  foot,
double &  error 
)

Retrieves the 3D position of the "l_sole" frame from the iCub model.

Returns:
3D position of the left foot.

Retrieves the 3D position of the "r_sole" frame from the iCub model.

Returns:
3D position of the right foot.
Todo:
This max velocity must be compatible with the one specified in the linar constraints

Checks if the step has reached it's target locations and if this is true then re-activates the foot contacts.

Parameters:
footLEFT_FOOT or RIGHT_FOOT (whichever is stepping currently)
void StepController::step ( FOOT  foot,
Eigen::Vector3d  target,
double  stepDuration,
double  stepHeight 
)

Make a step with foot with a specific duration with a specific height.

Parameters:
footLEFT_FOOT or RIGHT_FOOT.
targetx,y,z location of where the foot should land.
durationHow long the step should take.
stepHeightHow high the foot should lift.

Stops the feet trajectory threads. To be called during the release of the owner thread.


Member Data Documentation

std::vector<ocra_recipes::TaskConnection::Ptr> StepController::_contactsCollection [private]
std::shared_ptr<ocra_recipes::TrajectoryThread> StepController::_leftFoot_TrajThread [private]
ocra_recipes::TaskConnection::Ptr StepController::_LeftFootContact_BackLeft [private]
ocra_recipes::TaskConnection::Ptr StepController::_LeftFootContact_BackRight [private]
ocra_recipes::TaskConnection::Ptr StepController::_LeftFootContact_FrontLeft [private]
ocra_recipes::TaskConnection::Ptr StepController::_LeftFootContact_FrontRight [private]
Eigen::Vector3d StepController::_leftFootPosition [private]
ocra::Model::Ptr StepController::_model [private]
int StepController::_period [private]
std::shared_ptr<ocra_recipes::TrajectoryThread> StepController::_rightFoot_TrajThread [private]
ocra_recipes::TaskConnection::Ptr StepController::_RightFootContact_BackLeft [private]
ocra_recipes::TaskConnection::Ptr StepController::_RightFootContact_BackRight [private]
ocra_recipes::TaskConnection::Ptr StepController::_RightFootContact_FrontLeft [private]
ocra_recipes::TaskConnection::Ptr StepController::_RightFootContact_FrontRight [private]
Eigen::Vector3d StepController::_rightFootPosition [private]
Eigen::Vector3d StepController::target [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines