Go to the documentation of this file.
16 #ifndef SURGSIM_PHYSICS_REPRESENTATION_H
17 #define SURGSIM_PHYSICS_REPRESENTATION_H
29 namespace DataStructures
49 class ConstraintImplementation;
95 virtual void update(
double dt);
114 virtual void applyCorrection(
double dt,
const Eigen::VectorBlock<SurgSim::Math::Vector>& deltaVelocity);
168 std::shared_ptr<SurgSim::Framework::Logger>
m_logger;
175 #endif // SURGSIM_PHYSICS_REPRESENTATION_H
virtual ~Representation()
Destructor.
Definition: Representation.cpp:47
const SurgSim::Math::Vector3d m_gravity
Gravity vector.
Definition: Representation.h:156
virtual std::shared_ptr< Localization > createLocalization(const SurgSim::DataStructures::Location &location)
Computes a localized coordinate w.r.t this representation, given a Location object.
Definition: Representation.cpp:92
void setNumDof(size_t numDof)
Set the number of degrees of freedom.
Definition: Representation.cpp:101
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
void setIsDrivingSceneElementPose(bool isDrivingSceneElementPose)
Set whether this Representation is controlling the pose of the SceneElement that it is part of.
Definition: Representation.cpp:70
bool isDrivingSceneElementPose()
Query if this Representation is controlling the pose of the SceneElement that it is part of.
Definition: Representation.cpp:75
void setIsGravityEnabled(bool isGravityEnabled)
Set the gravity enable flag.
Definition: Representation.cpp:60
std::shared_ptr< SurgSim::Collision::Representation > getCollisionRepresentation() const
Definition: Representation.cpp:111
const SurgSim::Math::Vector3d & getGravity() const
Get the gravity used by this Representation.
Definition: Representation.cpp:106
virtual void resetState()
Reset the representation to its initial/default state.
Definition: Representation.cpp:51
bool isGravityEnabled() const
Get the gravity enable flag.
Definition: Representation.cpp:65
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
The Representation class defines the base class for all physics objects.
Definition: Representation.h:53
Definition: CompoundShapeToGraphics.cpp:29
std::shared_ptr< ConstraintImplementation > getConstraintImplementation(SurgSim::Physics::ConstraintType type)
Get a constraint implementation of the given type for this representation.
Definition: Representation.cpp:121
virtual void beforeUpdate(double dt)
Preprocessing done before the update call This needs to be called from the outside usually from a Com...
Definition: Representation.cpp:80
ConstraintType
Definition: ConstraintType.h:24
Representation & operator=(const Representation &)
NO assignment operator.
Representations are manifestations of a SceneElement.
Definition: Representation.h:33
size_t getNumDof() const
Query the object number of degrees of freedom.
Definition: Representation.cpp:55
virtual void update(double dt)
Update the representation state to the current time step.
Definition: Representation.cpp:84
A Location defines a local position w.r.t.
Definition: Location.h:39
virtual void applyCorrection(double dt, const Eigen::VectorBlock< SurgSim::Math::Vector > &deltaVelocity)
Update the Representation's current position and velocity using a time interval, dt,...
Definition: Representation.cpp:97
Representation(const std::string &name)
Constructor.
Definition: Representation.cpp:32
virtual void afterUpdate(double dt)
Postprocessing done after the update call This needs to be called from the outside usually from a Com...
Definition: Representation.cpp:88
bool m_isDrivingSceneElementPose
Is this representation driving the sceneElement pose.
Definition: Representation.h:165
std::shared_ptr< SurgSim::Collision::Representation > m_collisionRepresentation
This entity's collision representation, these are usually very specific to the physics representation...
Definition: Representation.h:141
bool m_isGravityEnabled
Gravity enabled flag.
Definition: Representation.h:162
virtual void setCollisionRepresentation(std::shared_ptr< SurgSim::Collision::Representation > representation)
Set the collision representation for this physics representation, when the collision object is involv...
Definition: Representation.cpp:116
size_t m_numDof
Number of degrees of freedom for this representation.
Definition: Representation.h:159
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger for this class.
Definition: Representation.h:168
void driveSceneElementPose(const SurgSim::Math::RigidTransform3d &pose)
This conditionally updates that pose for the scenelement to the given pose The update gets exectuded ...
Definition: Representation.cpp:132