SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
SRigidBodyDyn.hpp
1 /* This file is part of scl, a control and simulation library
2 for robots and biomechanical models.
3 
4 scl is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 3 of the License, or (at your option) any later version.
8 
9 Alternatively, you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
13 
14 scl is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU Lesser General Public
20 License and a copy of the GNU General Public License along with
21 scl. If not, see <http://www.gnu.org/licenses/>.
22 */
23 /* \file SRigidBodyDyn.hpp
24  *
25  * Created on: Oct 7, 2013
26  *
27  * Copyright (C) 2013
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef SRIGIDBODYDYN_HPP_
33 #define SRIGIDBODYDYN_HPP_
34 
35 #include <scl/DataTypes.hpp>
36 #include <scl/data_structs/SRigidBody.hpp>
37 
38 #include <Eigen/Core>
39 
40 namespace scl
41 {
56  class SRigidBodyDyn : public SObject
57  {
58  public:
59  // Eigen requires redefining the new operator for classes that contain fixed size Eigen member-data.
60  // See http://eigen.tuxfamily.org/dox/StructHavingEigenMembers.html
61  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
62 
65 
70  Eigen::MatrixXd J_com_;
71 
72  //****************************************************************************************
73  // For using normal vectors
74  // NOTE : This will soon be obsolete!!!
75 
79  Eigen::Affine3d T_o_lnk_;
80 
84  Eigen::Affine3d T_lnk_;
85 
90 
91  //****************************************************************************************
92  // For using spatial vectors (and multi-dof joints)
94  Eigen::VectorXd sp_q_T_, sp_dq_T_;
95 
98 
100  Eigen::MatrixXd spatial_velocity_;
101 
103  Eigen::MatrixXd spatial_acceleration_;
104 
106  Eigen::MatrixXd spatial_force_;
107 
108 
111 
116 
121 
122  Eigen::MatrixXd sp_S_joint_;
123  Eigen::MatrixXd sp_Sorth_joint_;
124 
125  //****************************************************************************************
126  //Robot Branching Structure data:
127  // (Spanning) Tree structure information: (Enables manual tree parsing)
128  std::string parent_name_;
129  SRigidBodyDyn* parent_addr_;
130  std::vector<SRigidBodyDyn*> child_addrs_;
131 
132  // Graph structure information: (Enables manual graph parsing)
133  std::vector<SRigidBodyDyn*> gr_parent_names_;
134  std::vector<SRigidBodyDyn*> gr_parent_addrs_;
135  std::vector<SRigidBodyDyn*> gr_child_addrs_;
136 
137  //****************************************************************************************
139  SRigidBodyDyn() : SObject("SRigidBodyDyn"),
140  link_ds_(S_NULL), q_T_(std::numeric_limits<sFloat>::quiet_NaN()),
141  parent_name_(""), parent_addr_(S_NULL) {}
142  };
143 
144 } /* namespace scl */
145 #endif /* SRIGIDBODYDYN_HPP_ */
Eigen::MatrixXd J_com_
Definition: SRigidBodyDyn.hpp:70
sSpatialXForm sp_inertia_
Definition: SRigidBodyDyn.hpp:97
Eigen::MatrixXd spatial_acceleration_
Definition: SRigidBodyDyn.hpp:103
Eigen::Affine3d T_o_lnk_
Definition: SRigidBodyDyn.hpp:79
sutil::CMappedList< std::string, sSpatialXForm > sp_X_joint_
Definition: SRigidBodyDyn.hpp:120
Eigen::VectorXd sp_q_T_
Definition: SRigidBodyDyn.hpp:94
Definition: SRigidBody.hpp:94
sSpatialXForm sp_X_within_link_
Definition: SRigidBodyDyn.hpp:110
SRigidBodyDyn()
Definition: SRigidBodyDyn.hpp:139
Eigen::MatrixXd sp_S_joint_
Column vectors correspond to spatial directions of motion.
Definition: SRigidBodyDyn.hpp:122
Eigen::MatrixXd spatial_force_
Definition: SRigidBodyDyn.hpp:106
sSpatialXForm sp_X_o_lnk_
Definition: SRigidBodyDyn.hpp:115
Eigen::Affine3d T_lnk_
Definition: SRigidBodyDyn.hpp:84
EIGEN_MAKE_ALIGNED_OPERATOR_NEW const SRigidBody * link_ds_
Definition: SRigidBodyDyn.hpp:64
sFloat q_T_
Definition: SRigidBodyDyn.hpp:89
Eigen::Matrix< sFloat, 6, 6 > sSpatialXForm
Typedef since we use this pretty commonly.
Definition: DataTypes.hpp:132
Eigen::MatrixXd sp_Sorth_joint_
Column vectors correspond to spatial directions of constraint.
Definition: SRigidBodyDyn.hpp:123
double sFloat
Definition: DataTypes.hpp:72
Eigen::MatrixXd spatial_velocity_
Definition: SRigidBodyDyn.hpp:100
Definition: SObject.hpp:43
Definition: SRigidBodyDyn.hpp:56