Biorbd Release_1.13.0
Loading...
Searching...
No Matches
ModelReader.h
1#ifndef BIORBD_UTILS_READ_H
2#define BIORBD_UTILS_READ_H
3
4#include "biorbdConfig.h"
5
6#include <map>
7#include <stddef.h>
8#include <vector>
9
10namespace BIORBD_NAMESPACE {
11class Model;
12
13namespace rigidbody {
15class Mesh;
16} // namespace rigidbody
17
18namespace utils {
19class Path;
20class String;
21class Vector;
22class Vector3d;
23class Matrix3d;
24class SpatialVector;
25class RotoTrans;
26class IfStream;
27class Equation;
28} // namespace utils
29
33class BIORBD_API Reader {
34 public:
40 static Model readModelFile(const utils::Path &path);
41
47 static void readModelFile(const utils::Path &path, Model *model);
48
54 static std::vector<std::vector<utils::Vector3d>> readMarkerDataFile(
55 const utils::Path &path);
56
62 static std::vector<rigidbody::GeneralizedCoordinates> readQDataFile(
63 const utils::Path &path);
64
70 static std::vector<utils::Vector> readActivationDataFile(
71 const utils::Path &path);
72
78 static std::vector<utils::Vector> readTorqueDataFile(const utils::Path &path);
79
85 static std::vector<utils::Vector> readGroundReactionForceDataFile(
86 const utils::Path &path);
87
97 static void readViconForceFile(
98 const utils::Path &path,
99 std::vector<std::vector<size_t>> &frame,
100 std::vector<size_t> &frequency,
101 std::vector<std::vector<utils::Vector3d>> &force,
102 std::vector<std::vector<utils::Vector3d>> &moment,
103 std::vector<std::vector<utils::Vector3d>> &cop);
104
110 static std::vector<std::vector<utils::SpatialVector>> readViconForceFile(
111 const utils::String &path);
112
123 static std::vector<std::vector<utils::Vector3d>> readViconMarkerFile(
124 const utils::Path &path,
125 int nFramesToGet = -1);
126
141 static std::vector<std::vector<utils::Vector3d>> readViconMarkerFile(
142 const utils::Path &path,
143 std::vector<utils::String> &markOrder,
144 int nFramesToGet = -1);
145
152
158 static rigidbody::Mesh readMeshFilePly(const utils::Path &path);
159
165 static rigidbody::Mesh readMeshFileObj(const utils::Path &path);
166
167#ifdef MODULE_VTP_FILES_READER
173 static rigidbody::Mesh readMeshFileVtp(const utils::Path &path);
174#endif
175
181 static rigidbody::Mesh readMeshFileStl(const utils::Path &path);
182
183 protected:
190 static void readVector3d(
191 utils::IfStream &file,
192 const std::map<utils::Equation, double> &variable,
193 utils::Vector3d &vector);
194
201 static void readMatrix33(
202 utils::IfStream &file,
203 const std::map<utils::Equation, double> &variable,
204 utils::Matrix3d &matrix);
205
214 static void readRtMatrix(
215 utils::IfStream &file,
216 const std::map<utils::Equation, double> &variable,
217 bool RTinMatrix,
218 utils::RotoTrans &RT);
219};
220
221} // namespace BIORBD_NAMESPACE
222
223#endif // BIORBD_UTILS_READ_H
The actual musculoskeletal model that holds everything in biorbd.
Reader for bioMod files.
Definition ModelReader.h:33
static rigidbody::Mesh readMeshFileObj(const utils::Path &path)
Read a OBJ file containing the meshing of a segment.
static std::vector< std::vector< utils::Vector3d > > readMarkerDataFile(const utils::Path &path)
Read a bioMark file, containing markers data.
static void readVector3d(utils::IfStream &file, const std::map< utils::Equation, double > &variable, utils::Vector3d &vector)
Read a Vector 3d.
static void readRtMatrix(utils::IfStream &file, const std::map< utils::Equation, double > &variable, bool RTinMatrix, utils::RotoTrans &RT)
Read a RT matrix either in 4x4 format or Rot1233 seq Trans123 format.
static std::vector< utils::Vector > readTorqueDataFile(const utils::Path &path)
Read a bioTorque file containing generalized torques data.
static rigidbody::Mesh readMeshFileBiorbdSegments(const utils::Path &path)
Read a bioMesh file containing the meshing of a segment.
static void readMatrix33(utils::IfStream &file, const std::map< utils::Equation, double > &variable, utils::Matrix3d &matrix)
Read a Matrix 3x3.
static std::vector< std::vector< utils::Vector3d > > readViconMarkerFile(const utils::Path &path, int nFramesToGet=-1)
Read a Vicon ASCII marker file (CSV formated).
static std::vector< rigidbody::GeneralizedCoordinates > readQDataFile(const utils::Path &path)
Read a bioKin file, containing kinematics data.
static std::vector< utils::Vector > readGroundReactionForceDataFile(const utils::Path &path)
Read a bioGRF file containing ground reaction force (GRF) data.
static Model readModelFile(const utils::Path &path)
Create a biorbd model from a bioMod file.
static rigidbody::Mesh readMeshFileStl(const utils::Path &path)
Read a STL file containing the meshing of a segment.
static rigidbody::Mesh readMeshFilePly(const utils::Path &path)
Read a PLY file containing the meshing of a segment.
static void readViconForceFile(const utils::Path &path, std::vector< std::vector< size_t > > &frame, std::vector< size_t > &frequency, std::vector< std::vector< utils::Vector3d > > &force, std::vector< std::vector< utils::Vector3d > > &moment, std::vector< std::vector< utils::Vector3d > > &cop)
Read a Vicon ASCII force file.
static std::vector< utils::Vector > readActivationDataFile(const utils::Path &path)
Read a bioMus fine, containing muscle activations data.
A class that holds the geometry of a segment.
Definition Mesh.h:22
Strings that are to be interpreted as equation that can be evaluated.
Definition Equation.h:17
Wrapper for the an std::ifstream with increased capacities.
Definition IfStream.h:20
A wrapper for the Eigen::MatrixXd.
Definition Matrix3d.h:21
Collection of methods to manipulate path.
Definition Path.h:16
Homogenous matrix to describe translations and rotations simultaneously.
Definition RotoTrans.h:33
Wrapper of the Eigen::Matrix<double, 6, 1> or Casadi::MX(6, 1).
Wrapper around the std::string class with augmented functionality.
Definition String.h:18
Wrapper around Eigen Vector3d and attach it to a parent.
Definition Vector3d.h:27
Wrapper of the Eigen VectorXd.
Definition Vector.h:21