#include <StepController.h>
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 |
StepController::StepController | ( | int | periodms, |
ocra::Model::Ptr | model | ||
) |
StepController::~StepController | ( | ) | [virtual] |
void StepController::activateFeetContacts | ( | FOOT | foot | ) |
This method asks the ocra-icub-server to activate one by one the feet "corner" contact tasks for the specified foot.
foot | LEFT_FOOT or RIGHT_FOOT. |
void StepController::computeMidPoint | ( | FOOT | foot, |
Eigen::Vector3d | target, | ||
double | stepHeight, | ||
Eigen::Vector3d & | midPoint | ||
) |
void StepController::deactivateFeetContacts | ( | FOOT | foot | ) |
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.
foot | LEFT_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 | ||
) |
Eigen::MatrixXd StepController::getContact2DCoordinates | ( | ) |
Returns the 2D coordinates of the contacts defined at the task level.
double StepController::getFootTrajError | ( | FOOT | foot, |
double & | error | ||
) |
Eigen::Vector3d StepController::getLeftFootPosition | ( | ) |
Retrieves the 3D position of the "l_sole" frame from the iCub model.
Eigen::Vector3d StepController::getRightFootPosition | ( | ) |
Retrieves the 3D position of the "r_sole" frame from the iCub model.
bool StepController::initialize | ( | ) |
bool StepController::isStepFinished | ( | FOOT | foot | ) |
Checks if the step has reached it's target locations and if this is true then re-activates the foot contacts.
foot | LEFT_FOOT or RIGHT_FOOT (whichever is stepping currently) |
bool StepController::isTrajectoryFinished | ( | FOOT | foot | ) |
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.
foot | LEFT_FOOT or RIGHT_FOOT. |
target | x,y,z location of where the foot should land. |
duration | How long the step should take. |
stepHeight | How high the foot should lift. |
void StepController::stop | ( | ) |
Stops the feet trajectory threads. To be called during the release of the owner thread.
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] |