Go to the documentation of this file.
16 #ifndef SURGSIM_PHYSICS_RIGIDREPRESENTATIONBASE_H
17 #define SURGSIM_PHYSICS_RIGIDREPRESENTATIONBASE_H
106 void setShape(
const std::shared_ptr<SurgSim::Math::Shape> shape);
110 const std::shared_ptr<SurgSim::Math::Shape>
getShape()
const;
157 std::shared_ptr<SurgSim::Math::Shape>
m_shape;
178 #endif // SURGSIM_PHYSICS_RIGIDREPRESENTATIONBASE_H
RigidRepresentationBase(const std::string &name)
Constructor.
Definition: RigidRepresentationBase.cpp:33
The RigidState class describes a state (position and velocity information).
Definition: RigidState.h:31
void setCollisionRepresentation(std::shared_ptr< SurgSim::Collision::Representation > representation) override
Set the collision representation for this physics representation, when the collision object is involv...
Definition: RigidRepresentationBase.cpp:215
std::shared_ptr< T > createTypedLocalization(const SurgSim::DataStructures::Location &location)
Creates typed localization.
Definition: RigidRepresentationBase-inl.h:26
void setLinearDamping(double linearDamping)
Set the linear damping parameter.
Definition: RigidRepresentationBase.cpp:152
void setDensity(double rho)
Set the mass density of the rigid representation.
Definition: RigidRepresentationBase.cpp:126
std::shared_ptr< Localization > createLocalization(const SurgSim::DataStructures::Location &location) override
Computes a localized coordinate w.r.t this representation, given a Location object.
Definition: RigidRepresentationBase.cpp:120
const RigidState & getInitialState() const
Get the initial state of the rigid representation.
Definition: RigidRepresentationBase.cpp:105
const SurgSim::Math::Matrix33d & getLocalInertia() const
Get the local inertia 3x3 matrix of the rigid body.
Definition: RigidRepresentationBase.cpp:147
void setShape(const std::shared_ptr< SurgSim::Math::Shape > shape)
Set the shape to use internally for physical parameters computation.
Definition: RigidRepresentationBase.cpp:172
RigidState m_initialState
Initial rigid representation state (useful for reset)
Definition: RigidRepresentationBase.h:127
double m_linearDamping
Linear damping parameter (in N.s.m-1 or Kg.s-1)
Definition: RigidRepresentationBase.h:145
double getMass() const
Get the mass of the rigid body.
Definition: RigidRepresentationBase.cpp:137
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: RigidRepresentationBase.cpp:74
The Representation class defines the base class for all physics objects.
Definition: Representation.h:53
Definition: CompoundShapeToGraphics.cpp:29
void setAngularDamping(double angularDamping)
Set the angular damping parameter.
Definition: RigidRepresentationBase.cpp:162
RigidState m_previousState
Previous rigid representation state.
Definition: RigidRepresentationBase.h:129
double getAngularDamping() const
Get the angular damping parameter.
Definition: RigidRepresentationBase.cpp:167
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: RigidRepresentationBase.cpp:62
virtual void updateGlobalInertiaMatrices(const RigidState &state)=0
const RigidState & getCurrentState() const
Get the current state of the rigid representation.
Definition: RigidRepresentationBase.cpp:110
SurgSim::Math::Matrix33d m_localInertia
Inertia matrix in local coordinates.
Definition: RigidRepresentationBase.h:154
double m_mass
Total mass of the object (in Kg)
Definition: RigidRepresentationBase.h:142
virtual ~RigidRepresentationBase()
Destructor.
Definition: RigidRepresentationBase.cpp:58
void resetState() override
Reset the representation to its initial/default state.
Definition: RigidRepresentationBase.cpp:94
The RigidRepresentationBase class defines the base class for all rigid motion based representations (...
Definition: RigidRepresentationBase.h:38
bool m_parametersValid
Validity of the parameters.
Definition: RigidRepresentationBase.h:136
A Location defines a local position w.r.t.
Definition: Location.h:39
RigidState m_currentState
Current rigid representation state.
Definition: RigidRepresentationBase.h:131
double getLinearDamping() const
Get the linear damping parameter.
Definition: RigidRepresentationBase.cpp:157
void afterUpdate(double dt) override
Postprocessing done after the update call This needs to be called from the outside usually from a Com...
Definition: RigidRepresentationBase.cpp:209
const RigidState & getPreviousState() const
Get the previous state of the rigid representation.
Definition: RigidRepresentationBase.cpp:115
RigidState m_finalState
Last valid/final rigid representation state.
Definition: RigidRepresentationBase.h:133
SurgSim::Math::Vector3d m_massCenter
Mass-center of the object.
Definition: RigidRepresentationBase.h:151
void setInitialState(const RigidState &state)
Set the initial state of the rigid representation.
Definition: RigidRepresentationBase.cpp:85
std::shared_ptr< SurgSim::Math::Shape > m_shape
Shape to be used for the mass/inertia calculation.
Definition: RigidRepresentationBase.h:157
const SurgSim::Math::Vector3d & getMassCenter() const
Get the mass center of the rigid body.
Definition: RigidRepresentationBase.cpp:142
double m_rho
Density of the object (in Kg.m-3)
Definition: RigidRepresentationBase.h:139
double getDensity() const
Get the mass density of the rigid representation.
Definition: RigidRepresentationBase.cpp:132
void updateProperties()
Updates mass, mass center and inertia when density and/or shape used for mass inertia is updated.
Definition: RigidRepresentationBase.cpp:186
double m_angularDamping
Angular damping parameter (in N.m.s.rad-1)
Definition: RigidRepresentationBase.h:148
void beforeUpdate(double dt) override
Preprocessing done before the update call This needs to be called from the outside usually from a Com...
Definition: RigidRepresentationBase.cpp:204
const std::shared_ptr< SurgSim::Math::Shape > getShape() const
Get the shape used internally for physical parameters computation.
Definition: RigidRepresentationBase.cpp:181