dart
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dart::dynamics::BoxedLcpConstraintSolver Class Reference
Inheritance diagram for dart::dynamics::BoxedLcpConstraintSolver:
Inheritance graph
[legend]
Collaboration diagram for dart::dynamics::BoxedLcpConstraintSolver:
Collaboration graph
[legend]

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.
 
void setSecondaryBoxedLcpSolver (BoxedLcpSolverPtr lcpSolver)
 Sets boxed LCP (BLCP) solver that is used when the primary solver failed.
 
ConstBoxedLcpSolverPtr getSecondaryBoxedLcpSolver () const
 Returns boxed LCP (BLCP) solver that is used when the primary solver failed.
 
- Public Member Functions inherited from dart::dynamics::ConstraintSolver
 ConstraintSolver (double timeStep)
 Constructor. More...
 
 ConstraintSolver ()
 Default constructor.
 
 ConstraintSolver (const ConstraintSolver &other)=delete
 Copy constructor.
 
virtual ~ConstraintSolver ()=default
 Destructor.
 
void addSkeleton (const dynamics::SkeletonPtr &skeleton)
 Add single skeleton.
 
void addSkeletons (const std::vector< dynamics::SkeletonPtr > &skeletons)
 Add mutiple skeletons.
 
const std::vector< dynamics::SkeletonPtr > & getSkeletons () const
 Returns all the skeletons added to this ConstraintSolver.
 
void removeSkeleton (const dynamics::SkeletonPtr &skeleton)
 Remove single skeleton.
 
void removeSkeletons (const std::vector< dynamics::SkeletonPtr > &skeletons)
 Remove multiple skeletons.
 
void removeAllSkeletons ()
 Remove all skeletons in this constraint solver.
 
void addConstraint (const ConstraintBasePtr &constraint)
 Add a constraint.
 
void removeConstraint (const ConstraintBasePtr &constraint)
 Remove a constraint.
 
void removeAllConstraints ()
 Remove all constraints.
 
std::size_t getNumConstraints () const
 Returns the number of constraints that was manually added to this ConstraintSolver. More...
 
dynamics::ConstraintBasePtr getConstraint (std::size_t index)
 Returns a constraint by index.
 
dynamics::ConstConstraintBasePtr getConstraint (std::size_t index) const
 Returns a constraint by index.
 
std::vector< dynamics::ConstraintBasePtr > getConstraints ()
 Returns all the constraints added to this ConstraintSolver.
 
std::vector< dynamics::ConstConstraintBasePtr > getConstraints () const
 Returns all the constraints added to this ConstraintSolver.
 
void clearLastCollisionResult ()
 Clears the last collision result.
 
virtual void setTimeStep (double _timeStep)
 Set time step.
 
double getTimeStep () const
 Get time step.
 
void setCollisionDetector (collision::CollisionDetector *collisionDetector)
 Set collision detector. More...
 
void setCollisionDetector (const std::shared_ptr< collision::CollisionDetector > &collisionDetector)
 Set collision detector.
 
collision::CollisionDetectorPtr getCollisionDetector ()
 Get collision detector.
 
collision::ConstCollisionDetectorPtr getCollisionDetector () const
 Get (const) collision detector.
 
collision::CollisionGroupPtr getCollisionGroup ()
 Return collision group of collision objects that are added to this ConstraintSolver.
 
collision::ConstCollisionGroupPtr getCollisionGroup () const
 Return (const) collision group of collision objects that are added to this ConstraintSolver.
 
collision::CollisionOptiongetCollisionOption ()
 Returns collision option that is used for collision checkings in this ConstraintSolver to generate contact constraints. More...
 
const collision::CollisionOptiongetCollisionOption () const
 Returns collision option that is used for collision checkings in this ConstraintSolver to generate contact constraints. More...
 
collision::CollisionResultgetLastCollisionResult ()
 Return the last collision checking result.
 
const collision::CollisionResultgetLastCollisionResult () const
 Return the last collision checking result.
 
void setLCPSolver (std::unique_ptr< LCPSolver > lcpSolver)
 Set LCP solver.
 
LCPSolvergetLCPSolver () const
 Get LCP solver.
 
void solve ()
 Solve constraint impulses and apply them to the skeletons.
 
virtual void setFromOtherConstraintSolver (const ConstraintSolver &other)
 Sets this constraint solver using other constraint solver. More...
 

Protected Member Functions

void solveConstrainedGroup (ConstrainedGroup &group) override
 
- Protected Member Functions inherited from dart::dynamics::ConstraintSolver
bool containSkeleton (const dynamics::ConstSkeletonPtr &skeleton) const
 Check if the skeleton is contained in this solver.
 
bool checkAndAddSkeleton (const dynamics::SkeletonPtr &skeleton)
 Add skeleton if the constraint is not contained in this solver.
 
bool containConstraint (const ConstConstraintBasePtr &constraint) const
 Check if the constraint is contained in this solver.
 
bool checkAndAddConstraint (const ConstraintBasePtr &constraint)
 Add constraint if the constraint is not contained in this solver.
 
void updateConstraints ()
 Update constraints.
 
void buildConstrainedGroups ()
 Build constrained groupsContact.
 
void solveConstrainedGroups ()
 Solve constrained groups.
 
bool isSoftContact (const collision::Contact &contact) const
 Return true if at least one of colliding body is soft body.
 

Protected Attributes

BoxedLcpSolverPtr mBoxedLcpSolver
 Boxed LCP solver.
 
BoxedLcpSolverPtr mSecondaryBoxedLcpSolver
 Boxed LCP solver to be used when the primary solver failed.
 
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > mA
 Cache data for boxed LCP formulation.
 
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > mABackup
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mX
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mXBackup
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mB
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mBBackup
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mW
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mLo
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mLoBackup
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mHi
 Cache data for boxed LCP formulation.
 
Eigen::VectorXd mHiBackup
 Cache data for boxed LCP formulation.
 
Eigen::VectorXi mFIndex
 Cache data for boxed LCP formulation.
 
Eigen::VectorXi mFIndexBackup
 Cache data for boxed LCP formulation.
 
Eigen::VectorXi mOffset
 Cache data for boxed LCP formulation.
 
- Protected Attributes inherited from dart::dynamics::ConstraintSolver
collision::CollisionDetectorPtr mCollisionDetector
 Collision detector.
 
collision::CollisionGroupPtr mCollisionGroup
 Collision group.
 
collision::CollisionOption mCollisionOption
 Collision detection option.
 
collision::CollisionResult mCollisionResult
 Last collision checking result.
 
double mTimeStep
 Time step.
 
std::vector< dynamics::SkeletonPtr > mSkeletons
 Skeleton list.
 
std::vector< ContactConstraintPtr > mContactConstraints
 Contact constraints those are automatically created.
 
std::vector< SoftContactConstraintPtr > mSoftContactConstraints
 Soft contact constraints those are automatically created.
 
std::vector< JointLimitConstraintPtr > mJointLimitConstraints
 Joint limit constraints those are automatically created.
 
std::vector< ServoMotorConstraintPtr > mServoMotorConstraints
 Servo motor constraints those are automatically created.
 
std::vector< MimicMotorConstraintPtr > mMimicMotorConstraints
 Mimic motor constraints those are automatically created.
 
std::vector< JointCoulombFrictionConstraintPtr > mJointCoulombFrictionConstraints
 Joint Coulomb friction constraints those are automatically created.
 
std::vector< ConstraintBasePtr > mManualConstraints
 Constraints that manually added.
 
std::vector< ConstraintBasePtr > mActiveConstraints
 Active constraints.
 
std::vector< ConstrainedGroupmConstrainedGroups
 Constraint group list.
 

Additional Inherited Members

- Protected Types inherited from dart::dynamics::ConstraintSolver
using CollisionDetector = collision::CollisionDetector
 

Constructor & Destructor Documentation

◆ BoxedLcpConstraintSolver() [1/4]

dart::dynamics::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver ( double  timeStep,
BoxedLcpSolverPtr  boxedLcpSolver = nullptr,
BoxedLcpSolverPtr  secondaryBoxedLcpSolver = nullptr 
)

Constructor.

Parameters
[in]timeStepSimulation time step
[in]boxedLcpSolverThe primary boxed LCP solver. When nullptr is passed, Dantzig solver will be used.
[in]secondaryBoxedLcpSolverThe 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.
Deprecated:
Deprecated in DART 6.8. Please use other constructors that doesn't take timespte. Timestep should be set by the owner of this solver such as dart::simulation::World when the solver added.

◆ BoxedLcpConstraintSolver() [2/4]

dart::dynamics::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver ( )

Constructos with default primary and secondary LCP solvers, which are Dantzig and PGS, respectively.

◆ BoxedLcpConstraintSolver() [3/4]

dart::dynamics::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver ( BoxedLcpSolverPtr  boxedLcpSolver)

Constructors with specific primary LCP solver.

Parameters
[in]boxedLcpSolverThe primary boxed LCP solver. When nullptr is passed, which is discouraged, Dantzig solver will be used.

◆ BoxedLcpConstraintSolver() [4/4]

dart::dynamics::BoxedLcpConstraintSolver::BoxedLcpConstraintSolver ( BoxedLcpSolverPtr  boxedLcpSolver,
BoxedLcpSolverPtr  secondaryBoxedLcpSolver 
)

Constructs with specific primary and secondary LCP solvers.

Parameters
[in]boxedLcpSolverThe primary boxed LCP solver. When nullptr is passed, which is discouraged, Dantzig solver will be used.
[in]secondaryBoxedLcpSolverThe secondary boxed-LCP solver. Pass nullptr to disable using secondary LCP solver.

Member Function Documentation

◆ setBoxedLcpSolver()

void dart::dynamics::BoxedLcpConstraintSolver::setBoxedLcpSolver ( BoxedLcpSolverPtr  lcpSolver)

Sets boxed LCP (BLCP) solver.

Parameters
[in]lcpSolverThe primary boxed LCP solver. When nullptr is passed, Dantzig solver will be used.

The documentation for this class was generated from the following files: