Biorbd Release_1.13.0
Loading...
Searching...
No Matches
SpatialVector.cpp
1#define BIORBD_API_EXPORTS
2#include "Utils/SpatialVector.h"
3
4#include "Utils/Error.h"
5#include "Utils/String.h"
6#include "Utils/Vector3d.h"
7
8using namespace BIORBD_NAMESPACE;
9
11 : RigidBodyDynamics::Math::SpatialVector() {}
12
14 : RigidBodyDynamics::Math::SpatialVector(other) {}
15
17 const RigidBodyDynamics::Math::SpatialVector& other)
18 : RigidBodyDynamics::Math::SpatialVector(other) {}
19
23 : RigidBodyDynamics::Math::SpatialVector(
24 moment(0),
25 moment(1),
26 moment(2),
27 force(0),
28 force(1),
29 force(2)) {}
30
32 Scalar mx,
33 Scalar my,
34 Scalar mz,
35 Scalar fx,
36 Scalar fy,
37 Scalar fz)
38 : RigidBodyDynamics::Math::SpatialVector(mx, my, mz, fx, fy, fz) {}
39
40#ifdef BIORBD_USE_CASADI_MATH
41
42utils::SpatialVector::SpatialVector(const casadi::MX& v)
43 : RigidBodyDynamics::Math::SpatialVector(v) {}
44
45utils::SpatialVector::SpatialVector(const RBDLCasadiMath::MX_Xd_SubMatrix& m)
46 : RigidBodyDynamics::Math::SpatialVector(m) {}
47
48#endif
49
51 this->RigidBodyDynamics::Math::SpatialVector::operator=(other);
52}
53
54#ifdef BIORBD_USE_CASADI_MATH
55
57 const RBDLCasadiMath::MX_Xd_SubMatrix& other) {
58 this->RigidBodyDynamics::Math::SpatialVector::operator=(other);
59}
60
61void utils::SpatialVector::operator=(const casadi::MX& other) {
62 this->RigidBodyDynamics::Math::SpatialVector::operator=(other);
63}
64
65#endif
66
68 return utils::Vector3d((*this)(3), (*this)(4), (*this)(5));
69}
70
72 return utils::Vector3d((*this)(0), (*this)(1), (*this)(2));
73}
Wrapper of the Eigen::Matrix<double, 6, 1> or Casadi::MX(6, 1).
void operator=(const SpatialVector &other)
operator= For submatrices
SpatialVector()
Construct SpatialVector.
utils::Vector3d moment() const
Return the moment part of the vector (first three elements).
utils::Vector3d force() const
Return the force part of the vector (last three elements).
Wrapper around Eigen Vector3d and attach it to a parent.
Definition Vector3d.h:27