33 #ifndef DART_CONSTRAINT_CONSTRAINTSOVER_HPP_
34 #define DART_CONSTRAINT_CONSTRAINTSOVER_HPP_
38 #include <Eigen/Dense>
49 class ShapeNodeCollisionObject;
52 namespace constraint {
75 void addSkeletons(
const std::vector<dynamics::SkeletonPtr>& skeletons);
78 const std::vector<dynamics::SkeletonPtr>&
getSkeletons()
const;
84 void removeSkeletons(
const std::vector<dynamics::SkeletonPtr>& skeletons);
#define DART_DEPRECATED(version)
Definition: Deprecated.hpp:51
Definition: CollisionDetector.hpp:56
ConstrainedGroup is a group of skeletons that interact each other with constraints.
Definition: ConstrainedGroup.hpp:58
ConstraintSolver manages constraints and computes constraint impulses.
Definition: ConstraintSolver.hpp:56
std::vector< SoftContactConstraintPtr > mSoftContactConstraints
Soft contact constraints those are automatically created.
Definition: ConstraintSolver.hpp:208
void removeSkeletons(const std::vector< dynamics::SkeletonPtr > &skeletons)
Remove multiple skeletons.
Definition: ConstraintSolver.cpp:139
std::vector< dynamics::SkeletonPtr > mSkeletons
Skeleton list.
Definition: ConstraintSolver.hpp:202
collision::CollisionResult mCollisionResult
Last collision checking result.
Definition: ConstraintSolver.hpp:196
void addSkeletons(const std::vector< dynamics::SkeletonPtr > &skeletons)
Add mutiple skeletons.
Definition: ConstraintSolver.cpp:107
void clearLastCollisionResult()
Clears the last collision result.
Definition: ConstraintSolver.cpp:192
void removeAllConstraints()
Remove all constraints.
Definition: ConstraintSolver.cpp:186
bool containConstraint(const ConstConstraintBasePtr &constraint) const
Check if the constraint is contained in this solver.
Definition: ConstraintSolver.cpp:364
virtual void solveConstrainedGroup(ConstrainedGroup &group)=0
std::vector< JointCoulombFrictionConstraintPtr > mJointCoulombFrictionConstraints
Joint Coulomb friction constraints those are automatically created.
Definition: ConstraintSolver.hpp:220
void removeConstraint(const ConstraintBasePtr &constraint)
Remove a constraint.
Definition: ConstraintSolver.cpp:169
ConstraintSolver(const ConstraintSolver &other)=delete
Copy constructor.
collision::CollisionGroupPtr getCollisionGroup()
Return collision group of collision objects that are added to this ConstraintSolver.
Definition: ConstraintSolver.cpp:255
void solveConstrainedGroups()
Solve constrained groups.
Definition: ConstraintSolver.cpp:618
std::vector< ContactConstraintPtr > mContactConstraints
Contact constraints those are automatically created.
Definition: ConstraintSolver.hpp:205
bool checkAndAddSkeleton(const dynamics::SkeletonPtr &skeleton)
Add skeleton if the constraint is not contained in this solver.
Definition: ConstraintSolver.cpp:348
void solve()
Solve constraint impulses and apply them to the skeletons.
Definition: ConstraintSolver.cpp:312
void addSkeleton(const dynamics::SkeletonPtr &skeleton)
Add single skeleton.
Definition: ConstraintSolver.cpp:87
collision::CollisionDetectorPtr mCollisionDetector
Collision detector.
Definition: ConstraintSolver.hpp:187
bool checkAndAddConstraint(const ConstraintBasePtr &constraint)
Add constraint if the constraint is not contained in this solver.
Definition: ConstraintSolver.cpp:372
void addConstraint(const ConstraintBasePtr &constraint)
Add a constraint.
Definition: ConstraintSolver.cpp:154
collision::CollisionDetectorPtr getCollisionDetector()
Get collision detector.
Definition: ConstraintSolver.cpp:242
double getTimeStep() const
Get time step.
Definition: ConstraintSolver.cpp:205
void setTimeStep(double _timeStep)
Set time step.
Definition: ConstraintSolver.cpp:198
collision::CollisionOption & getCollisionOption()
Returns collision option that is used for collision checkings in this ConstraintSolver to generate co...
Definition: ConstraintSolver.cpp:267
std::vector< MimicMotorConstraintPtr > mMimicMotorConstraints
Mimic motor constraints those are automatically created.
Definition: ConstraintSolver.hpp:217
std::vector< ServoMotorConstraintPtr > mServoMotorConstraints
Servo motor constraints those are automatically created.
Definition: ConstraintSolver.hpp:214
void removeSkeleton(const dynamics::SkeletonPtr &skeleton)
Remove single skeleton.
Definition: ConstraintSolver.cpp:120
std::vector< ConstrainedGroup > mConstrainedGroups
Constraint group list.
Definition: ConstraintSolver.hpp:229
collision::CollisionResult & getLastCollisionResult()
Return the last collision checking result.
Definition: ConstraintSolver.cpp:279
std::vector< ConstraintBasePtr > mManualConstraints
Constraints that manually added.
Definition: ConstraintSolver.hpp:223
const std::vector< dynamics::SkeletonPtr > & getSkeletons() const
Returns all the skeletons added to this ConstraintSolver.
Definition: ConstraintSolver.cpp:114
collision::CollisionGroupPtr mCollisionGroup
Collision group.
Definition: ConstraintSolver.hpp:190
std::vector< ConstraintBasePtr > mActiveConstraints
Active constraints.
Definition: ConstraintSolver.hpp:226
bool isSoftContact(const collision::Contact &contact) const
Return true if at least one of colliding body is soft body.
Definition: ConstraintSolver.cpp:625
double mTimeStep
Time step.
Definition: ConstraintSolver.hpp:199
void setLCPSolver(std::unique_ptr< LCPSolver > lcpSolver)
Set LCP solver.
Definition: ConstraintSolver.cpp:292
ConstraintSolver(double timeStep)
Constructor.
Definition: ConstraintSolver.cpp:61
void removeAllSkeletons()
Remove all skeletons in this constraint solver.
Definition: ConstraintSolver.cpp:147
virtual ~ConstraintSolver()
Destructor.
Definition: ConstraintSolver.cpp:81
std::vector< JointLimitConstraintPtr > mJointLimitConstraints
Joint limit constraints those are automatically created.
Definition: ConstraintSolver.hpp:211
void updateConstraints()
Update constraints.
Definition: ConstraintSolver.cpp:387
collision::CollisionOption mCollisionOption
Collision detection option.
Definition: ConstraintSolver.hpp:193
bool containSkeleton(const dynamics::ConstSkeletonPtr &skeleton) const
Check if the skeleton is contained in this solver.
Definition: ConstraintSolver.cpp:333
LCPSolver * getLCPSolver() const
Get LCP solver.
Definition: ConstraintSolver.cpp:301
void setCollisionDetector(collision::CollisionDetector *collisionDetector)
Set collision detector.
Definition: ConstraintSolver.cpp:211
void buildConstrainedGroups()
Build constrained groupsContact.
Definition: ConstraintSolver.cpp:562
Definition: LCPSolver.hpp:45
::fcl::CollisionResult CollisionResult
Definition: BackwardCompatibility.hpp:157
::fcl::Contact Contact
Definition: BackwardCompatibility.hpp:160
std::shared_ptr< const CollisionDetector > ConstCollisionDetectorPtr
Definition: SmartPointer.hpp:41
std::shared_ptr< CollisionDetector > CollisionDetectorPtr
Definition: SmartPointer.hpp:41
std::shared_ptr< const CollisionGroup > ConstCollisionGroupPtr
Definition: SmartPointer.hpp:46
std::shared_ptr< CollisionGroup > CollisionGroupPtr
Definition: SmartPointer.hpp:46
std::shared_ptr< JointCoulombFrictionConstraint > JointCoulombFrictionConstraintPtr
Definition: SmartPointer.hpp:52
std::shared_ptr< const ConstraintBase > ConstConstraintBasePtr
Definition: SmartPointer.hpp:45
std::shared_ptr< ContactConstraint > ContactConstraintPtr
Definition: SmartPointer.hpp:47
std::shared_ptr< MimicMotorConstraint > MimicMotorConstraintPtr
Definition: SmartPointer.hpp:51
std::shared_ptr< ServoMotorConstraint > ServoMotorConstraintPtr
Definition: SmartPointer.hpp:50
std::shared_ptr< JointLimitConstraint > JointLimitConstraintPtr
Definition: SmartPointer.hpp:49
std::shared_ptr< ConstraintBase > ConstraintBasePtr
Definition: SmartPointer.hpp:45
std::shared_ptr< SoftContactConstraint > SoftContactConstraintPtr
Definition: SmartPointer.hpp:48
std::shared_ptr< const Skeleton > ConstSkeletonPtr
Definition: SmartPointer.hpp:60
std::shared_ptr< Skeleton > SkeletonPtr
Definition: SmartPointer.hpp:60
Definition: BulletCollisionDetector.cpp:63
Definition: SharedLibraryManager.hpp:43