7 #ifndef SPATIAL_AB_INERTIA
8 #error This class is not to be included by the user directly. Use SPATIAL_AB_INERTIAd.h or SPATIAL_AB_INERTIAf.h instead.
33 std::vector<SACCEL>&
inverse_mult(
const std::vector<SFORCE>& w, std::vector<SACCEL>& result)
const;
48 SPATIAL_AB_INERTIA operator/(REAL scalar)
const {
return operator*((REAL) 1.0/scalar); }
51 std::vector<SFORCE>&
mult(
const std::vector<SACCEL>& s, std::vector<SFORCE>& result)
const;
54 std::vector<SMOMENTUM>&
mult(
const std::vector<SVELOCITY>& s, std::vector<SMOMENTUM>& result)
const;
59 static SPATIAL_AB_INERTIA from_matrix(
const Mat& m, boost::shared_ptr<const POSE3> pose = boost::shared_ptr<const POSE3>())
64 if (m.rows() != 6 || m.columns() != 6)
65 throw MissizeException();
67 m.get_sub_mat(3, 6, 3, 6, I.
H);
68 m.get_sub_mat(0, 3, 0, 3, I.
M);
72 m.get_sub_mat(3, 6, 0, 3, I.
J);
77 static SPATIAL_AB_INERTIA from_matrix(
const Mat& m, boost::shared_ptr<POSE3> pose = boost::shared_ptr<POSE3>())
79 return from_matrix(m, boost::const_pointer_cast<const POSE3>(pose));
83 Mat& to_matrix(Mat& m)
const
87 m.set_sub_mat(0, 3, M);
88 m.set_sub_mat(3, 3, H);
89 m.set_sub_mat(3, 0, J);
103 boost::shared_ptr<const POSE3>
pose;
107 void inverse_mult_spatial(
const SFORCE& w,
SVECTOR6& result)
const;
SPATIAL_AB_INERTIA & operator=(const SPATIAL_RB_INERTIA &source)
Copies a spatial RB inertia to this one.
Definition: SpatialABInertia.cpp:57
SPATIAL_AB_INERTIA & operator-=(const SPATIAL_AB_INERTIA &m)
Subtracts m from this in place.
Definition: SpatialABInertia.cpp:287
A spatial (six dimensional) momentum.
Definition: SMomentum.h:12
SPATIAL_AB_INERTIA operator-() const
Returns the negation of this matrix.
Definition: SpatialABInertia.cpp:204
boost::shared_ptr< const POSE3 > pose
The pose that this inertia is defined in.
Definition: SpatialABInertia.h:103
MATRIX3 M
The upper right matrix.
Definition: SpatialABInertia.h:100
M & get_sub_mat(unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end, M &m, Transposition trans=eNoTranspose) const
Gets the specified sub matrix.
Definition: Matrix3.h:263
A spatial velocity (a twist)
Definition: SVelocity.h:15
SPATIAL_RB_INERTIA to_rb_inertia() const
Converts this matrix to a spatial RB inertia.
Definition: SpatialABInertia.cpp:71
A rigid body pose.
Definition: Pose3.h:15
A 6-dimensional floating-point vector for use with spatial algebra.
Definition: SVector6.h:22
A 6x6 spatial algebra matrix typically used for dynamics calculations.
Definition: SpatialABInertia.h:20
A 6x6 spatial algebra matrix used for dynamics calculations.
Definition: SpatialRBInertia.h:25
A spatial (six dimensional) acceleration.
Definition: SAccel.h:14
SACCEL inverse_mult(const SFORCE &f) const
Multiplies the inverse of this spatial AB inertia by a force to yield an acceleration.
Definition: SpatialABInertia.cpp:301
SFORCE mult(const SACCEL &s) const
Multiplies this matrix by an acceleration and returns the result in a force.
Definition: SpatialABInertia.cpp:131
A spatial force (a wrench)
Definition: SForce.h:14
SPATIAL_AB_INERTIA operator+(const SPATIAL_RB_INERTIA &m) const
Adds a spatial articulated body inertia and a spatial rigid body inertia.
Definition: SpatialABInertia.cpp:215
void transpose()
Sets this matrix to its transpose.
Definition: Matrix3.cpp:522
MATRIX3 J
The lower left matrix.
Definition: SpatialABInertia.h:97
void set_zero()
Creates a zero matrix.
Definition: SpatialABInertia.cpp:82
SPATIAL_AB_INERTIA & operator+=(const SPATIAL_AB_INERTIA &m)
Adds m to this in place.
Definition: SpatialABInertia.cpp:273
A 3x3 matrix that may be used for orientation, inertia tensors, etc.
Definition: Matrix3.h:20
MATRIX3 H
The lower right hand matrix 'H' (and transpose of upper left matrix)
Definition: SpatialABInertia.h:94