SlidingConstraintData.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_SLIDINGCONSTRAINTDATA_H
#define SURGSIM_PHYSICS_SLIDINGCONSTRAINTDATA_H
#include "SurgSim/Physics/ConstraintData.h"
#include "SurgSim/Math/Vector.h"
#include "SurgSim/Math/RigidTransform.h"
namespace SurgSim
{
namespace Physics
{
class SlidingConstraintData : public ConstraintData
{
public:
SlidingConstraintData();
SlidingConstraintData(const SurgSim::Math::Vector3d& point, const SurgSim::Math::Vector3d& direction);
virtual ~SlidingConstraintData();
void setSlidingDirection(const SurgSim::Math::Vector3d& point, const SurgSim::Math::Vector3d& direction);
void setFrictionCoefficient(double mu);
double getFrictionCoefficient() const;
const std::array<Math::Vector3d, 2>& getNormals() const;
const Math::RigidTransform3d getPose();
const Math::Vector3d& getTangent() const;
const double getDistanceTangent() const;
private:
std::array<Math::Vector3d, 2> m_normals;
Math::Vector3d m_point;
Math::Vector3d m_slidingDirection;
Math::Vector3d m_tangent;
double m_distanceTangent;
double m_mu;
};
} // namespace Physics
} // namespace SurgSim
#endif // SURGSIM_PHYSICS_SLIDINGCONSTRAINTDATA_H
SurgSim::Physics::SlidingConstraintData::SlidingConstraintData
SlidingConstraintData()
Default constructor.
Definition: SlidingConstraintData.cpp:25
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Physics::SlidingConstraintData::getFrictionCoefficient
double getFrictionCoefficient() const
Definition: SlidingConstraintData.cpp:60
SurgSim::Physics::SlidingConstraintData::m_slidingDirection
Math::Vector3d m_slidingDirection
The sliding direction (intersection of the two planes).
Definition: SlidingConstraintData.h:77
SurgSim::Physics::SlidingConstraintData::m_tangent
Math::Vector3d m_tangent
The tangent of the two planes.
Definition: SlidingConstraintData.h:80
SurgSim::Physics::SlidingConstraintData
Class for Frictionless sliding constraint (stores two planes, the intersection of which...
Definition: SlidingConstraintData.h:30
SurgSim::Physics::ConstraintData
Base class for all CosntraintData Derived classes should be specific to a given constraint.
Definition: ConstraintData.h:27
SurgSim::Physics::SlidingConstraintData::m_normals
std::array< Math::Vector3d, 2 > m_normals
The normals of the two planes.
Definition: SlidingConstraintData.h:71
SurgSim::Physics::SlidingConstraintData::setFrictionCoefficient
void setFrictionCoefficient(double mu)
Set the friction coefficient for a frictional sliding constraint.
Definition: SlidingConstraintData.cpp:55
SurgSim::Physics::SlidingConstraintData::getPose
const Math::RigidTransform3d getPose()
/return The pose of constraint
Definition: SlidingConstraintData.cpp:65
SurgSim::Physics::SlidingConstraintData::getDistanceTangent
const double getDistanceTangent() const
Definition: SlidingConstraintData.cpp:82
RigidTransform.h
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
SurgSim::Physics::SlidingConstraintData::m_mu
double m_mu
Friction coefficient for frictional constraint (unused for frictionless constraint).
Definition: SlidingConstraintData.h:86
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::Physics::SlidingConstraintData::~SlidingConstraintData
virtual ~SlidingConstraintData()
Destructor.
Definition: SlidingConstraintData.cpp:40
Vector.h
Definitions of small fixed-size vector types.
SurgSim::Physics::SlidingConstraintData::getNormals
const std::array< Math::Vector3d, 2 > & getNormals() const
Definition: SlidingConstraintData.cpp:72
SurgSim::Physics::SlidingConstraintData::setSlidingDirection
void setSlidingDirection(const SurgSim::Math::Vector3d &point, const SurgSim::Math::Vector3d &direction)
Calculate the two plane equations based on the given sliding direction.
Definition: SlidingConstraintData.cpp:44
SurgSim::Physics::SlidingConstraintData::getTangent
const Math::Vector3d & getTangent() const
Definition: SlidingConstraintData.cpp:77
ConstraintData.h
SurgSim::Physics::SlidingConstraintData::m_point
Math::Vector3d m_point
The point of constraint.
Definition: SlidingConstraintData.h:74
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SurgSim::Physics::SlidingConstraintData::m_distanceTangent
double m_distanceTangent
The distance from origin of the tangential plane.
Definition: SlidingConstraintData.h:83