MotionVector.cpp
Go to the documentation of this file.
1 /*
2  * RDL - Robot Dynamics Library
3  * Copyright (c) 2017 Jordan Lack <jlack1987@gmail.com>
4  *
5  * Licensed under the zlib license. See LICENSE for more details.
6  */
7 
9 
10 namespace RobotDynamics
11 {
12 namespace Math
13 {
15 {
16  double v_wx = v.wx();
17  double v_wy = v.wy();
18  double v_wz = v.wz();
19  double v_vx = v.vx();
20  double v_vy = v.vy();
21  double v_vz = v.vz();
22 
23  double wx = this->wx();
24  double wy = this->wy();
25  double wz = this->wz();
26  double vx = this->vx();
27  double vy = this->vy();
28  double vz = this->vz();
29 
30  MotionVector m(-wz * v_wy + wy * v_wz, wz * v_wx - wx * v_wz, -wy * v_wx + wx * v_wy, -vz * v_wy + vy * v_wz - wz * v_vy + wy * v_vz,
31  vz * v_wx - vx * v_wz + wz * v_vx - wx * v_vz, -vy * v_wx + vx * v_wy - wy * v_vx + wx * v_vy);
32 
33  return m;
34 }
35 
37 {
38  double v_mx = v.mx();
39  double v_my = v.my();
40  double v_mz = v.mz();
41  double v_fx = v.fx();
42  double v_fy = v.fy();
43  double v_fz = v.fz();
44 
45  double wx = this->wx();
46  double wy = this->wy();
47  double wz = this->wz();
48  double vx = this->vx();
49  double vy = this->vy();
50  double vz = this->vz();
51 
52  ForceVector f(-wz * v_my + wy * v_mz - vz * v_fy + vy * v_fz, wz * v_mx - wx * v_mz + vz * v_fx - vx * v_fz, -wy * v_mx + wx * v_my - vy * v_fx + vx * v_fy,
53  -wz * v_fy + wy * v_fz, wz * v_fx - wx * v_fz, -wy * v_fx + wx * v_fy);
54 
55  return f;
56 }
57 } // namespace Math
58 } // namespace RobotDynamics
MotionVector cross(const MotionVector &v)
See V. Duindum thesis p.25 for an explanation of what operator is. It is also in Featherstone p...
EIGEN_STRONG_INLINE double & vz()
Get a reference to the linear-z component.
A ForceVector is a SpatialVector containing 3 moments and 3 linear forces.
Definition: ForceVector.hpp:27
EIGEN_STRONG_INLINE double & fy()
Get reference to y-linear component.
EIGEN_STRONG_INLINE double & wx()
Get a reference to the angular-x component.
EIGEN_STRONG_INLINE double & wy()
Get a reference to the angular-y component.
EIGEN_STRONG_INLINE double & fx()
Get reference to x-linear component.
EIGEN_STRONG_INLINE double & vx()
Get a reference to the linear-x component.
EIGEN_STRONG_INLINE double & fz()
Get reference to z-linear component.
EIGEN_STRONG_INLINE double & my()
Get reference to y-angular component.
EIGEN_STRONG_INLINE double & mz()
Get reference to z-angular component.
EIGEN_STRONG_INLINE double & wz()
Get a reference to the angular-z component.
EIGEN_STRONG_INLINE double & vy()
Get a reference to the linear-y component.
EIGEN_STRONG_INLINE double & mx()
Get reference to x-angular component.
Definition: ForceVector.hpp:96
Namespace for all structures of the RobotDynamics library.
Definition: Body.h:21


rdl_dynamics
Author(s):
autogenerated on Tue Apr 20 2021 02:25:27