1#ifndef BIORBD_MUSCLES_WRAPPING_HALF_CYLINDER_H
2#define BIORBD_MUSCLES_WRAPPING_HALF_CYLINDER_H
4#include "biorbdConfig.h"
6#include "InternalForces/WrappingObject.h"
8namespace BIORBD_NAMESPACE {
9namespace internal_forces {
47 const utils::Scalar&
radius,
48 const utils::Scalar&
length);
60 const utils::Scalar&
radius,
61 const utils::Scalar&
length,
94 utils::Scalar*
length =
nullptr);
114 utils::Scalar*
length =
nullptr);
126 utils::Scalar*
length =
nullptr);
138 bool updateKin =
true);
144 void setRadius(
const utils::Scalar& val);
150 utils::Scalar
radius()
const;
162 void setLength(
const utils::Scalar& val);
168 const utils::Scalar&
length()
const;
185 std::shared_ptr<utils::Vector3d>
m_p1;
186 std::shared_ptr<utils::Vector3d>
m_p2;
216#ifndef BIORBD_USE_CASADI_MATH
236 std::shared_ptr<utils::Scalar>
239 std::shared_ptr<utils::RotoTrans>
242 std::shared_ptr<utils::Vector3d>
244 std::shared_ptr<utils::Vector3d>
246 std::shared_ptr<utils::Scalar>
Pair of 2 muscles points.
std::shared_ptr< utils::Vector3d > m_p1
Point 1.
NodeMusclePair(const utils::Vector3d &p1, const utils::Vector3d &p2)
Construct a node muscle pair.
std::shared_ptr< utils::Vector3d > m_p2
Point 2.
bool findVerticalNode(const NodeMusclePair &pointsInGlobal, NodeMusclePair &pointsToWrap) const
Find the height of both points.
std::shared_ptr< utils::Scalar > m_length
Length of the 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 o...
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.
WrappingHalfCylinder()
Construct a wrapping half cylinder.
std::shared_ptr< utils::Vector3d > m_p2Wrap
Second point of contact with the wrap.
void setLength(const utils::Scalar &val)
Set the length of the half cylinder.
utils::Scalar diameter() const
Return the diamter of the half cylinder.
WrappingHalfCylinder DeepCopy() const
Deep copy of the wrapping half cylinder.
const utils::Scalar & length() const
Return the length of the half cylinder.
bool checkIfWraps(const NodeMusclePair &pointsInGlobal, NodeMusclePair &pointsToWrap) const
Check if a wrapper has to be done.
std::shared_ptr< utils::Scalar > m_lengthAroundWrap
Length between p1 and p2.
std::shared_ptr< utils::Vector3d > m_p1Wrap
First point of contact with the wrap.
std::shared_ptr< utils::RotoTrans > m_RTtoParent
RotoTrans matrix with the parent.
std::shared_ptr< utils::Scalar > m_radius
Diameter of the half cylinder diametre du cylindre.
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.
utils::Scalar computeLength(const NodeMusclePair &p) const
Compute the muscle length on the half cylinder.
WrappingObject()
Construct a wrapping object.
Class GeneralizedCoordinates.
This is the core of the musculoskeletal model in biorbd.
const String & name() const
Return the name of the node.
Homogenous matrix to describe translations and rotations simultaneously.
Wrapper around the std::string class with augmented functionality.
Wrapper around Eigen Vector3d and attach it to a parent.
Vector3d()
Construct 3D vector.