NASA Astrobee Robot Software  Astrobee Version:
Flight software for the Astrobee robots operating inside the International Space Station.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
types.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef TRAJ_OPT_BASIC_TYPES_H_
20 #define TRAJ_OPT_BASIC_TYPES_H_
21 
22 #include <Eigen/Geometry>
23 #include <Eigen/StdVector>
24 #include <vector>
25 
26 // This file is to define typdefs for all the eigen types as either float or
27 // double
28 // Add flag "-DTRAJ_OPT_USE_SINGLE_PRECISION" to compile the entire package with
29 // float,
30 // otherwise, we will default to use double
31 
32 namespace traj_opt {
33 
34 #ifndef TRAJ_OPT_USE_SINGLE_PRECISION
35 typedef double decimal_t;
36 #else
37 typedef float decimal_t;
38 #endif
39 
40 typedef Eigen::Matrix<decimal_t, 3, 1> Vec3;
41 typedef Eigen::Matrix<decimal_t, 4, 1> Vec4;
42 typedef Eigen::Matrix<decimal_t, 3, 3> Mat3;
43 typedef Eigen::Matrix<decimal_t, 4, 4> Mat4;
44 
45 typedef std::vector<Vec4, Eigen::aligned_allocator<Vec4>> Vec4Vec;
46 typedef std::vector<Vec3, Eigen::aligned_allocator<Vec3>> Vec3Vec;
47 typedef std::vector<Mat4, Eigen::aligned_allocator<Mat4>> Mat4Vec;
48 
49 typedef Eigen::Matrix<decimal_t, Eigen::Dynamic, 1> VecD;
50 typedef Eigen::Matrix<decimal_t, Eigen::Dynamic, 3> MatD3;
51 typedef Eigen::Matrix<decimal_t, Eigen::Dynamic, Eigen::Dynamic> MatD;
52 
53 typedef std::vector<VecD> VecDVec;
54 typedef std::vector<MatD> MatDVec;
55 
56 typedef Eigen::Quaternion<decimal_t> Quat;
57 } // namespace traj_opt
58 #endif // TRAJ_OPT_BASIC_TYPES_H_
traj_opt::MatD
Eigen::Matrix< decimal_t, Eigen::Dynamic, Eigen::Dynamic > MatD
Definition: types.h:51
traj_opt::Vec4Vec
std::vector< Vec4, Eigen::aligned_allocator< Vec4 > > Vec4Vec
Definition: types.h:45
traj_opt::Mat4
Eigen::Matrix< decimal_t, 4, 4 > Mat4
Definition: types.h:43
traj_opt::decimal_t
double decimal_t
Definition: types.h:35
traj_opt::Vec3
Eigen::Matrix< decimal_t, 3, 1 > Vec3
Definition: types.h:40
traj_opt::MatD3
Eigen::Matrix< decimal_t, Eigen::Dynamic, 3 > MatD3
Definition: types.h:50
traj_opt::Mat4Vec
std::vector< Mat4, Eigen::aligned_allocator< Mat4 > > Mat4Vec
Definition: types.h:47
traj_opt::MatDVec
std::vector< MatD > MatDVec
Definition: types.h:54
traj_opt::Vec3Vec
std::vector< Vec3, Eigen::aligned_allocator< Vec3 > > Vec3Vec
Definition: types.h:46
traj_opt
Definition: msg_traj.h:27
traj_opt::Vec4
Eigen::Matrix< decimal_t, 4, 1 > Vec4
Definition: types.h:41
traj_opt::Mat3
Eigen::Matrix< decimal_t, 3, 3 > Mat3
Definition: types.h:42
traj_opt::VecDVec
std::vector< VecD > VecDVec
Definition: types.h:53
traj_opt::VecD
Eigen::Matrix< decimal_t, Eigen::Dynamic, 1 > VecD
Definition: types.h:49
traj_opt::Quat
Eigen::Quaternion< decimal_t > Quat
Definition: types.h:56