DART
6.7.3
|
ErrorMethod is a base class for different ways of computing the error of an InverseKinematics module. More...
#include <InverseKinematics.hpp>
Classes | |
struct | Properties |
The Properties struct contains settings that are commonly used by methods that compute error for inverse kinematics. More... | |
Public Types | |
typedef std::pair< Eigen::Vector6d, Eigen::Vector6d > | Bounds |
Public Member Functions | |
ErrorMethod (InverseKinematics *_ik, const std::string &_methodName, const Properties &_properties=Properties()) | |
Constructor. More... | |
virtual | ~ErrorMethod ()=default |
Virtual destructor. More... | |
virtual std::unique_ptr< ErrorMethod > | clone (InverseKinematics *_newIK) const =0 |
Enable this ErrorMethod to be cloned to a new IK module. More... | |
virtual Eigen::Vector6d | computeError ()=0 |
Override this function with your implementation of the error vector computation. More... | |
virtual Eigen::Isometry3d | computeDesiredTransform (const Eigen::Isometry3d &_currentTf, const Eigen::Vector6d &_error)=0 |
Override this function with your implementation of computing the desired given the current transform and error vector. More... | |
const Eigen::Vector6d & | evalError (const Eigen::VectorXd &_q) |
This function is used to handle caching the error vector. More... | |
const std::string & | getMethodName () const |
Get the name of this ErrorMethod. More... | |
void | setBounds (const Eigen::Vector6d &_lower=Eigen::Vector6d::Constant(-DefaultIKTolerance), const Eigen::Vector6d &_upper=Eigen::Vector6d::Constant(DefaultIKTolerance)) |
Set all the error bounds. More... | |
void | setBounds (const std::pair< Eigen::Vector6d, Eigen::Vector6d > &_bounds) |
Set all the error bounds. More... | |
const std::pair< Eigen::Vector6d, Eigen::Vector6d > & | getBounds () const |
Get all the error bounds. More... | |
void | setAngularBounds (const Eigen::Vector3d &_lower=Eigen::Vector3d::Constant(-DefaultIKTolerance), const Eigen::Vector3d &_upper=Eigen::Vector3d::Constant(DefaultIKTolerance)) |
Set the error bounds for orientation. More... | |
void | setAngularBounds (const std::pair< Eigen::Vector3d, Eigen::Vector3d > &_bounds) |
Set the error bounds for orientation. More... | |
std::pair< Eigen::Vector3d, Eigen::Vector3d > | getAngularBounds () const |
Get the error bounds for orientation. More... | |
void | setLinearBounds (const Eigen::Vector3d &_lower=Eigen::Vector3d::Constant(-DefaultIKTolerance), const Eigen::Vector3d &_upper=Eigen::Vector3d::Constant(DefaultIKTolerance)) |
Set the error bounds for translation. More... | |
void | setLinearBounds (const std::pair< Eigen::Vector3d, Eigen::Vector3d > &_bounds) |
Set the error bounds for translation. More... | |
std::pair< Eigen::Vector3d, Eigen::Vector3d > | getLinearBounds () const |
Get the error bounds for translation. More... | |
void | setErrorLengthClamp (double _clampSize=DefaultIKErrorClamp) |
Set the clamp that will be applied to the length of the error vector each iteration. More... | |
double | getErrorLengthClamp () const |
Set the clamp that will be applied to the length of the error vector each iteration. More... | |
void | setErrorWeights (const Eigen::Vector6d &_weights) |
Set the weights that will be applied to each component of the error vector. More... | |
const Eigen::Vector6d & | getErrorWeights () const |
Get the weights that will be applied to each component of the error vector. More... | |
void | setAngularErrorWeights (const Eigen::Vector3d &_weights=Eigen::Vector3d::Constant(DefaultIKAngularWeight)) |
Set the weights that will be applied to each angular component of the error vector. More... | |
Eigen::Vector3d | getAngularErrorWeights () const |
Get the weights that will be applied to each angular component of the error vector. More... | |
void | setLinearErrorWeights (const Eigen::Vector3d &_weights=Eigen::Vector3d::Constant(DefaultIKLinearWeight)) |
Set the weights that will be applied to each linear component of the error vector. More... | |
Eigen::Vector3d | getLinearErrorWeights () const |
Get the weights that will be applied to each linear component of the error vector. More... | |
Properties | getErrorMethodProperties () const |
Get the Properties of this ErrorMethod. More... | |
void | clearCache () |
Clear the cache to force the error to be recomputed. More... | |
Protected Member Functions | |
void | sendDestructionNotification () const |
Send a destruction notification to all Observers. More... | |
void | addObserver (Observer *_observer) const |
Add an Observer to the list of Observers. More... | |
void | removeObserver (Observer *_observer) const |
Remove an Observer from the list of Observers. More... | |
Protected Attributes | |
common::sub_ptr< InverseKinematics > | mIK |
Pointer to the IK module of this ErrorMethod. More... | |
std::string | mMethodName |
Name of this error method. More... | |
Eigen::VectorXd | mLastPositions |
The last joint positions passed into this ErrorMethod. More... | |
Eigen::Vector6d | mLastError |
The last error vector computed by this ErrorMethod. More... | |
Properties | mErrorP |
The properties of this ErrorMethod. More... | |
std::set< Observer * > | mObservers |
List of current Observers. More... | |
ErrorMethod is a base class for different ways of computing the error of an InverseKinematics module.
typedef std::pair<Eigen::Vector6d, Eigen::Vector6d> dart::dynamics::InverseKinematics::ErrorMethod::Bounds |
dart::dynamics::InverseKinematics::ErrorMethod::ErrorMethod | ( | InverseKinematics * | _ik, |
const std::string & | _methodName, | ||
const Properties & | _properties = Properties() |
||
) |
Constructor.
|
virtualdefault |
Virtual destructor.
|
protectedinherited |
Add an Observer to the list of Observers.
void dart::dynamics::InverseKinematics::ErrorMethod::clearCache | ( | ) |
Clear the cache to force the error to be recomputed.
It should generally not be necessary to call this function.
|
pure virtual |
Enable this ErrorMethod to be cloned to a new IK module.
Implemented in dart::dynamics::InverseKinematics::TaskSpaceRegion.
|
pure virtual |
Override this function with your implementation of computing the desired given the current transform and error vector.
If you want the desired transform to always be equal to the Target's transform, you can simply call ErrorMethod::computeDesiredTransform to implement this function.
Implemented in dart::dynamics::InverseKinematics::TaskSpaceRegion.
|
pure virtual |
Override this function with your implementation of the error vector computation.
The expectation is that the first three components of the vector will correspond to orientation error (in an angle-axis format) while the last three components correspond to translational error.
When implementing this function, you should assume that the Skeleton's current joint positions corresponds to the positions that you must use to compute the error. This function will only get called when an update is needed.
Implemented in dart::dynamics::InverseKinematics::TaskSpaceRegion.
const Eigen::Vector6d & dart::dynamics::InverseKinematics::ErrorMethod::evalError | ( | const Eigen::VectorXd & | _q | ) |
This function is used to handle caching the error vector.
std::pair< Eigen::Vector3d, Eigen::Vector3d > dart::dynamics::InverseKinematics::ErrorMethod::getAngularBounds | ( | ) | const |
Get the error bounds for orientation.
Eigen::Vector3d dart::dynamics::InverseKinematics::ErrorMethod::getAngularErrorWeights | ( | ) | const |
Get the weights that will be applied to each angular component of the error vector.
const std::pair< Eigen::Vector6d, Eigen::Vector6d > & dart::dynamics::InverseKinematics::ErrorMethod::getBounds | ( | ) | const |
Get all the error bounds.
double dart::dynamics::InverseKinematics::ErrorMethod::getErrorLengthClamp | ( | ) | const |
Set the clamp that will be applied to the length of the error vector each iteration.
InverseKinematics::ErrorMethod::Properties dart::dynamics::InverseKinematics::ErrorMethod::getErrorMethodProperties | ( | ) | const |
Get the Properties of this ErrorMethod.
const Eigen::Vector6d & dart::dynamics::InverseKinematics::ErrorMethod::getErrorWeights | ( | ) | const |
Get the weights that will be applied to each component of the error vector.
std::pair< Eigen::Vector3d, Eigen::Vector3d > dart::dynamics::InverseKinematics::ErrorMethod::getLinearBounds | ( | ) | const |
Get the error bounds for translation.
Eigen::Vector3d dart::dynamics::InverseKinematics::ErrorMethod::getLinearErrorWeights | ( | ) | const |
Get the weights that will be applied to each linear component of the error vector.
const std::string & dart::dynamics::InverseKinematics::ErrorMethod::getMethodName | ( | ) | const |
Get the name of this ErrorMethod.
|
protectedinherited |
Remove an Observer from the list of Observers.
|
protectedinherited |
Send a destruction notification to all Observers.
This will cause all Observers to behave as if this Subject has been permanently deleted, so it should only be called when that behavior is desired.
void dart::dynamics::InverseKinematics::ErrorMethod::setAngularBounds | ( | const Eigen::Vector3d & | _lower = Eigen::Vector3d::Constant(-DefaultIKTolerance) , |
const Eigen::Vector3d & | _upper = Eigen::Vector3d::Constant( DefaultIKTolerance) |
||
) |
Set the error bounds for orientation.
void dart::dynamics::InverseKinematics::ErrorMethod::setAngularBounds | ( | const std::pair< Eigen::Vector3d, Eigen::Vector3d > & | _bounds | ) |
Set the error bounds for orientation.
void dart::dynamics::InverseKinematics::ErrorMethod::setAngularErrorWeights | ( | const Eigen::Vector3d & | _weights = Eigen::Vector3d::Constant(DefaultIKAngularWeight) | ) |
Set the weights that will be applied to each angular component of the error vector.
void dart::dynamics::InverseKinematics::ErrorMethod::setBounds | ( | const Eigen::Vector6d & | _lower = Eigen::Vector6d::Constant(-DefaultIKTolerance) , |
const Eigen::Vector6d & | _upper = Eigen::Vector6d::Constant( DefaultIKTolerance) |
||
) |
Set all the error bounds.
void dart::dynamics::InverseKinematics::ErrorMethod::setBounds | ( | const std::pair< Eigen::Vector6d, Eigen::Vector6d > & | _bounds | ) |
Set all the error bounds.
void dart::dynamics::InverseKinematics::ErrorMethod::setErrorLengthClamp | ( | double | _clampSize = DefaultIKErrorClamp | ) |
Set the clamp that will be applied to the length of the error vector each iteration.
void dart::dynamics::InverseKinematics::ErrorMethod::setErrorWeights | ( | const Eigen::Vector6d & | _weights | ) |
Set the weights that will be applied to each component of the error vector.
void dart::dynamics::InverseKinematics::ErrorMethod::setLinearBounds | ( | const Eigen::Vector3d & | _lower = Eigen::Vector3d::Constant(-DefaultIKTolerance) , |
const Eigen::Vector3d & | _upper = Eigen::Vector3d::Constant( DefaultIKTolerance) |
||
) |
Set the error bounds for translation.
void dart::dynamics::InverseKinematics::ErrorMethod::setLinearBounds | ( | const std::pair< Eigen::Vector3d, Eigen::Vector3d > & | _bounds | ) |
Set the error bounds for translation.
void dart::dynamics::InverseKinematics::ErrorMethod::setLinearErrorWeights | ( | const Eigen::Vector3d & | _weights = Eigen::Vector3d::Constant(DefaultIKLinearWeight) | ) |
Set the weights that will be applied to each linear component of the error vector.
|
protected |
The properties of this ErrorMethod.
|
protected |
Pointer to the IK module of this ErrorMethod.
|
protected |
The last error vector computed by this ErrorMethod.
|
protected |
The last joint positions passed into this ErrorMethod.
|
protected |
Name of this error method.
|
mutableprotectedinherited |
List of current Observers.