DART
6.10.1
|
#include <BoxedLcpConstraintSolver.hpp>
Public Member Functions | |
BoxedLcpConstraintSolver (double timeStep, BoxedLcpSolverPtr boxedLcpSolver=nullptr, BoxedLcpSolverPtr secondaryBoxedLcpSolver=nullptr) | |
Constructor. More... | |
BoxedLcpConstraintSolver () | |
Constructos with default primary and secondary LCP solvers, which are Dantzig and PGS, respectively. More... | |
BoxedLcpConstraintSolver (BoxedLcpSolverPtr boxedLcpSolver) | |
Constructors with specific primary LCP solver. More... | |
BoxedLcpConstraintSolver (BoxedLcpSolverPtr boxedLcpSolver, BoxedLcpSolverPtr secondaryBoxedLcpSolver) | |
Constructs with specific primary and secondary LCP solvers. More... | |
void | setBoxedLcpSolver (BoxedLcpSolverPtr lcpSolver) |
Sets boxed LCP (BLCP) solver. More... | |
ConstBoxedLcpSolverPtr | getBoxedLcpSolver () const |
Returns boxed LCP (BLCP) solver. More... | |
void | setSecondaryBoxedLcpSolver (BoxedLcpSolverPtr lcpSolver) |
Sets boxed LCP (BLCP) solver that is used when the primary solver failed. More... | |
ConstBoxedLcpSolverPtr | getSecondaryBoxedLcpSolver () const |
Returns boxed LCP (BLCP) solver that is used when the primary solver failed. More... | |
void | addSkeleton (const dynamics::SkeletonPtr &skeleton) |
Add single skeleton. More... | |
void | addSkeletons (const std::vector< dynamics::SkeletonPtr > &skeletons) |
Add mutiple skeletons. More... | |
const std::vector< dynamics::SkeletonPtr > & | getSkeletons () const |
Returns all the skeletons added to this ConstraintSolver. More... | |
void | removeSkeleton (const dynamics::SkeletonPtr &skeleton) |
Remove single skeleton. More... | |
void | removeSkeletons (const std::vector< dynamics::SkeletonPtr > &skeletons) |
Remove multiple skeletons. More... | |
void | removeAllSkeletons () |
Remove all skeletons in this constraint solver. More... | |
void | addConstraint (const ConstraintBasePtr &constraint) |
Add a constraint. More... | |
void | removeConstraint (const ConstraintBasePtr &constraint) |
Remove a constraint. More... | |
void | removeAllConstraints () |
Remove all constraints. More... | |
std::size_t | getNumConstraints () const |
Returns the number of constraints that was manually added to this ConstraintSolver. More... | |
constraint::ConstraintBasePtr | getConstraint (std::size_t index) |
Returns a constraint by index. More... | |
constraint::ConstConstraintBasePtr | getConstraint (std::size_t index) const |
Returns a constraint by index. More... | |
std::vector< constraint::ConstraintBasePtr > | getConstraints () |
Returns all the constraints added to this ConstraintSolver. More... | |
std::vector< constraint::ConstConstraintBasePtr > | getConstraints () const |
Returns all the constraints added to this ConstraintSolver. More... | |
void | clearLastCollisionResult () |
Clears the last collision result. More... | |
virtual void | setTimeStep (double _timeStep) |
Set time step. More... | |
double | getTimeStep () const |
Get time step. More... | |
void | setCollisionDetector (collision::CollisionDetector *collisionDetector) |
Set collision detector. More... | |
void | setCollisionDetector (const std::shared_ptr< collision::CollisionDetector > &collisionDetector) |
Set collision detector. More... | |
collision::CollisionDetectorPtr | getCollisionDetector () |
Get collision detector. More... | |
collision::ConstCollisionDetectorPtr | getCollisionDetector () const |
Get (const) collision detector. More... | |
collision::CollisionGroupPtr | getCollisionGroup () |
Return collision group of collision objects that are added to this ConstraintSolver. More... | |
collision::ConstCollisionGroupPtr | getCollisionGroup () const |
Return (const) collision group of collision objects that are added to this ConstraintSolver. More... | |
collision::CollisionOption & | getCollisionOption () |
Returns collision option that is used for collision checkings in this ConstraintSolver to generate contact constraints. More... | |
const collision::CollisionOption & | getCollisionOption () const |
Returns collision option that is used for collision checkings in this ConstraintSolver to generate contact constraints. More... | |
collision::CollisionResult & | getLastCollisionResult () |
Return the last collision checking result. More... | |
const collision::CollisionResult & | getLastCollisionResult () const |
Return the last collision checking result. More... | |
void | setLCPSolver (std::unique_ptr< LCPSolver > lcpSolver) |
Set LCP solver. More... | |
LCPSolver * | getLCPSolver () const |
Get LCP solver. More... | |
void | solve () |
Solve constraint impulses and apply them to the skeletons. More... | |
virtual void | setFromOtherConstraintSolver (const ConstraintSolver &other) |
Sets this constraint solver using other constraint solver. More... | |
Protected Types | |
using | CollisionDetector = collision::CollisionDetector |
Protected Member Functions | |
void | solveConstrainedGroup (ConstrainedGroup &group) override |
bool | containSkeleton (const dynamics::ConstSkeletonPtr &skeleton) const |
Check if the skeleton is contained in this solver. More... | |
bool | checkAndAddSkeleton (const dynamics::SkeletonPtr &skeleton) |
Add skeleton if the constraint is not contained in this solver. More... | |
bool | containConstraint (const ConstConstraintBasePtr &constraint) const |
Check if the constraint is contained in this solver. More... | |
bool | checkAndAddConstraint (const ConstraintBasePtr &constraint) |
Add constraint if the constraint is not contained in this solver. More... | |
void | updateConstraints () |
Update constraints. More... | |
void | buildConstrainedGroups () |
Build constrained groupsContact. More... | |
void | solveConstrainedGroups () |
Solve constrained groups. More... | |
bool | isSoftContact (const collision::Contact &contact) const |
Return true if at least one of colliding body is soft body. More... | |
Protected Attributes | |
BoxedLcpSolverPtr | mBoxedLcpSolver |
Boxed LCP solver. More... | |
BoxedLcpSolverPtr | mSecondaryBoxedLcpSolver |
Boxed LCP solver to be used when the primary solver failed. More... | |
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | mA |
Cache data for boxed LCP formulation. More... | |
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | mABackup |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mX |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mXBackup |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mB |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mBBackup |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mW |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mLo |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mLoBackup |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mHi |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXd | mHiBackup |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXi | mFIndex |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXi | mFIndexBackup |
Cache data for boxed LCP formulation. More... | |
Eigen::VectorXi | mOffset |
Cache data for boxed LCP formulation. More... | |
collision::CollisionDetectorPtr | mCollisionDetector |
Collision detector. More... | |
collision::CollisionGroupPtr | mCollisionGroup |
Collision group. More... | |
collision::CollisionOption | mCollisionOption |
Collision detection option. More... | |
collision::CollisionResult | mCollisionResult |
Last collision checking result. More... | |
double | mTimeStep |
Time step. More... | |
std::vector< dynamics::SkeletonPtr > | mSkeletons |
Skeleton list. More... | |
std::vector< ContactConstraintPtr > | mContactConstraints |
Contact constraints those are automatically created. More... | |
std::vector< SoftContactConstraintPtr > | mSoftContactConstraints |
Soft contact constraints those are automatically created. More... | |
std::vector< JointLimitConstraintPtr > | mJointLimitConstraints |
Joint limit constraints those are automatically created. More... | |
std::vector< ServoMotorConstraintPtr > | mServoMotorConstraints |
Servo motor constraints those are automatically created. More... | |
std::vector< MimicMotorConstraintPtr > | mMimicMotorConstraints |
Mimic motor constraints those are automatically created. More... | |
std::vector< JointCoulombFrictionConstraintPtr > | mJointCoulombFrictionConstraints |
Joint Coulomb friction constraints those are automatically created. More... | |
std::vector< ConstraintBasePtr > | mManualConstraints |
Constraints that manually added. More... | |
std::vector< ConstraintBasePtr > | mActiveConstraints |
Active constraints. More... | |
std::vector< ConstrainedGroup > | mConstrainedGroups |
Constraint group list. More... | |
Private Member Functions | |
bool | isSymmetric (std::size_t n, double *A) |
Return true if the matrix is symmetric. More... | |
bool | isSymmetric (std::size_t n, double *A, std::size_t begin, std::size_t end) |
Return true if the diagonla block of matrix is symmetric. More... | |
void | print (std::size_t n, double *A, double *x, double *lo, double *hi, double *b, double *w, int *findex) |
Print debug information. More... | |
|
protectedinherited |
dart::constraint::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver | ( | double | timeStep, |
BoxedLcpSolverPtr | boxedLcpSolver = nullptr , |
||
BoxedLcpSolverPtr | secondaryBoxedLcpSolver = nullptr |
||
) |
Constructor.
[in] | timeStep | Simulation time step |
[in] | boxedLcpSolver | The primary boxed LCP solver. When nullptr is passed, Dantzig solver will be used. |
[in] | secondaryBoxedLcpSolver | The secondary boxed-LCP solver. When nullptr is passed, PGS solver will be used. This is to make the default solver setting to be Dantzig + PGS. In order to disable use of secondary solver, call setSecondaryBoxedLcpSolver(nullptr) explicitly. |
dart::constraint::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver | ( | ) |
Constructos with default primary and secondary LCP solvers, which are Dantzig and PGS, respectively.
dart::constraint::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver | ( | BoxedLcpSolverPtr | boxedLcpSolver | ) |
Constructors with specific primary LCP solver.
[in] | boxedLcpSolver | The primary boxed LCP solver. When nullptr is passed, which is discouraged, Dantzig solver will be used. |
dart::constraint::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver | ( | BoxedLcpSolverPtr | boxedLcpSolver, |
BoxedLcpSolverPtr | secondaryBoxedLcpSolver | ||
) |
Constructs with specific primary and secondary LCP solvers.
[in] | boxedLcpSolver | The primary boxed LCP solver. When nullptr is passed, which is discouraged, Dantzig solver will be used. |
[in] | secondaryBoxedLcpSolver | The secondary boxed-LCP solver. Pass nullptr to disable using secondary LCP solver. |
|
inherited |
Add a constraint.
|
inherited |
Add single skeleton.
|
inherited |
Add mutiple skeletons.
|
protectedinherited |
Build constrained groupsContact.
|
protectedinherited |
Add constraint if the constraint is not contained in this solver.
|
protectedinherited |
Add skeleton if the constraint is not contained in this solver.
|
inherited |
Clears the last collision result.
|
protectedinherited |
Check if the constraint is contained in this solver.
|
protectedinherited |
Check if the skeleton is contained in this solver.
ConstBoxedLcpSolverPtr dart::constraint::BoxedLcpConstraintSolver::getBoxedLcpSolver | ( | ) | const |
Returns boxed LCP (BLCP) solver.
|
inherited |
Get collision detector.
|
inherited |
Get (const) collision detector.
|
inherited |
Return collision group of collision objects that are added to this ConstraintSolver.
|
inherited |
Return (const) collision group of collision objects that are added to this ConstraintSolver.
|
inherited |
Returns collision option that is used for collision checkings in this ConstraintSolver to generate contact constraints.
|
inherited |
Returns collision option that is used for collision checkings in this ConstraintSolver to generate contact constraints.
|
inherited |
Returns a constraint by index.
|
inherited |
Returns a constraint by index.
|
inherited |
Returns all the constraints added to this ConstraintSolver.
|
inherited |
Returns all the constraints added to this ConstraintSolver.
|
inherited |
Return the last collision checking result.
|
inherited |
Return the last collision checking result.
|
inherited |
Get LCP solver.
|
inherited |
Returns the number of constraints that was manually added to this ConstraintSolver.
ConstBoxedLcpSolverPtr dart::constraint::BoxedLcpConstraintSolver::getSecondaryBoxedLcpSolver | ( | ) | const |
Returns boxed LCP (BLCP) solver that is used when the primary solver failed.
|
inherited |
Returns all the skeletons added to this ConstraintSolver.
|
inherited |
Get time step.
|
protectedinherited |
Return true if at least one of colliding body is soft body.
|
private |
Return true if the matrix is symmetric.
|
private |
Return true if the diagonla block of matrix is symmetric.
|
private |
Print debug information.
|
inherited |
Remove all constraints.
|
inherited |
Remove all skeletons in this constraint solver.
|
inherited |
Remove a constraint.
|
inherited |
Remove single skeleton.
|
inherited |
Remove multiple skeletons.
void dart::constraint::BoxedLcpConstraintSolver::setBoxedLcpSolver | ( | BoxedLcpSolverPtr | lcpSolver | ) |
Sets boxed LCP (BLCP) solver.
[in] | lcpSolver | The primary boxed LCP solver. When nullptr is passed, Dantzig solver will be used. |
|
inherited |
Set collision detector.
This function acquires ownership of the CollisionDetector passed as an argument. This method is deprecated in favor of the overload that accepts a std::shared_ptr.
|
inherited |
Set collision detector.
|
virtualinherited |
Sets this constraint solver using other constraint solver.
All the properties and registered skeletons and constraints will be copied over.
|
inherited |
Set LCP solver.
void dart::constraint::BoxedLcpConstraintSolver::setSecondaryBoxedLcpSolver | ( | BoxedLcpSolverPtr | lcpSolver | ) |
Sets boxed LCP (BLCP) solver that is used when the primary solver failed.
|
virtualinherited |
Set time step.
|
inherited |
Solve constraint impulses and apply them to the skeletons.
|
overrideprotectedvirtual |
Implements dart::constraint::ConstraintSolver.
|
protectedinherited |
Solve constrained groups.
|
protectedinherited |
Update constraints.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.
|
protectedinherited |
Active constraints.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Boxed LCP solver.
|
protectedinherited |
Collision detector.
|
protectedinherited |
Collision group.
|
protectedinherited |
Collision detection option.
|
protectedinherited |
Last collision checking result.
|
protectedinherited |
Constraint group list.
|
protectedinherited |
Contact constraints those are automatically created.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.
|
protectedinherited |
Joint Coulomb friction constraints those are automatically created.
|
protectedinherited |
Joint limit constraints those are automatically created.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.
|
protectedinherited |
Constraints that manually added.
|
protectedinherited |
Mimic motor constraints those are automatically created.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Boxed LCP solver to be used when the primary solver failed.
|
protectedinherited |
Servo motor constraints those are automatically created.
|
protectedinherited |
Skeleton list.
|
protectedinherited |
Soft contact constraints those are automatically created.
|
protectedinherited |
Time step.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.
|
protected |
Cache data for boxed LCP formulation.