[InverseDynamics] Support for Jacobians & derivatives
This change adds support for calculating Jacobians and dot(Jacobian)*u terms, along with the required support for the 3xN matrices in the standalone math library. It also adds functions to compute kinematics only (position, velocity, accel). To facilitate tests, the Cl also adds a RandomTreeCreator to create randomized multibody trees. Thanks to Thomas Buschmann for this contribution!
This commit is contained in:
@@ -2,16 +2,35 @@
|
||||
#define INVDYNEIGENINTERFACE_HPP_
|
||||
#include "../IDConfig.hpp"
|
||||
namespace btInverseDynamics {
|
||||
|
||||
#define BT_ID_HAVE_MAT3X
|
||||
|
||||
#ifdef BT_USE_DOUBLE_PRECISION
|
||||
typedef Eigen::VectorXd vecx;
|
||||
typedef Eigen::Vector3d vec3;
|
||||
typedef Eigen::Matrix3d mat33;
|
||||
typedef Eigen::MatrixXd matxx;
|
||||
typedef Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::DontAlign> vecx;
|
||||
typedef Eigen::Matrix<double, 3, 1, Eigen::DontAlign> vec3;
|
||||
typedef Eigen::Matrix<double, 3, 3, Eigen::DontAlign> mat33;
|
||||
typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> matxx;
|
||||
typedef Eigen::Matrix<double, 3, Eigen::Dynamic, Eigen::DontAlign> mat3x;
|
||||
#else
|
||||
typedef Eigen::VectorXf vecx;
|
||||
typedef Eigen::Vector3f vec3;
|
||||
typedef Eigen::Matrix3f mat33;
|
||||
typedef Eigen::MatrixXf matxx;
|
||||
#endif //
|
||||
typedef Eigen::Matrix<float, Eigen::Dynamic, 1, Eigen::DontAlign> vecx;
|
||||
typedef Eigen::Matrix<float, 3, 1, Eigen::DontAlign> vec3;
|
||||
typedef Eigen::Matrix<float, 3, 3, Eigen::DontAlign> mat33;
|
||||
typedef Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> matxx;
|
||||
typedef Eigen::Matrix<float, 3, Eigen::Dynamic, Eigen::DontAlign> mat3x;
|
||||
#endif
|
||||
|
||||
inline void resize(mat3x &m, Eigen::Index size) {
|
||||
m.resize(3, size);
|
||||
m.setZero();
|
||||
}
|
||||
|
||||
inline void setMatxxElem(const idArrayIdx row, const idArrayIdx col, const idScalar val, matxx*m){
|
||||
(*m)(row, col) = val;
|
||||
}
|
||||
|
||||
inline void setMat3xElem(const idArrayIdx row, const idArrayIdx col, const idScalar val, mat3x*m){
|
||||
(*m)(row, col) = val;
|
||||
}
|
||||
|
||||
}
|
||||
#endif // INVDYNEIGENINTERFACE_HPP_
|
||||
|
||||
Reference in New Issue
Block a user