19 #ifndef __UUV_GAZEBO_PLUGINS_DEF_HH__ 20 #define __UUV_GAZEBO_PLUGINS_DEF_HH__ 26 #include <gazebo/gazebo.hh> 28 #include <eigen3/Eigen/Core> 29 #include <eigen3/Eigen/Geometry> 32 #define RESTORING_FORCE "restoring_force" 33 #define UUV_DAMPING_FORCE "damping_force" 34 #define UUV_DAMPING_TORQUE "damping_torque" 35 #define UUV_ADDED_CORIOLIS_FORCE "coriolis_force" 36 #define UUV_ADDED_CORIOLIS_TORQUE "coriolis_torque" 37 #define UUV_ADDED_MASS_FORCE "added_mass_force" 38 #define UUV_ADDED_MASS_TORQUE "added_mass_torque" 52 #define PI 3.14159265359 55 inline std::vector<double>
Str2Vector(std::string _input)
57 std::vector<double> output;
59 std::stringstream ss(_input);
61 output.push_back(std::stod(buf));
69 Eigen::Matrix3d output;
70 output << 0.0, -_x[2], _x[1], _x[2], 0.0, -_x[0], -_x[1], _x[0], 0.0;
78 Eigen::Matrix3d output;
79 output << 0.0, -_x[2], _x[1], _x[2], 0.0, -_x[0], -_x[1], _x[0], 0.0;
83 inline Eigen::Vector3d
ToEigen(
const ignition::math::Vector3d &_x)
85 return Eigen::Vector3d(_x[0], _x[1], _x[2]);
88 inline Eigen::Matrix3d
ToEigen(
const ignition::math::Matrix3d &_x)
91 m << _x(0, 0), _x(0, 1), _x(0, 2),
92 _x(1, 0), _x(1, 1), _x(1, 2),
93 _x(2, 0), _x(2, 1), _x(2, 2);
98 const ignition::math::Vector3d &_y)
100 Eigen::Vector3d xe =
ToEigen(_x);
101 Eigen::Vector3d ye =
ToEigen(_y);
109 return ignition::math::Vector3d(_x[0], _x[1], _x[2]);
114 return ignition::math::Matrix3d(_x(0, 0), _x(0, 1), _x(0, 2),
115 _x(1, 0), _x(1, 1), _x(1, 2),
116 _x(2, 0), _x(2, 1), _x(2, 2));
Eigen::Matrix3d ToEigen(const ignition::math::Matrix3d &_x)
ignition::math::Vector3d Vec3dToGazebo(const Eigen::Vector3d &_x)
Eigen::Matrix< double, 6, 1 > Vector6d
Definition of a 6 element Eigen vector.
Eigen::Matrix3d CrossProductOperator(ignition::math::Vector3d _x)
Returns the cross product operator matrix for Gazebo vectors.
Eigen::Vector6d EigenStack(const ignition::math::Vector3d &_x, const ignition::math::Vector3d &_y)
ignition::math::Matrix3d Mat3dToGazebo(const Eigen::Matrix3d &_x)
Eigen::Matrix< double, 6, 6 > Matrix6d
Definition of a 6x6 Eigen matrix.
std::vector< double > Str2Vector(std::string _input)
Conversion of a string to a double vector.