RigidState.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_PHYSICS_RIGIDSTATE_H
#define SURGSIM_PHYSICS_RIGIDSTATE_H
#include "SurgSim/Framework/Accessible.h"
#include "SurgSim/Framework/Macros.h"
#include "SurgSim/Math/RigidTransform.h"
#include "SurgSim/Math/Vector.h"
namespace SurgSim
{
namespace Physics
{
class RigidState : public SurgSim::Framework::Accessible
{
public:
RigidState();
RigidState(const RigidState& rhs);
RigidState& operator=(const RigidState& rhs);
virtual ~RigidState();
SURGSIM_CLASSNAME(SurgSim::Physics::RigidState);
bool operator==(const RigidState& rhs) const;
bool operator!=(const RigidState& rhs) const;
void reset();
const SurgSim::Math::Vector3d& getLinearVelocity() const;
const SurgSim::Math::Vector3d& getAngularVelocity() const;
void setLinearVelocity(const SurgSim::Math::Vector3d &v);
void setAngularVelocity(const SurgSim::Math::Vector3d &w);
void setPose(const SurgSim::Math::RigidTransform3d& pose);
const SurgSim::Math::RigidTransform3d& getPose() const;
private:
void addSerializableProperty();
SurgSim::Math::Vector3d m_v;
SurgSim::Math::Vector3d m_w;
SurgSim::Math::RigidTransform3d m_pose;
};
}; // Physics
}; // SurgSim
#endif // SURGSIM_PHYSICS_RIGIDSTATE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Physics::RigidState::reset
void reset()
Reset the state to default values Vectors will be filled with 0 Rotations will be set to identity (qu...
Definition: RigidState.cpp:76
SurgSim::Physics::RigidState::~RigidState
virtual ~RigidState()
Destructor.
Definition: RigidState.cpp:62
SurgSim::Physics::RigidState::getAngularVelocity
const SurgSim::Math::Vector3d & getAngularVelocity() const
Get the angular velocity.
Definition: RigidState.cpp:88
SurgSim::Physics::RigidState::RigidState
RigidState()
Default constructor.
Definition: RigidState.cpp:25
Accessible.h
SurgSim::Physics::RigidState::operator==
bool operator==(const RigidState &rhs) const
Comparison operator.
Definition: RigidState.cpp:66
SurgSim::Physics::RigidState::setAngularVelocity
void setAngularVelocity(const SurgSim::Math::Vector3d &w)
Set the angular velocity.
Definition: RigidState.cpp:98
SurgSim::Physics::RigidState::m_v
SurgSim::Math::Vector3d m_v
Linear velocity.
Definition: RigidState.h:96
SurgSim::Physics::RigidState::getPose
const SurgSim::Math::RigidTransform3d & getPose() const
Get the rigid representation pose.
Definition: RigidState.cpp:108
SurgSim::Physics::RigidState::m_w
SurgSim::Math::Vector3d m_w
Angular velocity.
Definition: RigidState.h:99
SurgSim::Physics::RigidState::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Physics::RigidState)
SurgSim::Physics::RigidState
The RigidState class describes a state (position and velocity information).
Definition: RigidState.h:31
RigidTransform.h
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
Macros.h
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::Physics::RigidState::m_pose
SurgSim::Math::RigidTransform3d m_pose
Rigid representation pose (translation + rotation)
Definition: RigidState.h:102
SurgSim::Physics::RigidState::getLinearVelocity
const SurgSim::Math::Vector3d & getLinearVelocity() const
Get the linear velocity.
Definition: RigidState.cpp:83
Vector.h
Definitions of small fixed-size vector types.
SurgSim::Physics::RigidState::setPose
void setPose(const SurgSim::Math::RigidTransform3d &pose)
Set the rigid representation pose.
Definition: RigidState.cpp:103
SurgSim::Framework::Accessible
Mixin class for enabling a property system on OSS classes, the instance still needs to initialize pro...
Definition: Accessible.h:37
SurgSim::Physics::RigidState::operator!=
bool operator!=(const RigidState &rhs) const
Comparison operator.
Definition: RigidState.cpp:71
SurgSim::Physics::RigidState::setLinearVelocity
void setLinearVelocity(const SurgSim::Math::Vector3d &v)
Set the linear velocity.
Definition: RigidState.cpp:93
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SurgSim::Physics::RigidState::addSerializableProperty
void addSerializableProperty()
Register accessors of serializable properties.
Definition: RigidState.cpp:41
SurgSim::Physics::RigidState::operator=
RigidState & operator=(const RigidState &rhs)
Copy assignment.
Definition: RigidState.cpp:52