File mechanics/src/joints/NewtonEulerJointR.hpp#
Go to the source code of this file
-
class NewtonEulerJointR : public NewtonEulerR
- #include <NewtonEulerJointR.hpp>
This class implements an abstract Joint relation (articulation) between one or two Newton/Euler dynamical systems.
Subclassed by CouplerJointR, CylindricalJointR, FixedJointR, KneeJointR, PrismaticJointR
Public Types
Public Functions
-
inline NewtonEulerJointR()
Empty constructor.
The relation may be initialized later by setPoint, setAbsolute, and setBasePositions.
-
inline void setPoint(unsigned int index, SP::SiconosVector point)
Set a point for this joint.
The role of each point is specific to the joint subclass. Won’t take effect until setBasePositions is called.
- Parameters:
index – The index of the points.
point – A SiconosVector of size 3.
-
inline SP::SiconosVector point(unsigned int index)
Get a point for this joint.
- Parameters:
index – The index of the point.
- Returns:
The requested point.
-
inline VectorOfVectors &points()
Get the vector of points for this joint.
- Returns:
The vector of points.
-
inline void setAxis(unsigned int index, SP::SiconosVector axis)
Set an axis for this joint.
The role of each axis is specific to the joint subclass. Won’t take effect until setBasePositions is called.
- Parameters:
index – The index of the points.
axis – A SiconosVector of size 3.
-
inline SP::SiconosVector axis(unsigned int index)
Get an axis for this joint.
- Parameters:
index – The index of the point.
- Returns:
The requested axis.
-
inline VectorOfVectors &axes()
Get the vector of axes for this joint.
- Returns:
The vector of axes.
-
inline void setAbsolute(bool absoluteRef)
Set whether points and axes should be interpreted in absolute or relative frame.
Won’t take effect until setBasePositions is called.
- Parameters:
absoluteRef – true for absolute frame, false for relative frame.
-
inline bool absolute()
Get whether points and axes are interpreted in absolute or relative frame.
- Returns:
True for absolute frame, false for relative frame.
-
virtual void setBasePositions(SP::SiconosVector q1, SP::SiconosVector q2 = SP::SiconosVector()) = 0
Initialize the joint constants based on the provided base positions.
- Parameters:
q1 – A SiconosVector of size 7 indicating translation and orientation in inertial coordinates.
q2 – An optional SiconosVector of size 7 indicating translation and orientation; if null, the inertial frame will be considered as the second base.
-
inline virtual void computehDoF(double time, const BlockVector &q0, SiconosVector &y, unsigned int axis = 0)
Compute the vector of linear and angular positions of the free axes.
-
inline virtual void computeJachqDoF(double time, Interaction &inter, SP::BlockVector q0, SimpleMatrix &jachq, unsigned int axis = 0)
Compute the jacobian of linear and angular DoF with respect to some q.
-
void projectVectorDoF(const SiconosVector &v, const BlockVector &q0, SiconosVector &ans, int axis, bool absoluteRef = true)
Project a vector onto the given 0-indexed free axis.
Useful for calculating velocities in the axis, or for calculating axis-aligned forces applied to connected bodies. If axis is of angular type (see typeOfDoF), then the projection is onto the axis of rotation.
- Parameters:
v – The vector to project
q0 – The state q of one or more NewtonEulerDS
ans – The vector to receive the projection.
absoluteRef – If true, v and ans are in the inertial frame, otherwise the q1 frame is assumed.
-
SP::SiconosVector projectVectorDoF(const SiconosVector &v, const BlockVector &q0, int axis, bool absoluteRef = true)#
-
void normalDoF(SiconosVector &ans, const BlockVector &q0, int axis, bool absoluteRef = true)
Retrieve a normal in the direction of a 0-indexed free axis.
Useful for calculating velocities in the axis, or for calculating axis-aligned forces applied to connected bodies. If axis is of angular type (see typeOfDoF), then the returned normal is the axis of rotation.
- Parameters:
ans – The vector to receive the projection.
q0 – The state q of one or more NewtonEulerDS
axis –
absoluteRef – If true, ans is in the inertial frame, otherwise the q1 frame is assumed.
-
SP::SiconosVector normalDoF(const BlockVector &q0, int axis, bool absoluteRef = true)#
-
inline bool allowSelfCollide()
Return the value of the _allowSelfCollide flag.
-
inline void setAllowSelfCollide(bool x)
Set the value of the _allowSelfCollide flag.
-
virtual unsigned int numberOfConstraints() = 0
Get the number of constraints defined in the joint.
- Returns:
the number of constraints
-
virtual unsigned int numberOfDoF() = 0
Return the number of degrees of freedom of this joint.
- Returns:
the number of degrees of freedom (DoF)
-
virtual DoF_Type typeOfDoF(unsigned int axis) = 0
Return the type of a degree of freedom of this joint.
- Returns:
the type of the degree of freedom (DoF)
-
inline virtual ~NewtonEulerJointR()#
Protected Functions
-
ACCEPT_SERIALIZATION(NewtonEulerJointR)#
-
inline virtual void _normalDoF(SiconosVector &ans, const BlockVector &q0, int axis, bool absoluteRef = true)#
Private version of normalDoF for subclasses to override.
Protected Attributes
-
bool _allowSelfCollide#
A flag determining whether this joint should block “self-collision”, i.e., if true, bodies connected by this joint will not enter into unilateral contact.
-
VectorOfVectors _points#
Points used to defined the joint constraint.
-
VectorOfVectors _axes#
Axes used to defined the joint constraint.
-
bool _absoluteRef#
Defines whether points and axes are specified in absolute or relative frame.
-
inline NewtonEulerJointR()