Biorbd Release_1.13.0
Loading...
Searching...
No Matches
BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder Class Reference

Half cylinder of infinite length (the length only affect the graphical representation) object that makes the muscle to wrap around. More...

#include <WrappingHalfCylinder.h>

Inheritance diagram for BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder:
BIORBD_NAMESPACE::internal_forces::WrappingObject BIORBD_NAMESPACE::utils::Vector3d BIORBD_NAMESPACE::utils::Node

Classes

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

std::shared_ptr< utils::Scalar > m_radius
 Diameter of the half cylinder diametre du cylindre.
std::shared_ptr< utils::Scalar > m_length
 Length of the half cylinder.
std::shared_ptr< utils::RotoTrans > m_RTtoParent
 RotoTrans matrix with the parent.
std::shared_ptr< utils::Vector3d > m_p1Wrap
 First point of contact with the wrap.
std::shared_ptr< utils::Vector3d > m_p2Wrap
 Second point of contact with the wrap.
std::shared_ptr< utils::Scalar > m_lengthAroundWrap
 Length between p1 and p2.
Protected Attributes inherited from BIORBD_NAMESPACE::internal_forces::WrappingObject
std::shared_ptr< utils::RotoTrans > m_RT
 RotoTrans matrix of the wrapping object.
Protected Attributes inherited from BIORBD_NAMESPACE::utils::Node
std::shared_ptr< String > m_name
 The name of the node.
std::shared_ptr< String > m_parentName
 The parent name of the node.
std::shared_ptr< NODE_TYPE > m_typeOfNode
 The type of the node.

Detailed Description

Half cylinder of infinite length (the length only affect the graphical representation) object that makes the muscle to wrap around.

Watch out, due to high computational cost, the CasADi backend always assume contact between the muscle and cylinder. This will create discrepancies between the Eigen and the CasADi backend

Definition at line 18 of file WrappingHalfCylinder.h.

Constructor & Destructor Documentation

◆ WrappingHalfCylinder() [1/5]

internal_forces::WrappingHalfCylinder::WrappingHalfCylinder ( )

Construct a wrapping half cylinder.

Definition at line 16 of file WrappingHalfCylinder.cpp.

◆ WrappingHalfCylinder() [2/5]

internal_forces::WrappingHalfCylinder::WrappingHalfCylinder ( const utils::Vector3d & other)

Construct a wrapping half cylinder.

Parameters
otherThe position of the wrapping half cylinder

Definition at line 27 of file WrappingHalfCylinder.cpp.

◆ WrappingHalfCylinder() [3/5]

internal_forces::WrappingHalfCylinder::WrappingHalfCylinder ( const utils::Vector3d * other)

Construct a wrapping half cylinder.

Parameters
otherThe position of the wrapping half cylinder

Definition at line 41 of file WrappingHalfCylinder.cpp.

◆ WrappingHalfCylinder() [4/5]

internal_forces::WrappingHalfCylinder::WrappingHalfCylinder ( const utils::RotoTrans & rt,
const utils::Scalar & radius,
const utils::Scalar & length )

Construct a wrapping half cylinder.

Parameters
rtRotoTrans matrix of the origin of the half cylinder
radiusThe radius of the half cylinder
lengthThe Length of the half cylinder

Definition at line 55 of file WrappingHalfCylinder.cpp.

◆ WrappingHalfCylinder() [5/5]

internal_forces::WrappingHalfCylinder::WrappingHalfCylinder ( const utils::RotoTrans & rt,
const utils::Scalar & radius,
const utils::Scalar & length,
const utils::String & name,
const utils::String & parentName )

Construct a wrapping half cylinder.

Parameters
rtRotoTrans matrix
radiusThe radius of the half cylinder
lengthThe length of the half cylinder
nameThe name of the half cylinder
parentNameThe parent name segment

Definition at line 69 of file WrappingHalfCylinder.cpp.

Member Function Documentation

◆ checkIfWraps()

bool internal_forces::WrappingHalfCylinder::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 344 of file WrappingHalfCylinder.cpp.

◆ computeLength()

utils::Scalar internal_forces::WrappingHalfCylinder::computeLength ( const NodeMusclePair & p) const
protected

Compute the muscle length on the half cylinder.

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

Definition at line 386 of file WrappingHalfCylinder.cpp.

◆ DeepCopy() [1/2]

internal_forces::WrappingHalfCylinder internal_forces::WrappingHalfCylinder::DeepCopy ( ) const

Deep copy of the wrapping half cylinder.

Returns
A deep copy of the wrapping half cylinder

Definition at line 86 of file WrappingHalfCylinder.cpp.

◆ DeepCopy() [2/2]

void internal_forces::WrappingHalfCylinder::DeepCopy ( const WrappingHalfCylinder & other)

Deep copy of the wrapping half cylinder in another wrapping half cylinder.

Parameters
otherThe wrapping half cylinder to copy

Definition at line 92 of file WrappingHalfCylinder.cpp.

◆ diameter()

utils::Scalar internal_forces::WrappingHalfCylinder::diameter ( ) const

Return the diamter of the half cylinder.

Returns
The diamter of the half cylinder

Definition at line 204 of file WrappingHalfCylinder.cpp.

◆ findTangentToCircle()

void internal_forces::WrappingHalfCylinder::findTangentToCircle ( const utils::Vector3d & p,
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 217 of file WrappingHalfCylinder.cpp.

◆ findVerticalNode()

bool internal_forces::WrappingHalfCylinder::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 261 of file WrappingHalfCylinder.cpp.

◆ length()

const utils::Scalar & internal_forces::WrappingHalfCylinder::length ( ) const

Return the length of the half cylinder.

Returns
The length of the half cylinder

Definition at line 213 of file WrappingHalfCylinder.cpp.

◆ radius()

utils::Scalar internal_forces::WrappingHalfCylinder::radius ( ) const

Return the radius of the half cylinder.

Returns
The radius of the half cylinder

Definition at line 200 of file WrappingHalfCylinder.cpp.

◆ RT()

const utils::RotoTrans & internal_forces::WrappingHalfCylinder::RT ( rigidbody::Joints & model,
const rigidbody::GeneralizedCoordinates & Q,
bool updateKin = true )
virtual

Return the RotoTrans matrix of the half cylinder.

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

Implements BIORBD_NAMESPACE::internal_forces::WrappingObject.

Definition at line 186 of file WrappingHalfCylinder.cpp.

◆ selectTangents()

void internal_forces::WrappingHalfCylinder::selectTangents ( const NodeMusclePair & p,
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 247 of file WrappingHalfCylinder.cpp.

◆ setLength()

void internal_forces::WrappingHalfCylinder::setLength ( const utils::Scalar & val)

Set the length of the half cylinder.

Parameters
valValue of the to set

Definition at line 208 of file WrappingHalfCylinder.cpp.

◆ setRadius()

void internal_forces::WrappingHalfCylinder::setRadius ( const utils::Scalar & val)

Set the diameter of the wrapping half cylinder.

Parameters
valValue of the diameter to set

Definition at line 195 of file WrappingHalfCylinder.cpp.

◆ wrapPoints() [1/3]

void internal_forces::WrappingHalfCylinder::wrapPoints ( const utils::RotoTrans & rt,
const utils::Vector3d & p1_bone,
const utils::Vector3d & p2_bone,
utils::Vector3d & p1,
utils::Vector3d & p2,
utils::Scalar * length = nullptr )
virtual

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

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

Implements BIORBD_NAMESPACE::internal_forces::WrappingObject.

Definition at line 103 of file WrappingHalfCylinder.cpp.

◆ wrapPoints() [2/3]

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

From the position of the half 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 half cylinder the muscle leave
p2The 2nd position on the half cylinder the muscle leave
lengthLength of the muscle (ignored if no value is provided)

Implements BIORBD_NAMESPACE::internal_forces::WrappingObject.

Definition at line 161 of file WrappingHalfCylinder.cpp.

◆ wrapPoints() [3/3]

void internal_forces::WrappingHalfCylinder::wrapPoints ( utils::Vector3d & p1,
utils::Vector3d & p2,
utils::Scalar * length = nullptr )
virtual

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

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

Implements BIORBD_NAMESPACE::internal_forces::WrappingObject.

Definition at line 175 of file WrappingHalfCylinder.cpp.

Member Data Documentation

◆ m_length

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder::m_length
protected

Length of the half cylinder.

Definition at line 238 of file WrappingHalfCylinder.h.

◆ m_lengthAroundWrap

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder::m_lengthAroundWrap
protected

Length between p1 and p2.

Definition at line 247 of file WrappingHalfCylinder.h.

◆ m_p1Wrap

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder::m_p1Wrap
protected

First point of contact with the wrap.

Definition at line 243 of file WrappingHalfCylinder.h.

◆ m_p2Wrap

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder::m_p2Wrap
protected

Second point of contact with the wrap.

Definition at line 245 of file WrappingHalfCylinder.h.

◆ m_radius

std::shared_ptr<utils::Scalar> BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder::m_radius
protected

Diameter of the half cylinder diametre du cylindre.

Definition at line 237 of file WrappingHalfCylinder.h.

◆ m_RTtoParent

std::shared_ptr<utils::RotoTrans> BIORBD_NAMESPACE::internal_forces::WrappingHalfCylinder::m_RTtoParent
protected

RotoTrans matrix with the parent.

Definition at line 240 of file WrappingHalfCylinder.h.


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