SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
DataTypes.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 DataTypes.hpp
24  *
25  * Created on: May 13, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef DATA_TYPES_HPP_
33 #define DATA_TYPES_HPP_
34 
35 #include <Eigen/Core>
36 
37 #include <string>
38 
39 // Check GCC
40 #if __GNUC__
41 #if __x86_64__ || __ppc64__
42 #define SCL_64_BIT
43 #else
44 #define SCL_32_BIT
45 #endif
46 #endif
47 
48 namespace scl
49 {
53 
54  typedef bool sBool;
56  typedef char sChar;
57 #ifdef SCL_64_BIT
58 
59  typedef unsigned int sUInt;
60 #else
61  typedef unsigned long sUInt;
62 #endif
63 
64  typedef int sInt;
66  typedef long long sLongLong;
67 
72  typedef double sFloat;
73 
75  struct sFloat3
76  { sFloat data_[3]; };
77 
80  typedef double sClock;
81 
83  #define S_NULL 0
84 
86  #define SCL_INTEGRATION_TSTEP 0.001
87 
96  #define SCL_MINIMUM_POSITION_CHANGE 0.0001
97 
99  struct sString2
100  { std::string data_[2]; };
101 
105 
110  typedef enum {
111  JOINT_TYPE_PRISMATIC_X = 0,
112  JOINT_TYPE_PRISMATIC_Y = 1,
113  JOINT_TYPE_PRISMATIC_Z = 2,
114  JOINT_TYPE_REVOLUTE_X = 4,
115  JOINT_TYPE_REVOLUTE_Y = 5,
116  JOINT_TYPE_REVOLUTE_Z = 6,
117  JOINT_TYPE_SPHERICAL = 8,
118  JOINT_TYPE_SPLINE = 9,
119  JOINT_TYPE_NOTASSIGNED = -1
120  }EJointType;
121 
122  typedef enum {
123  RENDER_TYPE_SPHERE = 0,
124  RENDER_TYPE_CYLINDER = 1,
125  RENDER_TYPE_ELLIPSOID = 2
126  }ERenderType;
127 
131  typedef Eigen::Matrix<sFloat, 6, 1> sSpatialVector;
132  typedef Eigen::Matrix<sFloat, 6, 6> sSpatialXForm;
133 
136 }
137 
141 namespace Eigen
142 {
143  typedef Matrix<scl::sFloat, 6, 1> Vector6d;
144  typedef Matrix<scl::sFloat, 6, 6> Matrix6d;
145 }
146 
147 #endif /* DATA_TYPES_HPP_ */
double sClock
Definition: DataTypes.hpp:80
Eigen::Matrix< sFloat, 6, 1 > sSpatialVector
Typedef (possibly clearer to read).
Definition: DataTypes.hpp:131
bool sBool
Definition: DataTypes.hpp:54
Definition: DataTypes.hpp:99
Definition: DataTypes.hpp:75
long long sLongLong
Definition: DataTypes.hpp:66
Eigen::Matrix< sFloat, 6, 6 > sSpatialXForm
Typedef since we use this pretty commonly.
Definition: DataTypes.hpp:132
EJointType
Definition: DataTypes.hpp:110
double sFloat
Definition: DataTypes.hpp:72
int sInt
Definition: DataTypes.hpp:64
char sChar
Definition: DataTypes.hpp:56