All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
PatternGeneratorJRL::PatternGeneratorInterface Class Referenceabstract

This class is the interface between the Pattern Generator and the external world. More...

#include <jrl/walkgen/patterngeneratorinterface.hh>

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW PatternGeneratorInterface (PinocchioRobot *)
 
virtual ~PatternGeneratorInterface ()
 
virtual void AddStepInStack (double dx, double dy, double theta)=0
 Function to specify steps in the stack of the walking pattern generator. This method is different AddOnLineStep which is the default step add when there is no policy, or no step available. More...
 
virtual void CommonInitializationOfWalking (COMState &lStartingCOMState, MAL_S3_VECTOR_TYPE(double)&lStartingZMPPosition, MAL_VECTOR(&, double) BodyAnglesIni, FootAbsolutePosition &InitLeftFootAbsPos, FootAbsolutePosition &InitRightFootAbsPos, std::deque< RelativeFootPosition > &lRelativeFootPositions, std::vector< double > &lCurrentJointValues, bool ClearStepStackHandler)=0
 
virtual void SetCurrentJointValues (MAL_VECTOR(&lCurrentJointValues, double))=0
 
virtual int GetWalkMode () const =0
 Returns the walking mode. More...
 
virtual void GetLegJointVelocity (MAL_VECTOR(&dqr, double), MAL_VECTOR(&dql, double)) const =0
 Get the leg joint velocity. More...
 
virtual void ReadSequenceOfSteps (std::istringstream &strm)=0
 Read a sequence of steps. More...
 
virtual void setZMPInitialPoint (MAL_S3_VECTOR(&, double) lZMPInitialPoint)=0
 Set the initial ZMP reference point. More...
 
virtual void getZMPInitialPoint (MAL_S3_VECTOR(&, double) lZMPInitialPoint) const =0
 Get the initial ZMP reference point. More...
 
virtual void EvaluateStartingState (COMState &lStartingCOMState, MAL_S3_VECTOR_TYPE(double)&lStartingZMPPosition, MAL_VECTOR_TYPE(double)&lStartingWaistPose, FootAbsolutePosition &InitLeftFootAbsPos, FootAbsolutePosition &InitRightFootAbsPos)=0
 Returns the ZMP, CoM, left foot absolute position, and right foot absolute position for the initiale pose. More...
 
virtual void setVelocityReference (double x, double y, double yaw)=0
 Set velocity reference This method is only supported by Herdt's algorithm. Currently only a 3D speed is supported: More...
 
virtual void setCoMPerturbationForce (double x, double y)=0
 Set velocity reference. More...
 
Methods for the control part.
virtual bool RunOneStepOfTheControlLoop (MAL_VECTOR_TYPE(double)&CurrentConfiguration, MAL_VECTOR_TYPE(double)&CurrentVelocity, MAL_VECTOR_TYPE(double)&CurrentAcceleration, MAL_VECTOR_TYPE(double)&ZMPTarget)=0
 Run One Step of the global control loop aka The Main Method To Be Used. More...
 
virtual bool RunOneStepOfTheControlLoop (MAL_VECTOR_TYPE(double)&CurrentConfiguration, MAL_VECTOR_TYPE(double)&CurrentVelocity, MAL_VECTOR_TYPE(double)&CurrentAcceleration, MAL_VECTOR_TYPE(double)&ZMPTarget, COMPosition &COMPosition, FootAbsolutePosition &LeftFootPosition, FootAbsolutePosition &RightFootPosition)=0
 Run One Step of the global control loop aka The Main Method To Be Used. More...
 
virtual bool RunOneStepOfTheControlLoop (MAL_VECTOR_TYPE(double)&CurrentConfiguration, MAL_VECTOR_TYPE(double)&CurrentVelocity, MAL_VECTOR_TYPE(double)&CurrentAcceleration, MAL_VECTOR_TYPE(double)&ZMPTarget, COMState &COMState, FootAbsolutePosition &LeftFootPosition, FootAbsolutePosition &RightFootPosition)=0
 Run One Step of the global control loop aka The Main Method To Be Used. More...
 
virtual bool RunOneStepOfTheControlLoop (FootAbsolutePosition &LeftFootPosition, FootAbsolutePosition &RightFootPosition, ZMPPosition &ZMPRefPos, COMPosition &COMRefPos)=0
 Run One Step of the global control loop aka The Main Method To Be Used. More...
 
On-line steps related methods
virtual void StartOnLineStepSequencing ()=0
 Start the creation of steps on line. More...
 
virtual void StopOnLineStepSequencing ()=0
 Stop the creation of steps on line. More...
 
virtual void AddOnLineStep (double X, double Y, double Theta)=0
 Add an online step. More...
 
virtual int ChangeOnLineStep (double Time, FootAbsolutePosition &aFootAbsolutePosition, double &newtime)=0
 Change online step. The strategy is the following: the step in single support phase at time t has its landing position changed to \( (X,Y,\theta) \) in absolute coordinates (i.e. in the world reference frame of the free flyer of the robot). For stability reason there is no guarantee that this method can realized the operation. Please see the documentation of the walking pattern generator algorithm used. More...
 
virtual void ChangeOnLineStep (std::istringstream &strm, double &newtime)=0
 Change online step. See the above method for the specifications. This method uses a different format with stream of strings. More...
 
For internal odometry.
virtual void UpdateAbsolutePosition (bool UpdateAbsMotionOrNot)=0
 Update the current waist absolute position. More...
 
virtual void getWaistPositionAndOrientation (double TQ[7], double &Orientation) const =0
 Get the waist position and orientation as a quaternion, and the planar X-Y orientation in Orientation. More...
 
virtual void setWaistPositionAndOrientation (double TQ[7])=0
 Set Waist position and Orientation. More...
 
virtual void getWaistVelocity (double &dx, double &dy, double &omega) const =0
 Get Waist velocity. More...
 
virtual void getWaistPositionMatrix (MAL_S4x4_MATRIX(&lWaistAbsPos, double)) const =0
 An other method to get the waist position using a matrix. More...
 
System to call a given method based on registration of a method.
virtual int ParseCmd (std::istringstream &strm)=0
 Parse a command (to be used out of a plugin) and call all objects which registered the method. More...
 

Detailed Description

This class is the interface between the Pattern Generator and the external world.

In addition to the classical setter and getter for various parameters there is the possibility to pass commands a string of stream to the method ParseCmd().

There is a set of functionnalities directly supported by the API:

Constructor & Destructor Documentation

EIGEN_MAKE_ALIGNED_OPERATOR_NEW PatternGeneratorJRL::PatternGeneratorInterface::PatternGeneratorInterface ( PinocchioRobot )
inline
    Constructor 
Parameters
strm,:Should provide the file to initialize the preview control, the path to the VRML model, and the name of the file containing the VRML model.
virtual PatternGeneratorJRL::PatternGeneratorInterface::~PatternGeneratorInterface ( )
inlinevirtual

Destructor

Member Function Documentation

virtual void PatternGeneratorJRL::PatternGeneratorInterface::AddOnLineStep ( double  X,
double  Y,
double  Theta 
)
pure virtual

Add an online step.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::AddStepInStack ( double  dx,
double  dy,
double  theta 
)
pure virtual

Function to specify steps in the stack of the walking pattern generator. This method is different AddOnLineStep which is the default step add when there is no policy, or no step available.

virtual int PatternGeneratorJRL::PatternGeneratorInterface::ChangeOnLineStep ( double  Time,
FootAbsolutePosition aFootAbsolutePosition,
double &  newtime 
)
pure virtual

Change online step. The strategy is the following: the step in single support phase at time t has its landing position changed to \( (X,Y,\theta) \) in absolute coordinates (i.e. in the world reference frame of the free flyer of the robot). For stability reason there is no guarantee that this method can realized the operation. Please see the documentation of the walking pattern generator algorithm used.

If the time falls during a double support phase, the next single support phase is chosen.

Parameters
[in]Time,:Time information of the step.
[in]aFootAbsolutePosition,:Absolute position of the foot.
Returns
If the operation failed the method returns a negative number related to an error, 0 otherwise.
virtual void PatternGeneratorJRL::PatternGeneratorInterface::ChangeOnLineStep ( std::istringstream &  strm,
double &  newtime 
)
pure virtual

Change online step. See the above method for the specifications. This method uses a different format with stream of strings.

Parameters
[in]Time,:Time information of the step.
Returns
nothing
virtual void PatternGeneratorJRL::PatternGeneratorInterface::CommonInitializationOfWalking ( COMState lStartingCOMState,
MAL_S3_VECTOR_TYPE(double)&  lStartingZMPPosition,
MAL_VECTOR(&, double)  BodyAnglesIni,
FootAbsolutePosition InitLeftFootAbsPos,
FootAbsolutePosition InitRightFootAbsPos,
std::deque< RelativeFootPosition > &  lRelativeFootPositions,
std::vector< double > &  lCurrentJointValues,
bool  ClearStepStackHandler 
)
pure virtual
    Common Initialization of walking. 
Parameters
[out]lStartingCOMPosition,:For the starting position on the articular space, returns the COM position.
[out]lStartingZMPPosition,:For the starting position on the articular space, returns the ZMP position.
[out]BodyAnglesIni,:Basically it is a copy of CurrentJointValues but as a vector.
[out]InitLeftFootAbsPos,:Returns the current absolute position of the left foot for the given posture of the robot.
[out]InitRightFootAbsPos,:Returns the current absolute position of the right foot for the given posture of the robot.
[out]lRelativeFootPositions,:List of relative positions for the support foot still in the stack of steps.
[in]lCurrentJointValues,:The vector of articular values in classical C++ style.
[in]ClearStepStackHandler,:Clean the stack of steps after copy.
virtual void PatternGeneratorJRL::PatternGeneratorInterface::EvaluateStartingState ( COMState lStartingCOMState,
MAL_S3_VECTOR_TYPE(double)&  lStartingZMPPosition,
MAL_VECTOR_TYPE(double)&  lStartingWaistPose,
FootAbsolutePosition InitLeftFootAbsPos,
FootAbsolutePosition InitRightFootAbsPos 
)
pure virtual

Returns the ZMP, CoM, left foot absolute position, and right foot absolute position for the initiale pose.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::GetLegJointVelocity ( MAL_VECTOR &,  double,
MAL_VECTOR &,  double 
) const
pure virtual

Get the leg joint velocity.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::getWaistPositionAndOrientation ( double  TQ[7],
double &  Orientation 
) const
pure virtual

Get the waist position and orientation as a quaternion, and the planar X-Y orientation in Orientation.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::getWaistPositionMatrix ( MAL_S4x4_MATRIX &,  double) const
pure virtual

An other method to get the waist position using a matrix.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::getWaistVelocity ( double &  dx,
double &  dy,
double &  omega 
) const
pure virtual

Get Waist velocity.

virtual int PatternGeneratorJRL::PatternGeneratorInterface::GetWalkMode ( ) const
pure virtual

Returns the walking mode.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::getZMPInitialPoint ( MAL_S3_VECTOR(&, double)  lZMPInitialPoint) const
pure virtual

Get the initial ZMP reference point.

virtual int PatternGeneratorJRL::PatternGeneratorInterface::ParseCmd ( std::istringstream &  strm)
pure virtual

Parse a command (to be used out of a plugin) and call all objects which registered the method.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::ReadSequenceOfSteps ( std::istringstream &  strm)
pure virtual

Read a sequence of steps.

virtual bool PatternGeneratorJRL::PatternGeneratorInterface::RunOneStepOfTheControlLoop ( MAL_VECTOR_TYPE(double)&  CurrentConfiguration,
MAL_VECTOR_TYPE(double)&  CurrentVelocity,
MAL_VECTOR_TYPE(double)&  CurrentAcceleration,
MAL_VECTOR_TYPE(double)&  ZMPTarget 
)
pure virtual

Run One Step of the global control loop aka The Main Method To Be Used.

Parameters
[out]CurrentConfigurationThe current configuration of the robot according to the implementation of dynamic-JRLJapan. This should be first position and orientation of the waist, and then all the DOFs of your robot.
[out]CurrentVelocityThe current velocity of the robot according to the the implementation of dynamic-JRLJapan.
[out]CurrentAccelerationThe current acceleration of the robot according to the the implementation of dynamic-JRLJapan.
[out]ZMPTargetThe target ZMP in the waist reference frame.
Returns
True is there is still some data to send, false otherwise.
virtual bool PatternGeneratorJRL::PatternGeneratorInterface::RunOneStepOfTheControlLoop ( MAL_VECTOR_TYPE(double)&  CurrentConfiguration,
MAL_VECTOR_TYPE(double)&  CurrentVelocity,
MAL_VECTOR_TYPE(double)&  CurrentAcceleration,
MAL_VECTOR_TYPE(double)&  ZMPTarget,
COMPosition COMPosition,
FootAbsolutePosition LeftFootPosition,
FootAbsolutePosition RightFootPosition 
)
pure virtual

Run One Step of the global control loop aka The Main Method To Be Used.

Parameters
[out]CurrentConfigurationThe current configuration of the robot according to the implementation of dynamic-JRLJapan. This should be first position and orientation of the waist, and then all the DOFs of your robot.
[out]CurrentVelocityThe current velocity of the robot according to the the implementation of dynamic-JRLJapan.
[out]CurrentAccelerationThe current acceleration of the robot according to the the implementation of dynamic-JRLJapan.
[out]ZMPTargetThe target ZMP in the waist reference frame.
[out]COMPositionThe CoM position for this motion.
[out]LeftFootPosition,:Absolute position of the left foot.
[out]RightFootPosition,:Absolute position of the right foot.
Returns
True is there is still some data to send, false otherwise.
virtual bool PatternGeneratorJRL::PatternGeneratorInterface::RunOneStepOfTheControlLoop ( MAL_VECTOR_TYPE(double)&  CurrentConfiguration,
MAL_VECTOR_TYPE(double)&  CurrentVelocity,
MAL_VECTOR_TYPE(double)&  CurrentAcceleration,
MAL_VECTOR_TYPE(double)&  ZMPTarget,
COMState COMState,
FootAbsolutePosition LeftFootPosition,
FootAbsolutePosition RightFootPosition 
)
pure virtual

Run One Step of the global control loop aka The Main Method To Be Used.

Parameters
[out]CurrentConfigurationThe current configuration of the robot according to the implementation of dynamic-JRLJapan. This should be first position and orientation of the waist, and then all the DOFs of your robot.
[out]CurrentVelocityThe current velocity of the robot according to the the implementation of dynamic-JRLJapan.
[out]CurrentAccelerationThe current acceleration of the robot according to the the implementation of dynamic-JRLJapan.
[out]ZMPTargetThe target ZMP in the waist reference frame.
[out]COMStateThe CoM state (up to the acceleration) for this motion.
[out]LeftFootPosition,:Absolute position of the left foot.
[out]RightFootPosition,:Absolute position of the right foot.
Returns
True is there is still some data to send, false otherwise.
virtual bool PatternGeneratorJRL::PatternGeneratorInterface::RunOneStepOfTheControlLoop ( FootAbsolutePosition LeftFootPosition,
FootAbsolutePosition RightFootPosition,
ZMPPosition ZMPRefPos,
COMPosition COMRefPos 
)
pure virtual

Run One Step of the global control loop aka The Main Method To Be Used.

Parameters
[out]LeftFootPosition,:Absolute position of the left foot.
[out]RightFootPosition,:Absolute position of the right foot.
[out]ZMPRefPos,:ZMP position new reference
[out]COMRefPos,:COM position new reference.
Returns
True is there is still some data to send, false otherwise.
virtual void PatternGeneratorJRL::PatternGeneratorInterface::setCoMPerturbationForce ( double  x,
double  y 
)
pure virtual

Set velocity reference.

Parameters
x,:Additive acceleration along the saggital plane.
y,:Additive acceleration along the lateral plane.
virtual void PatternGeneratorJRL::PatternGeneratorInterface::SetCurrentJointValues ( MAL_VECTOR &,  double)
pure virtual
    Set the current joint values of the robot.

This method is used to properly initialize the pattern generator. It also updates the state of the robot if other control mechanisms modifies the upper body part and if this should be taken into account into the pattern generator in the second loop of control.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::setVelocityReference ( double  x,
double  y,
double  yaw 
)
pure virtual

Set velocity reference This method is only supported by Herdt's algorithm. Currently only a 3D speed is supported:

Parameters
x,:Velocity along the saggital plane.
y,:Velocity along the perpendicular plane.
yaw,:Angular velocity in the x-y plane.
virtual void PatternGeneratorJRL::PatternGeneratorInterface::setWaistPositionAndOrientation ( double  TQ[7])
pure virtual

Set Waist position and Orientation.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::setZMPInitialPoint ( MAL_S3_VECTOR(&, double)  lZMPInitialPoint)
pure virtual

Set the initial ZMP reference point.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::StartOnLineStepSequencing ( )
pure virtual

Start the creation of steps on line.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::StopOnLineStepSequencing ( )
pure virtual

Stop the creation of steps on line.

virtual void PatternGeneratorJRL::PatternGeneratorInterface::UpdateAbsolutePosition ( bool  UpdateAbsMotionOrNot)
pure virtual

Update the current waist absolute position.