1#define BIORBD_API_EXPORTS
2#include "RigidBody/RotoTransNodes.h"
6#include <rbdl/Kinematics.h>
8#include "RigidBody/GeneralizedCoordinates.h"
9#include "RigidBody/Joints.h"
10#include "RigidBody/Segment.h"
11#include "Utils/Matrix.h"
12#include "Utils/Rotation.h"
13#include "Utils/RotoTransNode.h"
14#include "Utils/String.h"
16using namespace BIORBD_NAMESPACE;
19 :
m_RTs(std::make_shared<std::vector<utils::RotoTransNode>>()) {
39 for (
size_t i = 0; i < other.
m_RTs->size(); ++i) {
65 std::vector<utils::RotoTransNode> pos;
66 for (
size_t i = 0; i <
nbRTs();
68 if (!
RT(i).parent().compare(segmentName)) {
82 std::vector<utils::RotoTransNode> pos;
83 for (
size_t i = 0; i <
nbRTs(); ++i) {
84 pos.push_back(
RT(Q, i, updateKin));
113 std::vector<utils::RotoTransNode> pos;
114 for (
size_t i = 0; i <
nbRTs();
116 if (!((*
m_RTs)[i]).parent().compare(name)) {
117 pos.push_back(
RT(Q, i, updateKin));
131 std::vector<utils::Matrix> G;
133 for (
size_t idx = 0; idx <
nbRTs(); ++idx) {
137 size_t id = model.GetBodyId(node.
parent().c_str());
152 std::vector<utils::String> names;
153 for (
size_t i = 0; i <
nbRTs(); ++i) {
Class GeneralizedCoordinates.
This is the core of the musculoskeletal model in biorbd.
void CalcMatRotJacobian(const GeneralizedCoordinates &Q, size_t segmentIdx, const utils::Matrix3d &rotation, utils::Matrix &G, bool updateKin)
Calculate the jacobian matrix of a rotation matrix.
Segment & segment(size_t idx)
Get a segment of index idx.
utils::RotoTrans globalJCS(const GeneralizedCoordinates &Q, const utils::String &name, bool updateKin=true)
Return the joint coordinate system (JCS) for the segment in global reference frame at a given Q.
Hold a set of RotoTransNodes.
std::vector< utils::Matrix > RTsJacobian(const GeneralizedCoordinates &Q, bool updateKin=true)
Return the jacobian of the RTs.
const utils::RotoTransNode & RT(size_t idx)
Return the RTs of a specified index.
size_t size() const
Return the number of RTs in the set.
size_t nbRTs() const
Return the number of RTs in the set.
RotoTransNodes DeepCopy() const
Deep copy of the RTs data.
void addRT()
Add a new RT to the set.
std::vector< utils::String > RTsNames()
Return the names of the RTs.
std::shared_ptr< std::vector< utils::RotoTransNode > > m_RTs
All the RTs.
std::vector< utils::RotoTransNode > segmentRTs(const GeneralizedCoordinates &Q, size_t idx, bool updateKin=true)
Return all the RTs on a specified segment.
const std::vector< utils::RotoTransNode > & RTs() const
Return all the RTs in the local reference of the segment.
virtual ~RotoTransNodes()
Destroy the class properly.
RotoTransNodes()
Construct RT set.
virtual void clear()
Return to an internal state similar to initial declaration.
A wrapper for the Eigen::MatrixXd.
const String & name() const
Return the name of the node.
const String & parent() const
Return the parent name of the node.
A RotoTrans which is attached to a segment.
Rotation rot() const
Return the rotation matrix.
Wrapper around the std::string class with augmented functionality.