Biorbd
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
biorbd::muscles::WrappingCylinder Class Reference

Cylinder object that makes the muscle to wrap around. More...

#include <WrappingCylinder.h>

Inheritance diagram for biorbd::muscles::WrappingCylinder:
biorbd::muscles::WrappingObject biorbd::utils::Vector3d biorbd::utils::Node

Classes

class  NodeMusclePair
 Pair of 2 muscles points. More...
 

Public Member Functions

 WrappingCylinder ()
 Construct a wrapping cylinder.
 
 WrappingCylinder (const biorbd::utils::RotoTrans &rt, const biorbd::utils::Scalar &diameter, const biorbd::utils::Scalar &length, bool isCylinderPositiveSign)
 Construct a wrapping cylinder. More...
 
 WrappingCylinder (const biorbd::utils::RotoTrans &rt, const biorbd::utils::Scalar &diameter, const biorbd::utils::Scalar &length, bool isCylinderPositiveSign, const biorbd::utils::String &name, const biorbd::utils::String &parentName)
 Construct a wrapping cylinder. More...
 
biorbd::muscles::WrappingCylinder DeepCopy () const
 Deep copy of the wrapping cylinder. More...
 
void DeepCopy (const biorbd::muscles::WrappingCylinder &other)
 Deep copy of the wrapping cylinder in another wrapping cylinder. More...
 
void wrapPoints (const biorbd::utils::RotoTrans &rt, const biorbd::utils::Vector3d &p1_bone, const biorbd::utils::Vector3d &p2_bone, biorbd::utils::Vector3d &p1, biorbd::utils::Vector3d &p2, biorbd::utils::Scalar *length=nullptr)
 From the position of the cylinder, return the 2 locations where the muscle leaves the wrapping object. More...
 
void wrapPoints (biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q, const biorbd::utils::Vector3d &p1_bone, const biorbd::utils::Vector3d &p2_bone, biorbd::utils::Vector3d &p1, biorbd::utils::Vector3d &p2, biorbd::utils::Scalar *length=nullptr)
 From the position of the cylinder, return the 2 locations where the muscle leaves the wrapping object. More...
 
void wrapPoints (biorbd::utils::Vector3d &p1, biorbd::utils::Vector3d &p2, biorbd::utils::Scalar *length=nullptr)
 Returns the previously computed 2 locations where the muscle leaves the wrapping object. More...
 
virtual const biorbd::utils::RotoTransRT (biorbd::rigidbody::Joints &model, const biorbd::rigidbody::GeneralizedCoordinates &Q, bool updateKin=true)
 Return the RotoTrans matrix of the cylinder. More...
 
void setDiameter (const biorbd::utils::Scalar &val)
 Set the diameter of the wrapping cylinder. More...
 
const biorbd::utils::Scalar & diameter () const
 Return the diameter of the cylinder. More...
 
biorbd::utils::Scalar radius () const
 Return the radius of the cylinder. More...
 
void setLength (const biorbd::utils::Scalar &val)
 Set the length of the cylinder. More...
 
const biorbd::utils::Scalar & length () const
 Return the length of the cylinder. More...
 
- Public Member Functions inherited from biorbd::muscles::WrappingObject
 WrappingObject ()
 Construct a wrapping object.
 
 WrappingObject (const biorbd::utils::Scalar &x, const biorbd::utils::Scalar &y, const biorbd::utils::Scalar &z)
 Construct a wrapping object. More...
 
 WrappingObject (const biorbd::utils::Scalar &x, const biorbd::utils::Scalar &y, const biorbd::utils::Scalar &z, const biorbd::utils::String &name, const biorbd::utils::String &parentName)
 Construct a wrapping object. More...
 
 WrappingObject (const biorbd::utils::Vector3d &other)
 Construct a wrapping object from 3d Vector. More...
 
 WrappingObject (const biorbd::utils::Vector3d &other, const biorbd::utils::String &name, const biorbd::utils::String &parentName)
 Construct a wrapping object. More...
 
void DeepCopy (const biorbd::muscles::WrappingObject &other)
 Deep copy of the wrapping ibject in another wrapping object. More...
 
const biorbd::utils::RotoTransRT () const
 Return the RotoTrans matrix of the wrapping object. More...
 
biorbd::muscles::WrappingObjectoperator= (const biorbd::utils::Vector3d &other)
 To be able to use the equal "=" operator to define wrapping object. More...
 
- Public Member Functions inherited from biorbd::utils::Vector3d
 Vector3d ()
 Construct 3D vector. More...
 
 Vector3d (const biorbd::utils::Scalar &x, const biorbd::utils::Scalar &y, const biorbd::utils::Scalar &z)
 Construct 3D vector. More...
 
 Vector3d (const biorbd::utils::Scalar &x, const biorbd::utils::Scalar &y, const biorbd::utils::Scalar &z, const biorbd::utils::String &name, const biorbd::utils::String &parentName)
 Construct a 3D vector. More...
 
 Vector3d (const biorbd::utils::Vector3d vec, const biorbd::utils::String &name, const biorbd::utils::String &parentName)
 Construct a 3D vector. More...
 
 Vector3d (const RigidBodyDynamics::Math::Vector3d &other)
 Construct a 3D vector from a Casadi 3D vector (drop the trailling 1) More...
 
 Vector3d (const RigidBodyDynamics::Math::VectorNd &other)
 Construct a 3D vector from a Casadi ND vector (drop the trailling 1) More...
 
 Vector3d (const RigidBodyDynamics::Math::Vector4d &other)
 Construct a 3D vector from an eigen 4D vector (drop the trailling 1) More...
 
biorbd::utils::Vector3d DeepCopy () const
 Deep copy of a 3D vector. More...
 
void DeepCopy (const biorbd::utils::Vector3d &other)
 Deep copy of a 3D vector into another 3D vector. More...
 
biorbd::utils::Vector3d applyRT (const RotoTrans &rt) const
 Apply a RotoTrans to the 3D vector. More...
 
void applyRT (const RotoTrans &rt)
 Apply a RotoTrans to the 3D vector. More...
 
- Public Member Functions inherited from biorbd::utils::Node
 Node ()
 Construct Node.
 
 Node (const biorbd::utils::Node &other)
 Construct Node from another node. More...
 
 Node (const biorbd::utils::String &name)
 Construct Node. More...
 
 Node (const biorbd::utils::String &name, const biorbd::utils::String &parentName)
 Construct Node. More...
 
virtual ~Node ()
 Destroy class properly.
 
void DeepCopy (const biorbd::utils::Node &other)
 Deep copy of the node in another node. More...
 
void setName (const biorbd::utils::String &name)
 Set the name of the node. More...
 
const biorbd::utils::Stringname () const
 Return the name of the node.
 
const biorbd::utils::Stringparent () const
 Return the parent name of the node.
 
void setParent (const biorbd::utils::String &name)
 Set the parent name of the node. More...
 
biorbd::utils::NODE_TYPE typeOfNode () const
 Return the type of node.
 

Protected Member Functions

void findTangentToCircle (const biorbd::utils::Vector3d &p, biorbd::utils::Vector3d &p_tan) const
 Find the two tangents of a point with a circle. More...
 
void selectTangents (const NodeMusclePair &p, biorbd::utils::Vector3d &p_tan) const
 Select between a set of nodes which ones to keep. More...
 
bool findVerticalNode (const NodeMusclePair &pointsInGlobal, NodeMusclePair &pointsToWrap) const
 Find the height of both points. More...
 
bool checkIfWraps (const NodeMusclePair &pointsInGlobal, NodeMusclePair &pointsToWrap) const
 Check if a wrapper has to be done. More...
 
biorbd::utils::Scalar computeLength (const NodeMusclePair &p) const
 Compute the muscle length on the cylinder. More...
 
- Protected Member Functions inherited from biorbd::utils::Vector3d
void setType ()
 Set the type Vector3d.
 

Protected Attributes

std::shared_ptr< biorbd::utils::Scalar > m_dia
 Diameter of the cylinder diametre du cylindre.
 
std::shared_ptr< biorbd::utils::Scalar > m_length
 Length of the cylinder.
 
std::shared_ptr< bool > m_isCylinderPositiveSign
 orientation of the muscle passing
 
std::shared_ptr< biorbd::utils::RotoTransm_RTtoParent
 RotoTrans matrix with the parent.
 
std::shared_ptr< biorbd::utils::Vector3dm_p1Wrap
 First point of contact with the wrap.
 
std::shared_ptr< biorbd::utils::Vector3dm_p2Wrap
 Second point of contact with the wrap.
 
std::shared_ptr< biorbd::utils::Scalar > m_lengthAroundWrap
 Length between p1 and p2.
 
- Protected Attributes inherited from biorbd::muscles::WrappingObject
std::shared_ptr< biorbd::utils::RotoTransm_RT
 RotoTrans matrix of the wrapping object.
 
- Protected Attributes inherited from biorbd::utils::Node
std::shared_ptr< biorbd::utils::Stringm_name
 The name of the node.
 
std::shared_ptr< biorbd::utils::Stringm_parentName
 The parent name of the node.
 
std::shared_ptr< biorbd::utils::NODE_TYPE > m_typeOfNode
 The type of the node.
 

Detailed Description

Cylinder object that makes the muscle to wrap around.

Definition at line 12 of file WrappingCylinder.h.

Constructor & Destructor Documentation

◆ WrappingCylinder() [1/2]

biorbd::muscles::WrappingCylinder::WrappingCylinder ( const biorbd::utils::RotoTrans rt,
const biorbd::utils::Scalar &  diameter,
const biorbd::utils::Scalar &  length,
bool  isCylinderPositiveSign 
)

Construct a wrapping cylinder.

Parameters
rtRotoTrans matrix of the origin of the cylinder
diameterDiameter of the cylinder
lengthLength of the cylinder
isCylinderPositiveSignIf cylinder is of positive sign

Definition at line 21 of file WrappingCylinder.cpp.

◆ WrappingCylinder() [2/2]

biorbd::muscles::WrappingCylinder::WrappingCylinder ( const biorbd::utils::RotoTrans rt,
const biorbd::utils::Scalar &  diameter,
const biorbd::utils::Scalar &  length,
bool  isCylinderPositiveSign,
const biorbd::utils::String name,
const biorbd::utils::String parentName 
)

Construct a wrapping cylinder.

Parameters
rtRotoTrans matrix
diameterDiameter of the cylinder
lengthLength of the cylinder
isCylinderPositiveSignIf cylinder is of positive sign
nameThe name of the cylinder
parentNameThe parent name segment

Definition at line 38 of file WrappingCylinder.cpp.

Member Function Documentation

◆ checkIfWraps()

bool biorbd::muscles::WrappingCylinder::checkIfWraps ( const NodeMusclePair pointsInGlobal,
NodeMusclePair pointsToWrap 
) const
protected

Check if a wrapper has to be done.

Parameters
pointsInGlobalThe position of the muscle pair in global reference frame
pointsToWrapThe points to wrap
Returns
If the wrapper has to be done

Definition at line 311 of file WrappingCylinder.cpp.

◆ computeLength()

biorbd::utils::Scalar biorbd::muscles::WrappingCylinder::computeLength ( const NodeMusclePair p) const
protected

Compute the muscle length on the cylinder.

Parameters
pthe muscle node pair
Returns
The muscle lengh on the cylinder

Definition at line 353 of file WrappingCylinder.cpp.

◆ DeepCopy() [1/2]

biorbd::muscles::WrappingCylinder biorbd::muscles::WrappingCylinder::DeepCopy ( ) const

Deep copy of the wrapping cylinder.

Returns
A deep copy of the wrapping cylinder

Definition at line 57 of file WrappingCylinder.cpp.

◆ DeepCopy() [2/2]

void biorbd::muscles::WrappingCylinder::DeepCopy ( const biorbd::muscles::WrappingCylinder other)

Deep copy of the wrapping cylinder in another wrapping cylinder.

Parameters
otherThe wrapping cylinder to copy

Definition at line 64 of file WrappingCylinder.cpp.

◆ diameter()

const biorbd::utils::Scalar & biorbd::muscles::WrappingCylinder::diameter ( ) const

Return the diameter of the cylinder.

Returns
The diameter of the cylinder

Definition at line 164 of file WrappingCylinder.cpp.

◆ findTangentToCircle()

void biorbd::muscles::WrappingCylinder::findTangentToCircle ( const biorbd::utils::Vector3d p,
biorbd::utils::Vector3d p_tan 
) const
protected

Find the two tangents of a point with a circle.

Parameters
pThe point
p_tanThe point tangent

Definition at line 185 of file WrappingCylinder.cpp.

◆ findVerticalNode()

bool biorbd::muscles::WrappingCylinder::findVerticalNode ( const NodeMusclePair pointsInGlobal,
NodeMusclePair pointsToWrap 
) const
protected

Find the height of both points.

Parameters
pointsInGlobalThe position of the muscle pair in global reference frame
pointsToWrapThe points to wrap
Returns
Return false if no wrap is needed

Definition at line 235 of file WrappingCylinder.cpp.

◆ length()

const biorbd::utils::Scalar & biorbd::muscles::WrappingCylinder::length ( ) const

Return the length of the cylinder.

Returns
The length of the cylinder

Definition at line 180 of file WrappingCylinder.cpp.

◆ radius()

biorbd::utils::Scalar biorbd::muscles::WrappingCylinder::radius ( ) const

Return the radius of the cylinder.

Returns
The radius of the cylinder

Definition at line 169 of file WrappingCylinder.cpp.

◆ RT()

const biorbd::utils::RotoTrans & biorbd::muscles::WrappingCylinder::RT ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q,
bool  updateKin = true 
)
virtual

Return the RotoTrans matrix of the cylinder.

Parameters
modelThe joint model
QThe generalized coordinates
updateKinIf the kinematics should be computed
Returns
The RotoTrans matrix of the cylinder

Implements biorbd::muscles::WrappingObject.

Definition at line 144 of file WrappingCylinder.cpp.

◆ selectTangents()

void biorbd::muscles::WrappingCylinder::selectTangents ( const NodeMusclePair p,
biorbd::utils::Vector3d p_tan 
) const
protected

Select between a set of nodes which ones to keep.

Parameters
pThe 2 muscles points
p_tanThe selected point

Definition at line 207 of file WrappingCylinder.cpp.

◆ setDiameter()

void biorbd::muscles::WrappingCylinder::setDiameter ( const biorbd::utils::Scalar &  val)

Set the diameter of the wrapping cylinder.

Parameters
valValue of the diameter to set

Definition at line 158 of file WrappingCylinder.cpp.

◆ setLength()

void biorbd::muscles::WrappingCylinder::setLength ( const biorbd::utils::Scalar &  val)

Set the length of the cylinder.

Parameters
valValue of the to set

Definition at line 174 of file WrappingCylinder.cpp.

◆ wrapPoints() [1/3]

void biorbd::muscles::WrappingCylinder::wrapPoints ( biorbd::rigidbody::Joints model,
const biorbd::rigidbody::GeneralizedCoordinates Q,
const biorbd::utils::Vector3d p1_bone,
const biorbd::utils::Vector3d p2_bone,
biorbd::utils::Vector3d p1,
biorbd::utils::Vector3d p2,
biorbd::utils::Scalar *  length = nullptr 
)
virtual

From the position of the cylinder, return the 2 locations where the muscle leaves the wrapping object.

Parameters
modelThe joint model
QThe generalized coordinates
p1_bone1st position of the muscle node
p2_bone2n position of the muscle node
p1The 1st position on the cylinder the muscle leave
p2The 2nd position on the cylinder the muscle leave
lengthLength of the muscle (ignored if no value is provided)

Implements biorbd::muscles::WrappingObject.

Definition at line 121 of file WrappingCylinder.cpp.

◆ wrapPoints() [2/3]

void biorbd::muscles::WrappingCylinder::wrapPoints ( biorbd::utils::Vector3d p1,
biorbd::utils::Vector3d p2,
biorbd::utils::Scalar *  length = nullptr 
)
virtual

Returns the previously computed 2 locations where the muscle leaves the wrapping object.

Parameters
p1The 1st position on the cylinder the muscle leave
p2The 2nd position on the cylinder the muscle leave
lengthLength of the muscle (ignored if no value is provided)

Implements biorbd::muscles::WrappingObject.

Definition at line 134 of file WrappingCylinder.cpp.

◆ wrapPoints() [3/3]

void biorbd::muscles::WrappingCylinder::wrapPoints ( const biorbd::utils::RotoTrans rt,
const biorbd::utils::Vector3d p1_bone,
const biorbd::utils::Vector3d p2_bone,
biorbd::utils::Vector3d p1,
biorbd::utils::Vector3d p2,
biorbd::utils::Scalar *  length = nullptr 
)
virtual

From the position of the cylinder, return the 2 locations where the muscle leaves the wrapping object.

Parameters
rtRotoTrans matrix of the cylinder
p1_bone1st position of the muscle node
p2_bone2n position of the muscle node
p1The 1st position on the cylinder the muscle leave
p2The 2nd position on the cylinder the muscle leave
lengthLength of the muscle (ignored if no value is provided)

Implements biorbd::muscles::WrappingObject.

Definition at line 76 of file WrappingCylinder.cpp.


The documentation for this class was generated from the following files: