opensurgsim
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SurgSim::Physics::PushResults Class Reference

Propagates the Mlcp result to the representations. More...

#include <PushResults.h>

Inheritance diagram for SurgSim::Physics::PushResults:
SurgSim::Physics::Computation

Public Member Functions

 PushResults (bool doCopyState=false)
 Constructor. More...
 
 SURGSIM_CLASSNAME (SurgSim::Physics::PushResults)
 
virtual ~PushResults ()
 Destructor.
 
void setDiscardBadResults (bool filter)
 Enable/disable discarding all MLCP results if any contact constraint has a violation greater than the tolerance. More...
 
bool isDiscardBadResults () const
 
void setContactTolerance (double tolerance)
 
double getContactTolerance () const
 
- Public Member Functions inherited from SurgSim::Physics::Computation
 Computation (bool doCopyState)
 Constructor. More...
 
virtual ~Computation ()
 Destructor.
 
std::shared_ptr< PhysicsManagerStateupdate (double dt, const std::shared_ptr< PhysicsManagerState > &state)
 Public Interface execute this objects computations, dt is the time from the last update call in seconds. More...
 
void setDoCopyState (bool val)
 Sets up whether the computation will copy the state of PhysicsManagerState before executing. More...
 
bool isCopyingState ()
 Query if this object is copying the PhysicsManagerState. More...
 
virtual std::string getClassName () const =0
 The class name for this class. More...
 
Framework::TimergetTimer ()
 Provides access to the update timer. More...
 

Protected Member Functions

std::shared_ptr< PhysicsManagerStatedoUpdate (const double &dt, const std::shared_ptr< PhysicsManagerState > &state) override
 Override this function to implement the computations specific behavior.
 

Protected Attributes

std::shared_ptr< SurgSim::Framework::Loggerm_logger
 

Detailed Description

Propagates the Mlcp result to the representations.

Can optionally discard (not push) MLCP results that do not meet the contact tolerance. The MlcpGaussSeidelSolver has a contact tolerance that can be set through the SolveMlcp Computation, and which is used to determine if the solver should stop before reaching the maximum iterations. Often the SolveMlcp has a "tight" (small) tolerance to get the most accurate contacts possible, but then the MLCP tends to iterate the maximum number of times. Then, here a looser (larger) tolerance can be set such that if the MLCP is failing to meet that tolerance (i.e., the solve failed), the results are discarded. Discarding the MLCP results will mean the constraints will not be satisfied and may drive the simulation further away from successful MLCP results.

Constructor & Destructor Documentation

§ PushResults()

SurgSim::Physics::PushResults::PushResults ( bool  doCopyState = false)
explicit

Constructor.

Parameters
doCopyStateSpecify if the output state in Computation::Update() is a copy or not of the input state

Member Function Documentation

§ getContactTolerance()

double SurgSim::Physics::PushResults::getContactTolerance ( ) const
Returns
The contact tolerance.
See also
MlcpGaussSeidelSolver::getContactTolerance

§ isDiscardBadResults()

bool SurgSim::Physics::PushResults::isDiscardBadResults ( ) const
Returns
true if discarding MLCP results that have a contact violation greater than the tolerance.

§ setContactTolerance()

void SurgSim::Physics::PushResults::setContactTolerance ( double  tolerance)
Parameters
toleranceThe contact tolerance limit, only matters if discarding bad MLCP results.

§ setDiscardBadResults()

void SurgSim::Physics::PushResults::setDiscardBadResults ( bool  filter)

Enable/disable discarding all MLCP results if any contact constraint has a violation greater than the tolerance.

Parameters
filtertrue to enable filtering.

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