SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CDynamicsSclSpatialMath.hpp
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 /*
5  * CDynamicsSclSpatialMath.hpp
6  *
7  * Created on: Jun 9, 2014
8  * Author: Nayan Singhal <singhalnayan91@gmail.com>
9  * Brains in Silicon Lab,
10  * Stanford University.
11  */
12 
13 #ifndef CDYNAMICSSCLSPATIALMATH_HPP_
14 #define CDYNAMICSSCLSPATIALMATH_HPP_
15 
16 
17 #include <scl/DataTypes.hpp>
18 #include <scl/data_structs/SGcModel.hpp>
19 #include <scl/data_structs/SRigidBodyDyn.hpp>
20 #include <scl/robot/data_structs/SRobot.hpp>
21 
22 #include <Eigen/Geometry>
23 #include <Eigen/Core>
24 
25 #include <stack>
26 #include <iostream>
27 
28 
29 namespace scl_ext
30 {
31  // ****************************************************
32  // Compute subspace motion and force constraint
33  // ****************************************************
34 
36  bool calculateForceSubspace(
37  Eigen::MatrixXd &arg_subspace,
39  Eigen::MatrixXd &ret_force_subspace);
40 
42  bool calculateTransformationAndSubspace(
43  Eigen::MatrixXd & ret_Xlink,
45  Eigen::MatrixXd & ret_subspace,
47  scl::sInt arg_joint_type,
49  scl::sFloat arg_q);
50 
52  bool calculateTransformationAndInertia(
54  scl::SGcModel *arg_gc_model);
55 
57  bool calculateOrderOfProcessing (
59  scl::SGcModel *arg_gc_model,
61  std::vector <std::string> &ret_processing_order );
62 
63  // ****************************************************
64  // Compute coordinate Transformation
65  // ****************************************************
66 
68  bool computeRotXAxis(
69  Eigen::MatrixXd & ret_transform,
71  scl::sFloat arg_q);
72 
74  bool computeRotYAxis(
75  Eigen::MatrixXd & ret_transform,
77  scl::sFloat arg_q);
78 
80  bool computeRotZAxis(
81  Eigen::MatrixXd & ret_transform,
83  scl::sFloat arg_q);
84 
86  bool computeTranslation(
87  Eigen::MatrixXd & ret_transform,
89  Eigen::Vector3d r);
90 
92  bool computeRotFromQuaternion(
93  Eigen::MatrixXd &ret_transform,
95  Eigen::Quaternion<scl::sFloat> arg_ori);
96 
98  bool computeCrossForVelocity(
99  Eigen::MatrixXd &ret_vcross,
101  Eigen::MatrixXd arg_spatial_velocity);
102 
104  bool calculateSpatialInertia(
105  scl::sSpatialXForm &spatial_inertia ,
107  Eigen::Matrix3d arg_inertia,
109  Eigen::Vector3d arg_com,
111  scl::sFloat arg_mass);
112 }
113 
114 #endif /* CDYNAMICSSCLSPATIALMATH_HPP_ */
Definition: SGcModel.hpp:53
Eigen::Matrix< sFloat, 6, 6 > sSpatialXForm
Typedef since we use this pretty commonly.
Definition: DataTypes.hpp:132
double sFloat
Definition: DataTypes.hpp:72
int sInt
Definition: DataTypes.hpp:64