├── qp_matrices
├── tuning
│ ├── R.txt
│ ├── u_constr.txt
│ ├── Qlin.txt
│ ├── Qrate_Qdiff.txt
│ ├── Qstate_rate.txt
│ ├── Q.txt
│ ├── Qf.txt
│ ├── x_constr.txt
│ └── Qerr.txt
└── planningModelMatrices
│ ├── Blinear.txt
│ └── Alinear.txt
├── msg
├── sensor.msg
├── cmd.msg
├── cmdDrone.msg
├── input.msg
├── linearMatrices.msg
├── highLevelBelief.msg
├── state.msg
├── lowLevelLog.msg
├── optSol.msg
├── goalSetAndState.msg
├── valFunCnst.msg
└── stateDrone.msg
├── .gitignore
├── drone_qp_matrices
└── qp_matrices
│ ├── tuning
│ ├── R.txt
│ ├── Qlin.txt
│ ├── Qrate_Qdiff.txt
│ ├── u_constr.txt
│ ├── Q.txt
│ ├── Qf.txt
│ ├── Qstate_rate.txt
│ ├── Qerr.txt
│ └── x_constr.txt
│ └── planningModelMatrices
│ ├── Blinear.txt
│ └── Alinear.txt
├── srv
└── ui.srv
├── include
├── Eigen_embedded
│ ├── Eigen
│ ├── src
│ │ ├── misc
│ │ │ ├── lapacke.h
│ │ │ ├── lapacke_mangling.h
│ │ │ ├── RealSvd2x2.h
│ │ │ ├── Kernel.h
│ │ │ └── Image.h
│ │ ├── Core
│ │ │ ├── util
│ │ │ │ ├── NonMPL2.h
│ │ │ │ ├── ReenableStupidWarnings.h
│ │ │ │ └── DisableStupidWarnings.h
│ │ │ ├── functors
│ │ │ │ └── TernaryFunctors.h
│ │ │ ├── DiagonalProduct.h
│ │ │ ├── arch
│ │ │ │ ├── AVX
│ │ │ │ │ └── TypeCasting.h
│ │ │ │ ├── Default
│ │ │ │ │ ├── Settings.h
│ │ │ │ │ └── ConjHelper.h
│ │ │ │ ├── SSE
│ │ │ │ │ └── TypeCasting.h
│ │ │ │ ├── CUDA
│ │ │ │ │ └── MathFunctions.h
│ │ │ │ └── NEON
│ │ │ │ │ └── MathFunctions.h
│ │ │ ├── SelfCwiseBinaryOp.h
│ │ │ ├── Swap.h
│ │ │ ├── Assign.h
│ │ │ ├── VectorBlock.h
│ │ │ ├── MathFunctionsImpl.h
│ │ │ ├── NestByValue.h
│ │ │ ├── Inverse.h
│ │ │ └── NoAlias.h
│ │ ├── SparseCore
│ │ │ ├── SparseFuzzy.h
│ │ │ ├── SparseRedux.h
│ │ │ ├── MappedSparseMatrix.h
│ │ │ ├── SparseDot.h
│ │ │ └── SparseTranspose.h
│ │ ├── SparseLU
│ │ │ ├── SparseLU_Utils.h
│ │ │ ├── SparseLU_relax_snode.h
│ │ │ └── SparseLU_copy_to_ucol.h
│ │ ├── StlSupport
│ │ │ └── details.h
│ │ ├── QR
│ │ │ └── HouseholderQR_LAPACKE.h
│ │ ├── plugins
│ │ │ └── MatrixCwiseUnaryOps.h
│ │ ├── LU
│ │ │ ├── Determinant.h
│ │ │ └── PartialPivLU_LAPACKE.h
│ │ ├── Eigenvalues
│ │ │ └── RealSchur_LAPACKE.h
│ │ └── Geometry
│ │ │ └── EulerAngles.h
│ ├── Dense
│ ├── CMakeLists.txt
│ ├── StdList
│ ├── StdDeque
│ ├── StdVector
│ ├── Householder
│ ├── Sparse
│ ├── Jacobi
│ ├── QtAlignedMalloc
│ ├── MetisSupport
│ ├── PardisoSupport
│ ├── SPQRSupport
│ ├── SparseQR
│ ├── Cholesky
│ ├── QR
│ ├── UmfPackSupport
│ ├── SparseCholesky
│ ├── LU
│ ├── SVD
│ ├── PaStiXSupport
│ ├── SparseLU
│ ├── Eigenvalues
│ ├── CholmodSupport
│ ├── IterativeLinearSolvers
│ ├── Geometry
│ ├── SuperLUSupport
│ ├── SparseCore
│ └── OrderingMethods
├── segway_sim
│ ├── sensor_node.hpp
│ ├── controller_node.hpp
│ ├── low_level_node.hpp
│ ├── ekf.h
│ ├── keyboard.hpp
│ ├── manual_teleop_node.hpp
│ ├── integrator_node.hpp
│ ├── mpc_node.hpp
│ ├── mpc_drone_node.hpp
│ └── CyberTimer.hpp
└── Eigen_embedded.h
├── URDF
├── Frame.stl
├── WheelL.stl
├── WheelR.stl
└── cyberpod.urdf
├── plotUtils
├── prob.gif
├── test.npy
├── barrier.npy
├── compTime.gif
├── obstBelief.npy
└── plotGif.py
├── src
├── workspace
│ └── .metadata
│ │ └── .plugins
│ │ ├── org.eclipse.core.resources
│ │ └── .root
│ │ │ └── .indexes
│ │ │ └── properties.version
│ │ └── org.eclipse.core.runtime
│ │ └── .settings
│ │ ├── org.eclipse.ui.prefs
│ │ ├── org.eclipse.core.resources.prefs
│ │ └── com.digi.xctung.prefs
├── pyFun
│ ├── MOMDP.pyc
│ ├── utils.pyc
│ ├── __pycache__
│ │ ├── MOMDP.cpython-37.pyc
│ │ └── utils.cpython-37.pyc
│ ├── pyMOMDP.yml
│ └── mainMulti.py
├── keyboard.cpp
├── ekf.cpp
├── ekf_node.cpp
├── sensor_node.cpp
├── controller_node.cpp
└── manual_teleop_node.cpp
├── workspace
└── .metadata
│ ├── .plugins
│ └── org.eclipse.core.runtime
│ │ └── .settings
│ │ ├── org.eclipse.ui.prefs
│ │ └── com.digi.xctung.prefs
│ └── .log
├── launch
├── start_momdp.launch
├── README.md
├── highLevelDrone.launch
├── highLevelMulti.launch
├── highLevelMulti_hw.launch
├── manual_teleop.launch
├── rviz.launch
├── drone_hardware.launch
├── mpcDrone.launch
├── rvizMultiAgent.launch
├── hardware_mpc.launch
├── moving_obstacle.launch
└── main.launch
├── package.xml
├── LICENSE
└── README.md
/qp_matrices/tuning/R.txt:
--------------------------------------------------------------------------------
1 | .1 .1
2 |
--------------------------------------------------------------------------------
/qp_matrices/tuning/u_constr.txt:
--------------------------------------------------------------------------------
1 | 15 15
--------------------------------------------------------------------------------
/qp_matrices/tuning/Qlin.txt:
--------------------------------------------------------------------------------
1 | 0 0 0 0 0 0 0
2 |
--------------------------------------------------------------------------------
/qp_matrices/tuning/Qrate_Qdiff.txt:
--------------------------------------------------------------------------------
1 | .1 1.0
2 |
--------------------------------------------------------------------------------
/qp_matrices/tuning/Qstate_rate.txt:
--------------------------------------------------------------------------------
1 | 0 0 0 0 0 0 0
--------------------------------------------------------------------------------
/msg/sensor.msg:
--------------------------------------------------------------------------------
1 | uint32 time
2 | float32[] data
3 |
--------------------------------------------------------------------------------
/qp_matrices/tuning/Q.txt:
--------------------------------------------------------------------------------
1 | 0.1 0.1 0.0 0.0 10.0 1.0 10.0
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **.pyc
2 | *.pyc
3 | *.obj
4 | *.pkl
5 | *.xmi
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/R.txt:
--------------------------------------------------------------------------------
1 | 0.1 0.1
2 |
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/Qlin.txt:
--------------------------------------------------------------------------------
1 | 0 0 0 0 0 0 0
2 |
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/Qrate_Qdiff.txt:
--------------------------------------------------------------------------------
1 | 0.1 0
2 |
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/u_constr.txt:
--------------------------------------------------------------------------------
1 | 10 10
2 |
--------------------------------------------------------------------------------
/msg/cmd.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64[] cmd
--------------------------------------------------------------------------------
/qp_matrices/tuning/Qf.txt:
--------------------------------------------------------------------------------
1 | 100.0 100.0 0.0 1.0 100.0 100.0 200.0
--------------------------------------------------------------------------------
/srv/ui.srv:
--------------------------------------------------------------------------------
1 | uint8 cmd
2 | float64[] data
3 | ---
4 | bool result
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/Q.txt:
--------------------------------------------------------------------------------
1 | 100 100 2000 2000
2 |
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/Qf.txt:
--------------------------------------------------------------------------------
1 | 1000 1000 1000 1000
2 |
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/Qstate_rate.txt:
--------------------------------------------------------------------------------
1 | 0 0 0 0 0 0 0
--------------------------------------------------------------------------------
/msg/cmdDrone.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64[4] vDes
--------------------------------------------------------------------------------
/msg/input.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64[2] inputVec
--------------------------------------------------------------------------------
/qp_matrices/tuning/x_constr.txt:
--------------------------------------------------------------------------------
1 | 10 10 60.2832 5 31.416 6.2832 31.416
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/Qerr.txt:
--------------------------------------------------------------------------------
1 | 0.0 0.0 0.0 0.0 0.0 0.0 0.0
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/tuning/x_constr.txt:
--------------------------------------------------------------------------------
1 | 100 100 1.5 1.5
2 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Eigen:
--------------------------------------------------------------------------------
1 | #include "Dense"
2 | #include "Sparse"
3 |
--------------------------------------------------------------------------------
/URDF/Frame.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/URDF/Frame.stl
--------------------------------------------------------------------------------
/URDF/WheelL.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/URDF/WheelL.stl
--------------------------------------------------------------------------------
/URDF/WheelR.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/URDF/WheelR.stl
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/planningModelMatrices/Blinear.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0 0
3 | 1 0
4 | 0 1
5 |
--------------------------------------------------------------------------------
/plotUtils/prob.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/plotUtils/prob.gif
--------------------------------------------------------------------------------
/plotUtils/test.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/plotUtils/test.npy
--------------------------------------------------------------------------------
/src/workspace/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plotUtils/barrier.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/plotUtils/barrier.npy
--------------------------------------------------------------------------------
/src/pyFun/MOMDP.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/src/pyFun/MOMDP.pyc
--------------------------------------------------------------------------------
/src/pyFun/utils.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/src/pyFun/utils.pyc
--------------------------------------------------------------------------------
/plotUtils/compTime.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/plotUtils/compTime.gif
--------------------------------------------------------------------------------
/drone_qp_matrices/qp_matrices/planningModelMatrices/Alinear.txt:
--------------------------------------------------------------------------------
1 | 0 0 1 0
2 | 0 0 0 1
3 | 0 0 0 0
4 | 0 0 0 0
5 |
--------------------------------------------------------------------------------
/plotUtils/obstBelief.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/plotUtils/obstBelief.npy
--------------------------------------------------------------------------------
/msg/linearMatrices.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64[49] Alinear
4 | float64[14] Blinear
5 | float64[7] Clinear
--------------------------------------------------------------------------------
/qp_matrices/planningModelMatrices/Blinear.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0 0
3 | 0 0
4 | 0.20025 0.20025
5 | 0 0
6 | 0 0
7 | -0.54235 -0.54235
8 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/misc/lapacke.h:
--------------------------------------------------------------------------------
1 | Unexpected error. File contents could not be restored from local history during undo/redo.
--------------------------------------------------------------------------------
/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | showIntro=false
3 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/util/NonMPL2.h:
--------------------------------------------------------------------------------
1 | #ifdef EIGEN_MPL2_ONLY
2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode
3 | #endif
4 |
--------------------------------------------------------------------------------
/src/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | showIntro=false
3 |
--------------------------------------------------------------------------------
/src/pyFun/__pycache__/MOMDP.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/src/pyFun/__pycache__/MOMDP.cpython-37.pyc
--------------------------------------------------------------------------------
/src/pyFun/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrewSingletary/segway_sim/HEAD/src/pyFun/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/src/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | version=1
3 |
--------------------------------------------------------------------------------
/qp_matrices/tuning/Qerr.txt:
--------------------------------------------------------------------------------
1 | 0.0 0.0 0.0 0.0 0.0 0.0 0.0
2 | 100.0 100.0 100.0 100.0 100.0 100.0 100.0
3 | 1000.0 1000.0 1000.0 100.0 100.0 100.0 100.0
--------------------------------------------------------------------------------
/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.digi.xctung.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | generalVerificationDate=1605656078722
3 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Dense:
--------------------------------------------------------------------------------
1 | #include "Core"
2 | #include "LU"
3 | #include "Cholesky"
4 | #include "QR"
5 | #include "SVD"
6 | #include "Geometry"
7 | #include "Eigenvalues"
8 |
--------------------------------------------------------------------------------
/msg/highLevelBelief.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64 probMiss
4 | float64[40] bt
5 | float64[20] prob
6 | float64[2] targetPosDrone
7 | float64[2] targetPosSegway
8 |
--------------------------------------------------------------------------------
/qp_matrices/planningModelMatrices/Alinear.txt:
--------------------------------------------------------------------------------
1 | 0 0 0 0 0 0 0
2 | 0 0 0 0 0 0 0
3 | 0 0 0 0 1 0 0
4 | 0 0 0 -2.3341 0 -2.6158 0
5 | 0 0 0 0 0 0 0
6 | 0 0 0 0 0 0 1
7 | 0 0 0 6.3216 0 18.331 0
--------------------------------------------------------------------------------
/msg/state.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64 time
4 | float64 x
5 | float64 y
6 | float64 theta
7 | float64 v
8 | float64 thetaDot
9 | float64 psi
10 | float64 psiDot
11 | float64[7] stateVec
--------------------------------------------------------------------------------
/include/segway_sim/sensor_node.hpp:
--------------------------------------------------------------------------------
1 | #ifndef SENSOR_NODE_H
2 | #define SENSOR_NODE_H
3 |
4 | #include "ros/ros.h"
5 | #include "segway_sim/state.h"
6 | #include "segway_sim/sensor.h"
7 | #include "segway_sim/common.hpp"
8 |
9 | #endif
--------------------------------------------------------------------------------
/msg/lowLevelLog.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64 time
4 | float64[7] X
5 | float64[7] Xn
6 | float64[2] uMPC
7 | float64[2] uCBF
8 | float64[2] uTot
9 | float64 flagQP
10 | float64 V
11 | float64 h
12 | float64 QPtime
13 |
--------------------------------------------------------------------------------
/msg/optSol.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64 time
4 | float64[367] optimalSolution
5 | float64 solverFlag
6 | float64 solverTime
7 | float64 x
8 | float64 y
9 | float64[7] xCurr
10 | float64[7] x_IC
11 | float64 delay_ms
12 | float64 contPlan
--------------------------------------------------------------------------------
/msg/goalSetAndState.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64 x
4 | float64 y
5 | float64 xmin
6 | float64 xmax
7 | float64 ymin
8 | float64 ymax
9 | float64 highLevTime
10 | float64 term_xmin
11 | float64 term_xmax
12 | float64 term_ymin
13 | float64 term_ymax
--------------------------------------------------------------------------------
/src/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.digi.xctung.prefs:
--------------------------------------------------------------------------------
1 | addModulePortName=/dev/ttyUSB1
2 | eclipse.preferences.version=1
3 | generalRatingRemainingTime=281637
4 | generalSurveyRemainingTime=1494866
5 | generalVerificationDate=1606156610991
6 |
--------------------------------------------------------------------------------
/launch/start_momdp.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/launch/README.md:
--------------------------------------------------------------------------------
1 | To run single agent in sim:
2 | 1) roslaunch segway_sim main.launch
3 | 2) rosservice call /segway_sim/integrator/ui "cmd: 1"
4 |
5 | To run multi-agent in sim:
6 | 1) roslaunch segway_sim mpcDrone.launch
7 | 2) roslaunch segway_sim mainMultiAgent.launch
8 | 3) rosservice call /segway_sim/integrator/ui "cmd: 1"
9 |
--------------------------------------------------------------------------------
/msg/valFunCnst.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64 x1
4 | float64 y1
5 | float64 c1
6 | float64 x2
7 | float64 y2
8 | float64 c2
9 | float64 x3
10 | float64 y3
11 | float64 c3
12 | float64 xmin
13 | float64 xmax
14 | float64 ymin
15 | float64 ymax
16 | float64 highLevTime
17 | float64 term_xmin
18 | float64 term_xmax
19 | float64 term_ymin
20 | float64 term_ymax
21 |
--------------------------------------------------------------------------------
/include/segway_sim/controller_node.hpp:
--------------------------------------------------------------------------------
1 | #ifndef CONTROLLER_NODE_H
2 | #define CONTROLLER_NODE_H
3 |
4 | #include "ros/ros.h"
5 | #include "segway_sim/common.hpp"
6 | #include "segway_sim/input.h"
7 | #include "segway_sim/state.h"
8 | #include "segway_sim/cmd.h"
9 | #include "visualization_msgs/Marker.h"
10 |
11 | enum class STATUS : uint8_t
12 | {
13 | FAILURE = 0,
14 | RUNNING = 1
15 | };
16 |
17 | #endif
--------------------------------------------------------------------------------
/msg/stateDrone.msg:
--------------------------------------------------------------------------------
1 | uint8 status
2 | Header header
3 | float64 time
4 | float64 x
5 | float64 y
6 | float64 z
7 | float64 qw
8 | float64 qx
9 | float64 qy
10 | float64 qz
11 | float64 vbx
12 | float64 vby
13 | float64 vbz
14 | float64 omegax
15 | float64 omegay
16 | float64 omegaz
17 | float64 omega1
18 | float64 omega2
19 | float64 omega3
20 | float64 omega4
21 | float64 vx
22 | float64 vy
23 | float64 vz
24 |
--------------------------------------------------------------------------------
/launch/highLevelDrone.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/launch/highLevelMulti.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/launch/highLevelMulti_hw.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/launch/manual_teleop.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/launch/rviz.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/misc/lapacke_mangling.h:
--------------------------------------------------------------------------------
1 | #ifndef LAPACK_HEADER_INCLUDED
2 | #define LAPACK_HEADER_INCLUDED
3 |
4 | #ifndef LAPACK_GLOBAL
5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_)
6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER)
8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME
9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE)
10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname
11 | #else
12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
13 | #endif
14 | #endif
15 |
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/include/segway_sim/low_level_node.hpp:
--------------------------------------------------------------------------------
1 | #ifndef LOW_LEVEL_NODE_H
2 | #define LOW_LEVEL_NODE_H
3 |
4 | #include "ros/ros.h"
5 | #include "segway_sim/cmd.h"
6 | #include "segway_sim/input.h"
7 | #include "segway_sim/state.h"
8 | #include "segway_sim/common.hpp"
9 | #include "segway_sim/linearMatrices.h"
10 | #include "segway_sim/lowLevelLog.h"
11 | #include "segway_sim/optSol.h"
12 | #include
13 |
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | #endif
--------------------------------------------------------------------------------
/include/segway_sim/ekf.h:
--------------------------------------------------------------------------------
1 | #ifndef EKF_H
2 | #define EKF_H
3 |
4 | #include "dynamics_ekf.h"
5 | #include
6 |
7 | class EKF
8 | {
9 | public:
10 | // Methods
11 | EKF(const std::vector &Q,
12 | const std::vector &R);
13 |
14 | void init(const std::vector &x0,
15 | const std::vector &P0vec);
16 |
17 | void update(const std::vector &U,
18 | const std::vector &M,
19 | const double dt);
20 |
21 | // Attributes
22 | std::vector x_t_;
23 | std::vector P_t_;
24 | const std::vector Q_;
25 | const std::vector R_;
26 | uint32_t initialized = 0;
27 | };
28 |
29 | #endif
--------------------------------------------------------------------------------
/include/segway_sim/keyboard.hpp:
--------------------------------------------------------------------------------
1 | #ifndef KEYBOARD_H
2 | #define KEYBOARD_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | struct keyboard_state
11 | {
12 | signed short keys[KEY_CNT];
13 | };
14 |
15 | class cKeyboard
16 | {
17 | public:
18 | pthread_t thread;
19 | bool active;
20 | int keyboard_fd;
21 | input_event *keyboard_ev;
22 | keyboard_state *keyboard_st;
23 | char name[256];
24 |
25 | protected:
26 | public:
27 | cKeyboard(const char* dev);
28 | ~cKeyboard();
29 | static void* loop(void* obj);
30 | void readEv();
31 | short getKeyState(short key);
32 | };
33 |
34 | #endif
--------------------------------------------------------------------------------
/include/segway_sim/manual_teleop_node.hpp:
--------------------------------------------------------------------------------
1 | #ifndef MANUAL_TELEOP_NODE_H
2 | #define MANUAL_TELEOP_NODE_H
3 |
4 | #include "ros/ros.h"
5 | #include "segway_sim/input.h"
6 | #include "segway_sim/state.h"
7 | #include "segway_sim/cmd.h"
8 | #include "segway_sim/common.hpp"
9 | #include "segway_sim/keyboard.hpp"
10 |
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | enum class STATUS : uint8_t
18 | {
19 | FAILURE = 0,
20 | RUNNING = 1
21 | };
22 |
23 | std::map moveBindings
24 | {
25 | {'w', { 1., 0.}},
26 | {'s', {-1., 0.}},
27 | {'a', { 0., 1.}},
28 | {'d', { 0.,-1.}},
29 | };
30 |
31 | #endif
--------------------------------------------------------------------------------
/launch/drone_hardware.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/functors/TernaryFunctors.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2016 Eugene Brevdo
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_TERNARY_FUNCTORS_H
11 | #define EIGEN_TERNARY_FUNCTORS_H
12 |
13 | namespace Eigen {
14 |
15 | namespace internal {
16 |
17 | //---------- associative ternary functors ----------
18 |
19 |
20 |
21 | } // end namespace internal
22 |
23 | } // end namespace Eigen
24 |
25 | #endif // EIGEN_TERNARY_FUNCTORS_H
26 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include(RegexUtils)
2 | test_escape_string_as_regex()
3 |
4 | file(GLOB Eigen_directory_files "*")
5 |
6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
7 |
8 | foreach(f ${Eigen_directory_files})
9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src")
10 | list(APPEND Eigen_directory_files_to_install ${f})
11 | endif()
12 | endforeach(f ${Eigen_directory_files})
13 |
14 | install(FILES
15 | ${Eigen_directory_files_to_install}
16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel
17 | )
18 |
19 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h")
20 |
--------------------------------------------------------------------------------
/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | segway_sim
5 | 0.1.0
6 | The segway_sim package
7 |
8 | Drew
9 |
10 | MIT
11 |
12 | catkin
13 | roscpp
14 | pcl_conversions
15 | pcl_ros
16 | ambercortex_ros
17 |
18 | std_msgs
19 | sensor_msgs
20 | geometry_msgs
21 | visualization_msgs
22 | nav_msgs
23 | message_generation
24 | tf
25 | message_runtime
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/StdList:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009 Hauke Heibel
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_STDLIST_MODULE_H
11 | #define EIGEN_STDLIST_MODULE_H
12 |
13 | #include "Core"
14 | #include
15 |
16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
17 |
18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...)
19 |
20 | #else
21 |
22 | #include "src/StlSupport/StdList.h"
23 |
24 | #endif
25 |
26 | #endif // EIGEN_STDLIST_MODULE_H
27 |
--------------------------------------------------------------------------------
/include/segway_sim/integrator_node.hpp:
--------------------------------------------------------------------------------
1 | #ifndef INTEGRATOR_NODE_H
2 | #define INTEGRATOR_NODE_H
3 |
4 | #include "ros/ros.h"
5 | #include "std_msgs/String.h"
6 | #include "std_msgs/Float64MultiArray.h"
7 | #include "segway_sim/input.h"
8 | #include "segway_sim/state.h"
9 | #include "segway_sim/ui.h"
10 | #include "segway_sim/common.hpp"
11 | #include "segway_sim/dynamics.hpp"
12 |
13 | #include
14 |
15 | #include
16 |
17 | using namespace boost::numeric::odeint;
18 | typedef std::vector state_t;
19 | typedef runge_kutta4 stepper_t;
20 |
21 | enum class STATUS : uint8_t
22 | {
23 | FAILURE = 0,
24 | STOPPED = 1,
25 | RUNNING = 2
26 | };
27 |
28 | enum class CMD : uint8_t
29 | {
30 | STOP = 0,
31 | START = 1,
32 | PAUSE = 2,
33 | REPOSITION = 3,
34 | RESET = 4
35 | };
36 |
37 | #endif
--------------------------------------------------------------------------------
/include/Eigen_embedded/StdDeque:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009 Gael Guennebaud
5 | // Copyright (C) 2009 Hauke Heibel
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_STDDEQUE_MODULE_H
12 | #define EIGEN_STDDEQUE_MODULE_H
13 |
14 | #include "Core"
15 | #include
16 |
17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
18 |
19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...)
20 |
21 | #else
22 |
23 | #include "src/StlSupport/StdDeque.h"
24 |
25 | #endif
26 |
27 | #endif // EIGEN_STDDEQUE_MODULE_H
28 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/StdVector:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009 Gael Guennebaud
5 | // Copyright (C) 2009 Hauke Heibel
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_STDVECTOR_MODULE_H
12 | #define EIGEN_STDVECTOR_MODULE_H
13 |
14 | #include "Core"
15 | #include
16 |
17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */
18 |
19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...)
20 |
21 | #else
22 |
23 | #include "src/StlSupport/StdVector.h"
24 |
25 | #endif
26 |
27 | #endif // EIGEN_STDVECTOR_MODULE_H
28 |
--------------------------------------------------------------------------------
/launch/mpcDrone.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/util/ReenableStupidWarnings.h:
--------------------------------------------------------------------------------
1 | #ifdef EIGEN_WARNINGS_DISABLED
2 | #undef EIGEN_WARNINGS_DISABLED
3 |
4 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
5 | #ifdef _MSC_VER
6 | #pragma warning( pop )
7 | #elif defined __INTEL_COMPILER
8 | #pragma warning pop
9 | #elif defined __clang__
10 | #pragma clang diagnostic pop
11 | #elif defined __GNUC__ && __GNUC__>=6
12 | #pragma GCC diagnostic pop
13 | #endif
14 |
15 | #if defined __NVCC__
16 | // Don't reenable the diagnostic messages, as it turns out these messages need
17 | // to be disabled at the point of the template instantiation (i.e the user code)
18 | // otherwise they'll be triggered by nvcc.
19 | // #pragma diag_default code_is_unreachable
20 | // #pragma diag_default initialization_not_reachable
21 | // #pragma diag_default 2651
22 | // #pragma diag_default 2653
23 | #endif
24 |
25 | #endif
26 |
27 | #endif // EIGEN_WARNINGS_DISABLED
28 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Householder:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H
9 | #define EIGEN_HOUSEHOLDER_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup Householder_Module Householder module
16 | * This module provides Householder transformations.
17 | *
18 | * \code
19 | * #include
20 | * \endcode
21 | */
22 |
23 | #include "src/Householder/Householder.h"
24 | #include "src/Householder/HouseholderSequence.h"
25 | #include "src/Householder/BlockHouseholder.h"
26 |
27 | #include "src/Core/util/ReenableStupidWarnings.h"
28 |
29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H
30 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
31 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Sparse:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SPARSE_MODULE_H
9 | #define EIGEN_SPARSE_MODULE_H
10 |
11 | /** \defgroup Sparse_Module Sparse meta-module
12 | *
13 | * Meta-module including all related modules:
14 | * - \ref SparseCore_Module
15 | * - \ref OrderingMethods_Module
16 | * - \ref SparseCholesky_Module
17 | * - \ref SparseLU_Module
18 | * - \ref SparseQR_Module
19 | * - \ref IterativeLinearSolvers_Module
20 | *
21 | \code
22 | #include
23 | \endcode
24 | */
25 |
26 | #include "SparseCore"
27 | #include "OrderingMethods"
28 | #ifndef EIGEN_MPL2_ONLY
29 | #include "SparseCholesky"
30 | #endif
31 | #include "SparseLU"
32 | #include "SparseQR"
33 | #include "IterativeLinearSolvers"
34 |
35 | #endif // EIGEN_SPARSE_MODULE_H
36 |
37 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Jacobi:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_JACOBI_MODULE_H
9 | #define EIGEN_JACOBI_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup Jacobi_Module Jacobi module
16 | * This module provides Jacobi and Givens rotations.
17 | *
18 | * \code
19 | * #include
20 | * \endcode
21 | *
22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation:
23 | * - MatrixBase::applyOnTheLeft()
24 | * - MatrixBase::applyOnTheRight().
25 | */
26 |
27 | #include "src/Jacobi/Jacobi.h"
28 |
29 | #include "src/Core/util/ReenableStupidWarnings.h"
30 |
31 | #endif // EIGEN_JACOBI_MODULE_H
32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
33 |
34 |
--------------------------------------------------------------------------------
/launch/rvizMultiAgent.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/DiagonalProduct.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008 Gael Guennebaud
5 | // Copyright (C) 2007-2009 Benoit Jacob
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_DIAGONALPRODUCT_H
12 | #define EIGEN_DIAGONALPRODUCT_H
13 |
14 | namespace Eigen {
15 |
16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal.
17 | */
18 | template
19 | template
20 | inline const Product
21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const
22 | {
23 | return Product(derived(),a_diagonal.derived());
24 | }
25 |
26 | } // end namespace Eigen
27 |
28 | #endif // EIGEN_DIAGONALPRODUCT_H
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 DrewSingletary
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/QtAlignedMalloc:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_QTMALLOC_MODULE_H
9 | #define EIGEN_QTMALLOC_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
14 |
15 | #include "src/Core/util/DisableStupidWarnings.h"
16 |
17 | void *qMalloc(std::size_t size)
18 | {
19 | return Eigen::internal::aligned_malloc(size);
20 | }
21 |
22 | void qFree(void *ptr)
23 | {
24 | Eigen::internal::aligned_free(ptr);
25 | }
26 |
27 | void *qRealloc(void *ptr, std::size_t size)
28 | {
29 | void* newPtr = Eigen::internal::aligned_malloc(size);
30 | std::memcpy(newPtr, ptr, size);
31 | Eigen::internal::aligned_free(ptr);
32 | return newPtr;
33 | }
34 |
35 | #include "src/Core/util/ReenableStupidWarnings.h"
36 |
37 | #endif
38 |
39 | #endif // EIGEN_QTMALLOC_MODULE_H
40 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
41 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/MetisSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_METISSUPPORT_MODULE_H
9 | #define EIGEN_METISSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | extern "C" {
16 | #include
17 | }
18 |
19 |
20 | /** \ingroup Support_modules
21 | * \defgroup MetisSupport_Module MetisSupport module
22 | *
23 | * \code
24 | * #include
25 | * \endcode
26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis).
27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink
28 | */
29 |
30 |
31 | #include "src/MetisSupport/MetisSupport.h"
32 |
33 | #include "src/Core/util/ReenableStupidWarnings.h"
34 |
35 | #endif // EIGEN_METISSUPPORT_MODULE_H
36 |
--------------------------------------------------------------------------------
/src/keyboard.cpp:
--------------------------------------------------------------------------------
1 | #include "segway_sim/keyboard.hpp"
2 |
3 | cKeyboard::cKeyboard(const char* dev)
4 | {
5 | active = false;
6 | keyboard_fd = 0;
7 | keyboard_ev = new input_event();
8 | keyboard_st = new keyboard_state();
9 | keyboard_fd = open(dev, O_RDONLY);
10 | if (keyboard_fd > 0) {
11 | ioctl(keyboard_fd, EVIOCGNAME(256), name);
12 | active = true;
13 | pthread_create(&thread, 0, &cKeyboard::loop, this);
14 | }
15 | }
16 |
17 | cKeyboard::~cKeyboard()
18 | {
19 | if (keyboard_fd > 0) {
20 | active = false;
21 | pthread_cancel(thread);
22 | close(keyboard_fd);
23 | }
24 | delete keyboard_st;
25 | delete keyboard_ev;
26 | keyboard_fd = 0;
27 | }
28 |
29 | void* cKeyboard::loop(void *obj)
30 | {
31 | while (reinterpret_cast(obj)->active) reinterpret_cast(obj)->readEv();
32 | }
33 |
34 | void cKeyboard::readEv()
35 | {
36 | int bytes = read(keyboard_fd, keyboard_ev, sizeof(*keyboard_ev));
37 | if (bytes > 0) {
38 | if (keyboard_ev->type & EV_KEY) {
39 | keyboard_st->keys[keyboard_ev->code] = keyboard_ev->value;
40 | }
41 | }
42 | }
43 |
44 | short cKeyboard::getKeyState(short key)
45 | {
46 | return keyboard_st->keys[key];
47 | }
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/SparseCore/SparseFuzzy.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008-2014 Gael Guennebaud
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_SPARSE_FUZZY_H
11 | #define EIGEN_SPARSE_FUZZY_H
12 |
13 | namespace Eigen {
14 |
15 | template
16 | template
17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const
18 | {
19 | const typename internal::nested_eval::type actualA(derived());
20 | typename internal::conditional::type,
22 | const PlainObject>::type actualB(other.derived());
23 |
24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm());
25 | }
26 |
27 | } // end namespace Eigen
28 |
29 | #endif // EIGEN_SPARSE_FUZZY_H
30 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/PardisoSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H
9 | #define EIGEN_PARDISOSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include
16 |
17 | /** \ingroup Support_modules
18 | * \defgroup PardisoSupport_Module PardisoSupport module
19 | *
20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers.
21 | *
22 | * \code
23 | * #include
24 | * \endcode
25 | *
26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies.
27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration.
28 | *
29 | */
30 |
31 | #include "src/PardisoSupport/PardisoSupport.h"
32 |
33 | #include "src/Core/util/ReenableStupidWarnings.h"
34 |
35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H
36 |
--------------------------------------------------------------------------------
/workspace/.metadata/.log:
--------------------------------------------------------------------------------
1 | !SESSION 2020-11-17 15:34:36.398 -----------------------------------------------
2 | eclipse.buildId=unknown
3 | java.version=1.8.0_131
4 | java.vendor=Oracle Corporation
5 | BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
6 | Framework arguments: -clearPersistedState
7 | Command-line arguments: -os linux -ws gtk -arch x86_64 -clearPersistedState
8 |
9 | !ENTRY org.eclipse.ui 2 2 2020-11-17 15:34:38.485
10 | !MESSAGE Perspective with name 'Configuration perspective' and id 'com.digi.xctung.perspectives.configurationPerspective' has been made into a local copy
11 |
12 | !ENTRY org.eclipse.ui 2 2 2020-11-17 15:34:38.513
13 | !MESSAGE Invalid preference category path: org.eclipse.equinox.internal.p2.ui.sdk.ProvisioningPreferencePage (bundle: org.eclipse.equinox.p2.ui.sdk.scheduler, page: org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdatesPreferencePage)
14 |
15 | !ENTRY org.eclipse.equinox.p2.repository 2 0 2020-11-17 15:34:44.457
16 | !MESSAGE Server returned lastModified <= 0 for ftp://ftp1.digi.com/support/XCTU-NG/java_18/repository/content.xml
17 |
18 | !ENTRY org.eclipse.ui 2 2 2020-11-17 15:34:58.972
19 | !MESSAGE Perspective with name 'Consoles perspective' and id 'com.digi.xctung.perspectives.consolesPerspective' has been made into a local copy
20 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/SPQRSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H
9 | #define EIGEN_SPQRSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include "SuiteSparseQR.hpp"
16 |
17 | /** \ingroup Support_modules
18 | * \defgroup SPQRSupport_Module SuiteSparseQR module
19 | *
20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package.
21 | *
22 | * \code
23 | * #include
24 | * \endcode
25 | *
26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...).
27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules
28 | *
29 | */
30 |
31 | #include "src/CholmodSupport/CholmodSupport.h"
32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h"
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/SparseQR:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SPARSEQR_MODULE_H
9 | #define EIGEN_SPARSEQR_MODULE_H
10 |
11 | #include "SparseCore"
12 | #include "OrderingMethods"
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup SparseQR_Module SparseQR module
16 | * \brief Provides QR decomposition for sparse matrices
17 | *
18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition.
19 | * The columns of the input matrix should be reordered to limit the fill-in during the
20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end.
21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list
22 | * of built-in and external ordering methods.
23 | *
24 | * \code
25 | * #include
26 | * \endcode
27 | *
28 | *
29 | */
30 |
31 | #include "OrderingMethods"
32 | #include "src/SparseCore/SparseColEtree.h"
33 | #include "src/SparseQR/SparseQR.h"
34 |
35 | #include "src/Core/util/ReenableStupidWarnings.h"
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Cholesky:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_CHOLESKY_MODULE_H
9 | #define EIGEN_CHOLESKY_MODULE_H
10 |
11 | #include "Core"
12 | #include "Jacobi"
13 |
14 | #include "src/Core/util/DisableStupidWarnings.h"
15 |
16 | /** \defgroup Cholesky_Module Cholesky module
17 | *
18 | *
19 | *
20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
21 | * Those decompositions are also accessible via the following methods:
22 | * - MatrixBase::llt()
23 | * - MatrixBase::ldlt()
24 | * - SelfAdjointView::llt()
25 | * - SelfAdjointView::ldlt()
26 | *
27 | * \code
28 | * #include
29 | * \endcode
30 | */
31 |
32 | #include "src/Cholesky/LLT.h"
33 | #include "src/Cholesky/LDLT.h"
34 | #ifdef EIGEN_USE_LAPACKE
35 | #ifdef EIGEN_USE_MKL
36 | #include "mkl_lapacke.h"
37 | #else
38 | #include "src/misc/lapacke.h"
39 | #endif
40 | #include "src/Cholesky/LLT_LAPACKE.h"
41 | #endif
42 |
43 | #include "src/Core/util/ReenableStupidWarnings.h"
44 |
45 | #endif // EIGEN_CHOLESKY_MODULE_H
46 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
47 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/arch/AVX/TypeCasting.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2015 Benoit Steiner
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_TYPE_CASTING_AVX_H
11 | #define EIGEN_TYPE_CASTING_AVX_H
12 |
13 | namespace Eigen {
14 |
15 | namespace internal {
16 |
17 | // For now we use SSE to handle integers, so we can't use AVX instructions to cast
18 | // from int to float
19 | template <>
20 | struct type_casting_traits {
21 | enum {
22 | VectorizedCast = 0,
23 | SrcCoeffRatio = 1,
24 | TgtCoeffRatio = 1
25 | };
26 | };
27 |
28 | template <>
29 | struct type_casting_traits {
30 | enum {
31 | VectorizedCast = 0,
32 | SrcCoeffRatio = 1,
33 | TgtCoeffRatio = 1
34 | };
35 | };
36 |
37 |
38 |
39 | template<> EIGEN_STRONG_INLINE Packet8i pcast(const Packet8f& a) {
40 | return _mm256_cvtps_epi32(a);
41 | }
42 |
43 | template<> EIGEN_STRONG_INLINE Packet8f pcast(const Packet8i& a) {
44 | return _mm256_cvtepi32_ps(a);
45 | }
46 |
47 | } // end namespace internal
48 |
49 | } // end namespace Eigen
50 |
51 | #endif // EIGEN_TYPE_CASTING_AVX_H
52 |
--------------------------------------------------------------------------------
/plotUtils/plotGif.py:
--------------------------------------------------------------------------------
1 | import pdb
2 | import matplotlib.pyplot as plt
3 | import numpy as np
4 | from matplotlib.patches import Rectangle
5 | from matplotlib.animation import FuncAnimation
6 | import scipy.io as sio
7 | from tempfile import TemporaryFile
8 |
9 |
10 |
11 | def saveGit(name, xaxis, variableAnimate, color, labels, yLimits):
12 | fig = plt.figure()
13 | fig.set_tight_layout(True)
14 | ax = plt.axes()
15 | lineList = []
16 | for i in range(0, len(variableAnimate)):
17 | line, = ax.plot([], [], color[i], label=labels[i],zorder=1)
18 | lineList.append(line)
19 | plt.legend()
20 |
21 | def update(i):
22 | for j in range(0, len(variableAnimate)):
23 | lineList[j].set_data(xaxis[0:i], variableAnimate[j][0:i])
24 | ax.set(xlim=(0, i+1), ylim=yLimits)
25 | dataPoints = variableAnimate[0].shape[0]
26 |
27 | anim = FuncAnimation(fig, update, frames=np.arange(0, dataPoints+1), interval=100)
28 | anim.save(name+'.gif', dpi=80, writer='imagemagick')
29 |
30 | def main():
31 | # saveGit('prob', time_belief, [np.array(probMiss), probObstArray[:,0], probObstArray[:,1], probObstArray[:,2], probObstArray[:,3]], ['-k','-ob','--sb','-og','--sg'],['Mission', 'R1', 'R2', 'G1', 'G2'], (-0.1, 1.3))
32 | with open('test.npy', 'rb') as f:
33 | a = np.load(f)
34 | b = np.load(f)
35 | c = np.load(f)
36 |
37 | pdb.set_trace()
38 | T = 100
39 | saveGit('compTime', a[0:T], [np.array(b[0:T]), np.array(c[0:T])], ['-k','-r'],['Segway MPC', 'Wheeled bot MPC'], (-0.05, 0.5))
40 |
41 | main()
42 |
43 | ## Read and plot STATE
44 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/QR:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_QR_MODULE_H
9 | #define EIGEN_QR_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include "Cholesky"
16 | #include "Jacobi"
17 | #include "Householder"
18 |
19 | /** \defgroup QR_Module QR module
20 | *
21 | *
22 | *
23 | * This module provides various QR decompositions
24 | * This module also provides some MatrixBase methods, including:
25 | * - MatrixBase::householderQr()
26 | * - MatrixBase::colPivHouseholderQr()
27 | * - MatrixBase::fullPivHouseholderQr()
28 | *
29 | * \code
30 | * #include
31 | * \endcode
32 | */
33 |
34 | #include "src/QR/HouseholderQR.h"
35 | #include "src/QR/FullPivHouseholderQR.h"
36 | #include "src/QR/ColPivHouseholderQR.h"
37 | #include "src/QR/CompleteOrthogonalDecomposition.h"
38 | #ifdef EIGEN_USE_LAPACKE
39 | #ifdef EIGEN_USE_MKL
40 | #include "mkl_lapacke.h"
41 | #else
42 | #include "src/misc/lapacke.h"
43 | #endif
44 | #include "src/QR/HouseholderQR_LAPACKE.h"
45 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h"
46 | #endif
47 |
48 | #include "src/Core/util/ReenableStupidWarnings.h"
49 |
50 | #endif // EIGEN_QR_MODULE_H
51 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
52 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/UmfPackSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H
9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | extern "C" {
16 | #include
17 | }
18 |
19 | /** \ingroup Support_modules
20 | * \defgroup UmfPackSupport_Module UmfPackSupport module
21 | *
22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package.
23 | * It provides the following factorization class:
24 | * - class UmfPackLU: a multifrontal sequential LU factorization.
25 | *
26 | * \code
27 | * #include
28 | * \endcode
29 | *
30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies.
31 | * The dependencies depend on how umfpack has been compiled.
32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task.
33 | *
34 | */
35 |
36 | #include "src/UmfPackSupport/UmfPackSupport.h"
37 |
38 | #include "src/Core/util/ReenableStupidWarnings.h"
39 |
40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H
41 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/SparseCholesky:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008-2013 Gael Guennebaud
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H
11 | #define EIGEN_SPARSECHOLESKY_MODULE_H
12 |
13 | #include "SparseCore"
14 | #include "OrderingMethods"
15 |
16 | #include "src/Core/util/DisableStupidWarnings.h"
17 |
18 | /**
19 | * \defgroup SparseCholesky_Module SparseCholesky module
20 | *
21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices.
22 | * Those decompositions are accessible via the following classes:
23 | * - SimplicialLLt,
24 | * - SimplicialLDLt
25 | *
26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module.
27 | *
28 | * \code
29 | * #include
30 | * \endcode
31 | */
32 |
33 | #ifdef EIGEN_MPL2_ONLY
34 | #error The SparseCholesky module has nothing to offer in MPL2 only mode
35 | #endif
36 |
37 | #include "src/SparseCholesky/SimplicialCholesky.h"
38 |
39 | #ifndef EIGEN_MPL2_ONLY
40 | #include "src/SparseCholesky/SimplicialCholesky_impl.h"
41 | #endif
42 |
43 | #include "src/Core/util/ReenableStupidWarnings.h"
44 |
45 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H
46 |
--------------------------------------------------------------------------------
/src/pyFun/pyMOMDP.yml:
--------------------------------------------------------------------------------
1 | name: pyMOMDP
2 | channels:
3 | - conda-forge
4 | - bioconda
5 | - defaults
6 | dependencies:
7 | - ca-certificates=2020.6.20=hecda079_0
8 | - certifi=2020.6.20=py38h32f6830_0
9 | - cycler=0.10.0=py_2
10 | - freetype=2.10.2=h8da9a1a_0
11 | - jpeg=9d=h0b31af3_0
12 | - kiwisolver=1.2.0=py38ha0d09dd_0
13 | - lcms2=2.11=h174193d_0
14 | - libblas=3.8.0=16_mkl
15 | - libcblas=3.8.0=16_mkl
16 | - libcxx=10.0.1=h5f48129_0
17 | - libffi=3.2.1=hb1e8313_1007
18 | - libgfortran=4.0.0=3
19 | - libgfortran4=7.5.0=h1565451_3
20 | - liblapack=3.8.0=16_mkl
21 | - libopenblas=0.3.10=openmp_h63d9170_4
22 | - libpng=1.6.37=hb0a8c7a_2
23 | - libtiff=4.1.0=h2ae36a8_6
24 | - libwebp-base=1.1.0=h0b31af3_3
25 | - llvm-openmp=10.0.1=h28b9765_0
26 | - lz4-c=1.9.2=hb1e8313_3
27 | - matplotlib=3.3.1=1
28 | - matplotlib-base=3.3.1=py38haed9462_1
29 | - mkl=2020.2=260
30 | - ncurses=6.2=hb1e8313_1
31 | - numpy=1.19.1=py38h8ccc501_2
32 | - olefile=0.46=py_0
33 | - openssl=1.1.1g=haf1e3a3_1
34 | - pillow=7.2.0=py38h83dc5e5_1
35 | - pip=20.2.3=py_0
36 | - pyparsing=2.4.7=pyh9f0ad1d_0
37 | - python=3.8.5=hfc71d35_7_cpython
38 | - python-dateutil=2.8.1=py_0
39 | - python_abi=3.8=1_cp38
40 | - readline=8.0=h0678c8f_2
41 | - scipy=1.5.2=py38h1402333_0
42 | - setuptools=49.6.0=py38h32f6830_0
43 | - six=1.15.0=pyh9f0ad1d_0
44 | - sqlite=3.33.0=h960bd1c_0
45 | - tk=8.6.10=hb0a8c7a_0
46 | - tornado=6.0.4=py38h64e0658_1
47 | - wheel=0.35.1=pyh9f0ad1d_0
48 | - xz=5.2.5=haf1e3a3_1
49 | - zlib=1.2.11=h7795811_1009
50 | - zstd=1.4.5=h289c70a_2
51 | prefix: /opt/anaconda3/envs/pyMOMDP
52 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/LU:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_LU_MODULE_H
9 | #define EIGEN_LU_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | /** \defgroup LU_Module LU module
16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant.
17 | * This module defines the following MatrixBase methods:
18 | * - MatrixBase::inverse()
19 | * - MatrixBase::determinant()
20 | *
21 | * \code
22 | * #include
23 | * \endcode
24 | */
25 |
26 | #include "src/misc/Kernel.h"
27 | #include "src/misc/Image.h"
28 | #include "src/LU/FullPivLU.h"
29 | #include "src/LU/PartialPivLU.h"
30 | #ifdef EIGEN_USE_LAPACKE
31 | #ifdef EIGEN_USE_MKL
32 | #include "mkl_lapacke.h"
33 | #else
34 | #include "src/misc/lapacke.h"
35 | #endif
36 | #include "src/LU/PartialPivLU_LAPACKE.h"
37 | #endif
38 | #include "src/LU/Determinant.h"
39 | #include "src/LU/InverseImpl.h"
40 |
41 | // Use the SSE optimized version whenever possible. At the moment the
42 | // SSE version doesn't compile when AVX is enabled
43 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
44 | #include "src/LU/arch/Inverse_SSE.h"
45 | #endif
46 |
47 | // #include "src/Core/util/ReenableStupidWarnings.h"
48 |
49 | #endif // EIGEN_LU_MODULE_H
50 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
51 |
--------------------------------------------------------------------------------
/include/segway_sim/mpc_node.hpp:
--------------------------------------------------------------------------------
1 | #ifndef MPC_NODE_H
2 | #define MPC_NODE_H
3 |
4 | #include "ros/ros.h"
5 | #include "segway_sim/cmd.h"
6 | #include "segway_sim/input.h"
7 | #include "segway_sim/state.h"
8 | #include "segway_sim/valFunCnst.h"
9 | #include "segway_sim/optSol.h"
10 | #include "segway_sim/goalSetAndState.h"
11 | #include "segway_sim/linearMatrices.h"
12 | #include "segway_sim/common.hpp"
13 | #include "ambercortex_ros/state.h"
14 | #include "ambercortex_ros/cmd.h"
15 | #include "sensor_msgs/Joy.h"
16 | #include
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #define MSG_MODE 'M'
26 |
27 | #define MODE_INIT 10
28 | #define MODE_RUN 20
29 | #define MODE_BACKUP 30
30 | #define MSG_CTRL 'K'
31 |
32 | static const uint32_t nx = 7; // Number of system state
33 | static const uint32_t nu = 2; // Number of inputs
34 | static const uint32_t N = 40; // Horizon length
35 | static const uint32_t printLevel = 0; // 0 = no printing, 1 = only x_t, 2 = minimal, 3 = minimal + initialization, 4 = all
36 |
37 | union num32_t {
38 | int32_t i;
39 | uint32_t ui;
40 | float f;
41 | uint8_t c[4];
42 | };
43 |
44 | void add_float_to_vec(std::vector & vec, float f) {
45 | // add four bits to the end of a std::vector representing a float
46 | num32_t n32;
47 | n32.f = f;
48 | vec.push_back(n32.c[0]);
49 | vec.push_back(n32.c[1]);
50 | vec.push_back(n32.c[2]);
51 | vec.push_back(n32.c[3]);
52 | }
53 |
54 | uint8_t compute_vec_chksum(const std::vector & vec) {
55 | // compute checksum of a std::vector
56 | uint8_t chksum = 0;
57 | for (auto it = vec.cbegin(); it != vec.cend(); ++it)
58 | chksum += *it;
59 | return chksum;
60 | }
61 |
62 | #endif
--------------------------------------------------------------------------------
/include/Eigen_embedded/SVD:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SVD_MODULE_H
9 | #define EIGEN_SVD_MODULE_H
10 |
11 | #include "QR"
12 | #include "Householder"
13 | #include "Jacobi"
14 |
15 | #include "src/Core/util/DisableStupidWarnings.h"
16 |
17 | /** \defgroup SVD_Module SVD module
18 | *
19 | *
20 | *
21 | * This module provides SVD decomposition for matrices (both real and complex).
22 | * Two decomposition algorithms are provided:
23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones.
24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems.
25 | * These decompositions are accessible via the respective classes and following MatrixBase methods:
26 | * - MatrixBase::jacobiSvd()
27 | * - MatrixBase::bdcSvd()
28 | *
29 | * \code
30 | * #include
31 | * \endcode
32 | */
33 |
34 | #include "src/misc/RealSvd2x2.h"
35 | #include "src/SVD/UpperBidiagonalization.h"
36 | #include "src/SVD/SVDBase.h"
37 | #include "src/SVD/JacobiSVD.h"
38 | #include "src/SVD/BDCSVD.h"
39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT)
40 | #ifdef EIGEN_USE_MKL
41 | #include "mkl_lapacke.h"
42 | #else
43 | #include "src/misc/lapacke.h"
44 | #endif
45 | #include "src/SVD/JacobiSVD_LAPACKE.h"
46 | #endif
47 |
48 | #include "src/Core/util/ReenableStupidWarnings.h"
49 |
50 | #endif // EIGEN_SVD_MODULE_H
51 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
52 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/PaStiXSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H
9 | #define EIGEN_PASTIXSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | extern "C" {
16 | #include
17 | #include
18 | }
19 |
20 | #ifdef complex
21 | #undef complex
22 | #endif
23 |
24 | /** \ingroup Support_modules
25 | * \defgroup PaStiXSupport_Module PaStiXSupport module
26 | *
27 | * This module provides an interface to the PaSTiX library.
28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver.
29 | * It provides the two following main factorization classes:
30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization.
31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization.
32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern).
33 | *
34 | * \code
35 | * #include
36 | * \endcode
37 | *
38 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies.
39 | * The dependencies depend on how PaSTiX has been compiled.
40 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task.
41 | *
42 | */
43 |
44 | #include "src/PaStiXSupport/PaStiXSupport.h"
45 |
46 | #include "src/Core/util/ReenableStupidWarnings.h"
47 |
48 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H
49 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/SparseLU:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam
5 | // Copyright (C) 2012 Gael Guennebaud
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_SPARSELU_MODULE_H
12 | #define EIGEN_SPARSELU_MODULE_H
13 |
14 | #include "SparseCore"
15 |
16 | /**
17 | * \defgroup SparseLU_Module SparseLU module
18 | * This module defines a supernodal factorization of general sparse matrices.
19 | * The code is fully optimized for supernode-panel updates with specialized kernels.
20 | * Please, see the documentation of the SparseLU class for more details.
21 | */
22 |
23 | // Ordering interface
24 | #include "OrderingMethods"
25 |
26 | #include "src/SparseLU/SparseLU_gemm_kernel.h"
27 |
28 | #include "src/SparseLU/SparseLU_Structs.h"
29 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h"
30 | #include "src/SparseLU/SparseLUImpl.h"
31 | #include "src/SparseCore/SparseColEtree.h"
32 | #include "src/SparseLU/SparseLU_Memory.h"
33 | #include "src/SparseLU/SparseLU_heap_relax_snode.h"
34 | #include "src/SparseLU/SparseLU_relax_snode.h"
35 | #include "src/SparseLU/SparseLU_pivotL.h"
36 | #include "src/SparseLU/SparseLU_panel_dfs.h"
37 | #include "src/SparseLU/SparseLU_kernel_bmod.h"
38 | #include "src/SparseLU/SparseLU_panel_bmod.h"
39 | #include "src/SparseLU/SparseLU_column_dfs.h"
40 | #include "src/SparseLU/SparseLU_column_bmod.h"
41 | #include "src/SparseLU/SparseLU_copy_to_ucol.h"
42 | #include "src/SparseLU/SparseLU_pruneL.h"
43 | #include "src/SparseLU/SparseLU_Utils.h"
44 | #include "src/SparseLU/SparseLU.h"
45 |
46 | #endif // EIGEN_SPARSELU_MODULE_H
47 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/SelfCwiseBinaryOp.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009-2010 Gael Guennebaud
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_SELFCWISEBINARYOP_H
11 | #define EIGEN_SELFCWISEBINARYOP_H
12 |
13 | namespace Eigen {
14 |
15 | // TODO generalize the scalar type of 'other'
16 |
17 | template
18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other)
19 | {
20 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op());
21 | return derived();
22 | }
23 |
24 | template
25 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other)
26 | {
27 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op());
28 | return derived();
29 | }
30 |
31 | template
32 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other)
33 | {
34 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op());
35 | return derived();
36 | }
37 |
38 | template
39 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other)
40 | {
41 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op());
42 | return derived();
43 | }
44 |
45 | } // end namespace Eigen
46 |
47 | #endif // EIGEN_SELFCWISEBINARYOP_H
48 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/SparseCore/SparseRedux.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008-2014 Gael Guennebaud
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_SPARSEREDUX_H
11 | #define EIGEN_SPARSEREDUX_H
12 |
13 | namespace Eigen {
14 |
15 | template
16 | typename internal::traits::Scalar
17 | SparseMatrixBase::sum() const
18 | {
19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix");
20 | Scalar res(0);
21 | internal::evaluator thisEval(derived());
22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter)
24 | res += iter.value();
25 | return res;
26 | }
27 |
28 | template
29 | typename internal::traits >::Scalar
30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const
31 | {
32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix");
33 | if(this->isCompressed())
34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum();
35 | else
36 | return Base::sum();
37 | }
38 |
39 | template
40 | typename internal::traits >::Scalar
41 | SparseVector<_Scalar,_Options,_Index>::sum() const
42 | {
43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix");
44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum();
45 | }
46 |
47 | } // end namespace Eigen
48 |
49 | #endif // EIGEN_SPARSEREDUX_H
50 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/arch/Default/Settings.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008-2010 Gael Guennebaud
5 | // Copyright (C) 2006-2008 Benoit Jacob
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 |
12 | /* All the parameters defined in this file can be specialized in the
13 | * architecture specific files, and/or by the user.
14 | * More to come... */
15 |
16 | #ifndef EIGEN_DEFAULT_SETTINGS_H
17 | #define EIGEN_DEFAULT_SETTINGS_H
18 |
19 | /** Defines the maximal loop size to enable meta unrolling of loops.
20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS",
21 | * it does not correspond to the number of iterations or the number of instructions
22 | */
23 | #ifndef EIGEN_UNROLLING_LIMIT
24 | #define EIGEN_UNROLLING_LIMIT 100
25 | #endif
26 |
27 | /** Defines the threshold between a "small" and a "large" matrix.
28 | * This threshold is mainly used to select the proper product implementation.
29 | */
30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8
32 | #endif
33 |
34 | /** Defines the maximal width of the blocks used in the triangular product and solver
35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8.
36 | */
37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH
38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8
39 | #endif
40 |
41 |
42 | /** Defines the default number of registers available for that architecture.
43 | * Currently it must be 8 or 16. Other values will fail.
44 | */
45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS
46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8
47 | #endif
48 |
49 | #endif // EIGEN_DEFAULT_SETTINGS_H
50 |
--------------------------------------------------------------------------------
/include/segway_sim/mpc_drone_node.hpp:
--------------------------------------------------------------------------------
1 | #ifndef MPC_NODE_H
2 | #define MPC_NODE_H
3 |
4 | #include "ros/ros.h"
5 | #include "segway_sim/cmd.h"
6 | #include "segway_sim/input.h"
7 | #include "segway_sim/state.h"
8 | #include "segway_sim/valFunCnst.h"
9 | #include "segway_sim/optSol.h"
10 | #include "segway_sim/goalSetAndState.h"
11 | #include "segway_sim/linearMatrices.h"
12 | #include "segway_sim/common.hpp"
13 | #include "segway_sim/cmdDrone.h"
14 | #include "segway_sim/stateDrone.h"
15 | #include "segway_sim/cmdDrone.h"
16 | #include "ambercortex_ros/state.h"
17 | #include "ambercortex_ros/cmd.h"
18 | #include "ambercortex_ros/ctrl_info.h"
19 | #include "sensor_msgs/Joy.h"
20 | #include
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | #define MSG_MODE 'M'
30 |
31 | #define MODE_INIT 10
32 | #define MODE_RUN 20
33 | #define MODE_BACKUP 30
34 | #define MSG_CTRL 'K'
35 |
36 | static const int nx = 4; // Number of system state
37 | static const int nu = 2; // Number of inputs
38 | static const int N = 20; // Horizon length
39 | static const uint32_t printLevel = 0; // 0 = no printing, 1 = only x_t, 2 = minimal, 3 = minimal + initialization, 4 = all
40 |
41 | union num32_t {
42 | int32_t i;
43 | uint32_t ui;
44 | float f;
45 | uint8_t c[4];
46 | };
47 |
48 | void add_float_to_vec(std::vector & vec, float f) {
49 | // add four bits to the end of a std::vector representing a float
50 | num32_t n32;
51 | n32.f = f;
52 | vec.push_back(n32.c[0]);
53 | vec.push_back(n32.c[1]);
54 | vec.push_back(n32.c[2]);
55 | vec.push_back(n32.c[3]);
56 | }
57 |
58 | uint8_t compute_vec_chksum(const std::vector & vec) {
59 | // compute checksum of a std::vector
60 | uint8_t chksum = 0;
61 | for (auto it = vec.cbegin(); it != vec.cend(); ++it)
62 | chksum += *it;
63 | return chksum;
64 | }
65 |
66 | #endif
--------------------------------------------------------------------------------
/include/segway_sim/CyberTimer.hpp:
--------------------------------------------------------------------------------
1 | #ifndef _CUSTOM_TIMER_H_
2 | #define _CUSTOM_TIMER_H_
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | template
9 | class CyberTimer
10 | {
11 | static_assert(averageLen>0, "Averaging length must be strictly positive");
12 |
13 | public:
14 | CyberTimer(void):
15 | i_(0),
16 | iterCount_(0),
17 | running_(false),
18 | dt_(0.0)
19 | {};
20 |
21 | ~CyberTimer()
22 | {};
23 |
24 | void tic(void)
25 | {
26 | running_ = true;
27 | t_start_ = std::chrono::high_resolution_clock::now();
28 | };
29 |
30 | double toc(void)
31 | {
32 | if(running_)
33 | {
34 | running_ = false;
35 | const auto t_stop = std::chrono::high_resolution_clock::now();
36 | const auto duration = std::chrono::duration_cast(t_stop - t_start_);
37 | dt_ = static_cast(duration.count())*1.0e-9;
38 |
39 | buffer_[i_] = dt_;
40 | i_++;
41 | if(i_>=averageLen)
42 | i_=0;
43 | iterCount_++;
44 | }
45 |
46 | return dt_;
47 | };
48 |
49 | double getAverage(void) const
50 | {
51 | if(iterCount_==0)
52 | return -1.0;
53 |
54 | if(iterCount_ t_start_;
87 | std::array buffer_;
88 | };
89 |
90 |
91 | #endif
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/misc/RealSvd2x2.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2009-2010 Benoit Jacob
5 | // Copyright (C) 2013-2016 Gael Guennebaud
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_REALSVD2X2_H
12 | #define EIGEN_REALSVD2X2_H
13 |
14 | namespace Eigen {
15 |
16 | namespace internal {
17 |
18 | template
19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q,
20 | JacobiRotation *j_left,
21 | JacobiRotation *j_right)
22 | {
23 | using std::sqrt;
24 | using std::abs;
25 | Matrix m;
26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)),
27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q));
28 | JacobiRotation rot1;
29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1);
30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1);
31 |
32 | if(abs(d) < (std::numeric_limits::min)())
33 | {
34 | rot1.s() = RealScalar(0);
35 | rot1.c() = RealScalar(1);
36 | }
37 | else
38 | {
39 | // If d!=0, then t/d cannot overflow because the magnitude of the
40 | // entries forming d are not too small compared to the ones forming t.
41 | RealScalar u = t / d;
42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u));
43 | rot1.s() = RealScalar(1) / tmp;
44 | rot1.c() = u / tmp;
45 | }
46 | m.applyOnTheLeft(0,1,rot1);
47 | j_right->makeJacobi(m,0,1);
48 | *j_left = rot1 * j_right->transpose();
49 | }
50 |
51 | } // end namespace internal
52 |
53 | } // end namespace Eigen
54 |
55 | #endif // EIGEN_REALSVD2X2_H
56 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Eigenvalues:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_EIGENVALUES_MODULE_H
9 | #define EIGEN_EIGENVALUES_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include "Cholesky"
16 | #include "Jacobi"
17 | #include "Householder"
18 | #include "LU"
19 | #include "Geometry"
20 |
21 | /** \defgroup Eigenvalues_Module Eigenvalues module
22 | *
23 | *
24 | *
25 | * This module mainly provides various eigenvalue solvers.
26 | * This module also provides some MatrixBase methods, including:
27 | * - MatrixBase::eigenvalues(),
28 | * - MatrixBase::operatorNorm()
29 | *
30 | * \code
31 | * #include
32 | * \endcode
33 | */
34 |
35 | #include "src/misc/RealSvd2x2.h"
36 | #include "src/Eigenvalues/Tridiagonalization.h"
37 | #include "src/Eigenvalues/RealSchur.h"
38 | #include "src/Eigenvalues/EigenSolver.h"
39 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h"
40 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h"
41 | #include "src/Eigenvalues/HessenbergDecomposition.h"
42 | #include "src/Eigenvalues/ComplexSchur.h"
43 | #include "src/Eigenvalues/ComplexEigenSolver.h"
44 | #include "src/Eigenvalues/RealQZ.h"
45 | #include "src/Eigenvalues/GeneralizedEigenSolver.h"
46 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h"
47 | #ifdef EIGEN_USE_LAPACKE
48 | #ifdef EIGEN_USE_MKL
49 | #include "mkl_lapacke.h"
50 | #else
51 | #include "src/misc/lapacke.h"
52 | #endif
53 | #include "src/Eigenvalues/RealSchur_LAPACKE.h"
54 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h"
55 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h"
56 | #endif
57 |
58 | #include "src/Core/util/ReenableStupidWarnings.h"
59 |
60 | #endif // EIGEN_EIGENVALUES_MODULE_H
61 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
62 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/CholmodSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H
9 | #define EIGEN_CHOLMODSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | extern "C" {
16 | #include
17 | }
18 |
19 | /** \ingroup Support_modules
20 | * \defgroup CholmodSupport_Module CholmodSupport module
21 | *
22 | * This module provides an interface to the Cholmod library which is part of the suitesparse package.
23 | * It provides the two following main factorization classes:
24 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
25 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).
26 | *
27 | * For the sake of completeness, this module also propose the two following classes:
28 | * - class CholmodSimplicialLLT
29 | * - class CholmodSimplicialLDLT
30 | * Note that these classes does not bring any particular advantage compared to the built-in
31 | * SimplicialLLT and SimplicialLDLT factorization classes.
32 | *
33 | * \code
34 | * #include
35 | * \endcode
36 | *
37 | * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies.
38 | * The dependencies depend on how cholmod has been compiled.
39 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task.
40 | *
41 | */
42 |
43 | #include "src/CholmodSupport/CholmodSupport.h"
44 |
45 | #include "src/Core/util/ReenableStupidWarnings.h"
46 |
47 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H
48 |
49 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/arch/Default/ConjHelper.h:
--------------------------------------------------------------------------------
1 |
2 | // This file is part of Eigen, a lightweight C++ template library
3 | // for linear algebra.
4 | //
5 | // Copyright (C) 2017 Gael Guennebaud
6 | //
7 | // This Source Code Form is subject to the terms of the Mozilla
8 | // Public License v. 2.0. If a copy of the MPL was not distributed
9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 |
11 | #ifndef EIGEN_ARCH_CONJ_HELPER_H
12 | #define EIGEN_ARCH_CONJ_HELPER_H
13 |
14 | #define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL) \
15 | template<> struct conj_helper { \
16 | EIGEN_STRONG_INLINE PACKET_CPLX pmadd(const PACKET_REAL& x, const PACKET_CPLX& y, const PACKET_CPLX& c) const \
17 | { return padd(c, pmul(x,y)); } \
18 | EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_REAL& x, const PACKET_CPLX& y) const \
19 | { return PACKET_CPLX(Eigen::internal::pmul(x, y.v)); } \
20 | }; \
21 | \
22 | template<> struct conj_helper { \
23 | EIGEN_STRONG_INLINE PACKET_CPLX pmadd(const PACKET_CPLX& x, const PACKET_REAL& y, const PACKET_CPLX& c) const \
24 | { return padd(c, pmul(x,y)); } \
25 | EIGEN_STRONG_INLINE PACKET_CPLX pmul(const PACKET_CPLX& x, const PACKET_REAL& y) const \
26 | { return PACKET_CPLX(Eigen::internal::pmul(x.v, y)); } \
27 | };
28 |
29 | #endif // EIGEN_ARCH_CONJ_HELPER_H
30 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/Core/arch/SSE/TypeCasting.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2015 Benoit Steiner
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_TYPE_CASTING_SSE_H
11 | #define EIGEN_TYPE_CASTING_SSE_H
12 |
13 | namespace Eigen {
14 |
15 | namespace internal {
16 |
17 | #ifndef EIGEN_VECTORIZE_AVX
18 | template <>
19 | struct type_casting_traits {
20 | enum {
21 | VectorizedCast = 1,
22 | SrcCoeffRatio = 1,
23 | TgtCoeffRatio = 1
24 | };
25 | };
26 |
27 | template <>
28 | struct type_casting_traits {
29 | enum {
30 | VectorizedCast = 1,
31 | SrcCoeffRatio = 1,
32 | TgtCoeffRatio = 1
33 | };
34 | };
35 |
36 | template <>
37 | struct type_casting_traits {
38 | enum {
39 | VectorizedCast = 1,
40 | SrcCoeffRatio = 2,
41 | TgtCoeffRatio = 1
42 | };
43 | };
44 |
45 | template <>
46 | struct type_casting_traits {
47 | enum {
48 | VectorizedCast = 1,
49 | SrcCoeffRatio = 1,
50 | TgtCoeffRatio = 2
51 | };
52 | };
53 | #endif
54 |
55 | template<> EIGEN_STRONG_INLINE Packet4i pcast(const Packet4f& a) {
56 | return _mm_cvttps_epi32(a);
57 | }
58 |
59 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet4i& a) {
60 | return _mm_cvtepi32_ps(a);
61 | }
62 |
63 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet2d& a, const Packet2d& b) {
64 | return _mm_shuffle_ps(_mm_cvtpd_ps(a), _mm_cvtpd_ps(b), (1 << 2) | (1 << 6));
65 | }
66 |
67 | template<> EIGEN_STRONG_INLINE Packet2d pcast(const Packet4f& a) {
68 | // Simply discard the second half of the input
69 | return _mm_cvtps_pd(a);
70 | }
71 |
72 |
73 | } // end namespace internal
74 |
75 | } // end namespace Eigen
76 |
77 | #endif // EIGEN_TYPE_CASTING_SSE_H
78 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/IterativeLinearSolvers:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
9 | #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
10 |
11 | #include "SparseCore"
12 | #include "OrderingMethods"
13 |
14 | #include "src/Core/util/DisableStupidWarnings.h"
15 |
16 | /**
17 | * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module
18 | *
19 | * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse.
20 | * Those solvers are accessible via the following classes:
21 | * - ConjugateGradient for selfadjoint (hermitian) matrices,
22 | * - LeastSquaresConjugateGradient for rectangular least-square problems,
23 | * - BiCGSTAB for general square matrices.
24 | *
25 | * These iterative solvers are associated with some preconditioners:
26 | * - IdentityPreconditioner - not really useful
27 | * - DiagonalPreconditioner - also called Jacobi preconditioner, work very well on diagonal dominant matrices.
28 | * - IncompleteLUT - incomplete LU factorization with dual thresholding
29 | *
30 | * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport.
31 | *
32 | \code
33 | #include
34 | \endcode
35 | */
36 |
37 | #include "src/IterativeLinearSolvers/SolveWithGuess.h"
38 | #include "src/IterativeLinearSolvers/IterativeSolverBase.h"
39 | #include "src/IterativeLinearSolvers/BasicPreconditioners.h"
40 | #include "src/IterativeLinearSolvers/ConjugateGradient.h"
41 | #include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h"
42 | #include "src/IterativeLinearSolvers/BiCGSTAB.h"
43 | #include "src/IterativeLinearSolvers/IncompleteLUT.h"
44 | #include "src/IterativeLinearSolvers/IncompleteCholesky.h"
45 |
46 | #include "src/Core/util/ReenableStupidWarnings.h"
47 |
48 | #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
49 |
--------------------------------------------------------------------------------
/launch/hardware_mpc.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/Geometry:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_GEOMETRY_MODULE_H
9 | #define EIGEN_GEOMETRY_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include "SVD"
16 | #include "LU"
17 | #include
18 |
19 | /** \defgroup Geometry_Module Geometry module
20 | *
21 | * This module provides support for:
22 | * - fixed-size homogeneous transformations
23 | * - translation, scaling, 2D and 3D rotations
24 | * - \link Quaternion quaternions \endlink
25 | * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3)
26 | * - orthognal vector generation (\ref MatrixBase::unitOrthogonal)
27 | * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink
28 | * - \link AlignedBox axis aligned bounding boxes \endlink
29 | * - \link umeyama least-square transformation fitting \endlink
30 | *
31 | * \code
32 | * #include
33 | * \endcode
34 | */
35 |
36 | #include "src/Geometry/OrthoMethods.h"
37 | #include "src/Geometry/EulerAngles.h"
38 |
39 | #include "src/Geometry/Homogeneous.h"
40 | #include "src/Geometry/RotationBase.h"
41 | #include "src/Geometry/Rotation2D.h"
42 | #include "src/Geometry/Quaternion.h"
43 | #include "src/Geometry/AngleAxis.h"
44 | #include "src/Geometry/Transform.h"
45 | #include "src/Geometry/Translation.h"
46 | #include "src/Geometry/Scaling.h"
47 | #include "src/Geometry/Hyperplane.h"
48 | #include "src/Geometry/ParametrizedLine.h"
49 | #include "src/Geometry/AlignedBox.h"
50 | #include "src/Geometry/Umeyama.h"
51 |
52 | // Use the SSE optimized version whenever possible. At the moment the
53 | // SSE version doesn't compile when AVX is enabled
54 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
55 | #include "src/Geometry/arch/Geometry_SSE.h"
56 | #endif
57 |
58 | #include "src/Core/util/ReenableStupidWarnings.h"
59 |
60 | #endif // EIGEN_GEOMETRY_MODULE_H
61 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
62 |
63 |
--------------------------------------------------------------------------------
/URDF/cyberpod.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/SparseLU/SparseLU_Utils.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 |
11 | #ifndef EIGEN_SPARSELU_UTILS_H
12 | #define EIGEN_SPARSELU_UTILS_H
13 |
14 | namespace Eigen {
15 | namespace internal {
16 |
17 | /**
18 | * \brief Count Nonzero elements in the factors
19 | */
20 | template
21 | void SparseLUImpl::countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu)
22 | {
23 | nnzL = 0;
24 | nnzU = (glu.xusub)(n);
25 | Index nsuper = (glu.supno)(n);
26 | Index jlen;
27 | Index i, j, fsupc;
28 | if (n <= 0 ) return;
29 | // For each supernode
30 | for (i = 0; i <= nsuper; i++)
31 | {
32 | fsupc = glu.xsup(i);
33 | jlen = glu.xlsub(fsupc+1) - glu.xlsub(fsupc);
34 |
35 | for (j = fsupc; j < glu.xsup(i+1); j++)
36 | {
37 | nnzL += jlen;
38 | nnzU += j - fsupc + 1;
39 | jlen--;
40 | }
41 | }
42 | }
43 |
44 | /**
45 | * \brief Fix up the data storage lsub for L-subscripts.
46 | *
47 | * It removes the subscripts sets for structural pruning,
48 | * and applies permutation to the remaining subscripts
49 | *
50 | */
51 | template
52 | void SparseLUImpl::fixupL(const Index n, const IndexVector& perm_r, GlobalLU_t& glu)
53 | {
54 | Index fsupc, i, j, k, jstart;
55 |
56 | StorageIndex nextl = 0;
57 | Index nsuper = (glu.supno)(n);
58 |
59 | // For each supernode
60 | for (i = 0; i <= nsuper; i++)
61 | {
62 | fsupc = glu.xsup(i);
63 | jstart = glu.xlsub(fsupc);
64 | glu.xlsub(fsupc) = nextl;
65 | for (j = jstart; j < glu.xlsub(fsupc + 1); j++)
66 | {
67 | glu.lsub(nextl) = perm_r(glu.lsub(j)); // Now indexed into P*A
68 | nextl++;
69 | }
70 | for (k = fsupc+1; k < glu.xsup(i+1); k++)
71 | glu.xlsub(k) = nextl; // other columns in supernode i
72 | }
73 |
74 | glu.xlsub(n) = nextl;
75 | }
76 |
77 | } // end namespace internal
78 |
79 | } // end namespace Eigen
80 | #endif // EIGEN_SPARSELU_UTILS_H
81 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/src/SparseCore/MappedSparseMatrix.h:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // Copyright (C) 2008-2014 Gael Guennebaud
5 | //
6 | // This Source Code Form is subject to the terms of the Mozilla
7 | // Public License v. 2.0. If a copy of the MPL was not distributed
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 |
10 | #ifndef EIGEN_MAPPED_SPARSEMATRIX_H
11 | #define EIGEN_MAPPED_SPARSEMATRIX_H
12 |
13 | namespace Eigen {
14 |
15 | /** \deprecated Use Map >
16 | * \class MappedSparseMatrix
17 | *
18 | * \brief Sparse matrix
19 | *
20 | * \param _Scalar the scalar type, i.e. the type of the coefficients
21 | *
22 | * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.
23 | *
24 | */
25 | namespace internal {
26 | template
27 | struct traits > : traits >
28 | {};
29 | } // end namespace internal
30 |
31 | template
32 | class MappedSparseMatrix
33 | : public Map >
34 | {
35 | typedef Map > Base;
36 |
37 | public:
38 |
39 | typedef typename Base::StorageIndex StorageIndex;
40 | typedef typename Base::Scalar Scalar;
41 |
42 | inline MappedSparseMatrix(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZeroPtr = 0)
43 | : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZeroPtr)
44 | {}
45 |
46 | /** Empty destructor */
47 | inline ~MappedSparseMatrix() {}
48 | };
49 |
50 | namespace internal {
51 |
52 | template
53 | struct evaluator >
54 | : evaluator > >
55 | {
56 | typedef MappedSparseMatrix<_Scalar,_Options,_StorageIndex> XprType;
57 | typedef evaluator > Base;
58 |
59 | evaluator() : Base() {}
60 | explicit evaluator(const XprType &mat) : Base(mat) {}
61 | };
62 |
63 | }
64 |
65 | } // end namespace Eigen
66 |
67 | #endif // EIGEN_MAPPED_SPARSEMATRIX_H
68 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/SuperLUSupport:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H
9 | #define EIGEN_SUPERLUSUPPORT_MODULE_H
10 |
11 | #include "SparseCore"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #ifdef EMPTY
16 | #define EIGEN_EMPTY_WAS_ALREADY_DEFINED
17 | #endif
18 |
19 | typedef int int_t;
20 | #include
21 | #include
22 | #include
23 |
24 | // slu_util.h defines a preprocessor token named EMPTY which is really polluting,
25 | // so we remove it in favor of a SUPERLU_EMPTY token.
26 | // If EMPTY was already defined then we don't undef it.
27 |
28 | #if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED)
29 | # undef EIGEN_EMPTY_WAS_ALREADY_DEFINED
30 | #elif defined(EMPTY)
31 | # undef EMPTY
32 | #endif
33 |
34 | #define SUPERLU_EMPTY (-1)
35 |
36 | namespace Eigen { struct SluMatrix; }
37 |
38 | /** \ingroup Support_modules
39 | * \defgroup SuperLUSupport_Module SuperLUSupport module
40 | *
41 | * This module provides an interface to the SuperLU library.
42 | * It provides the following factorization class:
43 | * - class SuperLU: a supernodal sequential LU factorization.
44 | * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods).
45 | *
46 | * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported.
47 | *
48 | * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting.
49 | *
50 | * \code
51 | * #include
52 | * \endcode
53 | *
54 | * In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies.
55 | * The dependencies depend on how superlu has been compiled.
56 | * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task.
57 | *
58 | */
59 |
60 | #include "src/SuperLUSupport/SuperLUSupport.h"
61 |
62 | #include "src/Core/util/ReenableStupidWarnings.h"
63 |
64 | #endif // EIGEN_SUPERLUSUPPORT_MODULE_H
65 |
--------------------------------------------------------------------------------
/include/Eigen_embedded/SparseCore:
--------------------------------------------------------------------------------
1 | // This file is part of Eigen, a lightweight C++ template library
2 | // for linear algebra.
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla
5 | // Public License v. 2.0. If a copy of the MPL was not distributed
6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 | #ifndef EIGEN_SPARSECORE_MODULE_H
9 | #define EIGEN_SPARSECORE_MODULE_H
10 |
11 | #include "Core"
12 |
13 | #include "src/Core/util/DisableStupidWarnings.h"
14 |
15 | #include
16 | #include