dart
|
JacobianDLS refers to the Damped Least Squares Jacobian Pseudoinverse (specifically, Moore-Penrose Pseudoinverse). More...
#include <InverseKinematics.hpp>
Classes | |
struct | Properties |
struct | UniqueProperties |
Public Member Functions | |
JacobianDLS (InverseKinematics *_ik, const Properties &properties=Properties()) | |
Constructor. | |
virtual | ~JacobianDLS ()=default |
Virtual destructor. | |
std::unique_ptr< GradientMethod > | clone (InverseKinematics *_newIK) const override |
Enable this GradientMethod to be cloned to a new IK module. | |
void | computeGradient (const Eigen::Vector6d &_error, Eigen::VectorXd &_grad) override |
Override this function with your implementation of the gradient computation. More... | |
void | setDampingCoefficient (double _damping=DefaultIKDLSCoefficient) |
Set the damping coefficient. More... | |
double | getDampingCoefficient () const |
Get the damping coefficient. | |
Properties | getJacobianDLSProperties () const |
Get the Properties of this JacobianDLS. | |
![]() | |
GradientMethod (InverseKinematics *_ik, const std::string &_methodName, const Properties &_properties) | |
Constructor. | |
virtual | ~GradientMethod ()=default |
Virtual destructor. | |
void | evalGradient (const Eigen::VectorXd &_q, Eigen::Map< Eigen::VectorXd > _grad) |
This function is used to handle caching the gradient vector and interfacing with the solver. More... | |
const std::string & | getMethodName () const |
Get the name of this GradientMethod. | |
void | clampGradient (Eigen::VectorXd &_grad) const |
Clamp the gradient based on the clamp settings of this GradientMethod. | |
void | setComponentWiseClamp (double _clamp=DefaultIKGradientComponentClamp) |
Set the component-wise clamp for this GradientMethod. More... | |
double | getComponentWiseClamp () const |
Get the component-wise clamp for this GradientMethod. | |
void | applyWeights (Eigen::VectorXd &_grad) const |
Apply weights to the gradient based on the weight settings of this GradientMethod. More... | |
void | setComponentWeights (const Eigen::VectorXd &_weights) |
Set the weights that will be applied to each component of the gradient. More... | |
const Eigen::VectorXd & | getComponentWeights () const |
Get the weights of this GradientMethod. | |
void | convertJacobianMethodOutputToGradient (Eigen::VectorXd &grad, const std::vector< std::size_t > &dofs) |
Convert the gradient that gets generated by Jacobian methods into a gradient that can be used by a GradientDescentSolver. More... | |
Properties | getGradientMethodProperties () const |
Get the Properties of this GradientMethod. | |
void | clearCache () |
Clear the cache to force the gradient to be recomputed. More... | |
InverseKinematics * | getIK () |
Returns the IK module that this GradientMethod belongs to. | |
const InverseKinematics * | getIK () const |
Returns the IK module that this GradientMethod belongs to. | |
![]() | |
virtual | ~Subject () |
Destructor will notify all Observers that it is destructing. | |
Protected Attributes | |
UniqueProperties | mDLSProperties |
Properties of this Damped Least Squares method. | |
![]() | |
common::sub_ptr< InverseKinematics > | mIK |
The IK module that this GradientMethod belongs to. | |
std::string | mMethodName |
The name of this method. | |
Eigen::VectorXd | mLastPositions |
The last positions that was passed to this GradientMethod. | |
Eigen::VectorXd | mLastGradient |
The last gradient that was computed by this GradientMethod. | |
Properties | mGradientP |
Properties for this GradientMethod. | |
![]() | |
std::set< Observer * > | mObservers |
List of current Observers. | |
Additional Inherited Members | |
![]() | |
void | sendDestructionNotification () const |
Send a destruction notification to all Observers. More... | |
void | addObserver (Observer *_observer) const |
Add an Observer to the list of Observers. | |
void | removeObserver (Observer *_observer) const |
Remove an Observer from the list of Observers. | |
JacobianDLS refers to the Damped Least Squares Jacobian Pseudoinverse (specifically, Moore-Penrose Pseudoinverse).
This is a very precise method for computing the gradient and is especially suitable for performing IK on industrial manipulators that need to follow very exact workspace paths. However, it is vulnerable to be jittery around singularities (though the damping helps with this), and each cycle might take more time to compute than the JacobianTranspose method (although the JacobianDLS method will usually converge in fewer cycles than JacobianTranspose).
|
overridevirtual |
Override this function with your implementation of the gradient computation.
The direction that this gradient points in should make the error worse if applied to the joint positions, because the Problem is configured as a gradient descent error minimization Problem.
The error vector that is passed in will be determined by the IK module's ErrorMethod. The expectation is that the first three components of the vector 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.
Implements dart::dynamics::InverseKinematics::GradientMethod.
void dart::dynamics::InverseKinematics::JacobianDLS::setDampingCoefficient | ( | double | _damping = DefaultIKDLSCoefficient | ) |
Set the damping coefficient.
A higher damping coefficient will smooth out behavior around singularities but will also result in less precision in general. The default value is appropriate for most use cases.