29 #include "Eigen/src/Core/Matrix.h" 30 #include "geometry_msgs/Vector3.h" 34 geometry_msgs::Vector3
toMsg(
const Eigen::Vector3d& in)
36 geometry_msgs::Vector3 msg;
46 CartesianState::CartesianState()
48 p = Eigen::Vector3d::Zero();
54 v = Eigen::Vector3d::Zero();
55 v_dot = Eigen::Vector3d::Zero();
57 w = Eigen::Vector3d::Zero();
58 w_dot = Eigen::Vector3d::Zero();
61 CartesianState::CartesianState(
const cartesian_control_msgs::CartesianTrajectoryPoint& point)
66 if (q.coeffs() == Eigen::Vector4d::Zero())
84 result.
p = p - other.
p;
85 result.
q = q * other.
q.inverse();
86 result.
v = v - other.
v;
87 result.
w = w - other.
w;
96 cartesian_control_msgs::CartesianTrajectoryPoint point;
115 out <<
"p:\n" << state.
p <<
'\n';
116 out <<
"q:\n" << state.
q.coeffs() <<
'\n';
117 out <<
"v:\n" << state.
v <<
'\n';
118 out <<
"w:\n" << state.
w <<
'\n';
119 out <<
"v_dot:\n" << state.
v_dot <<
'\n';
120 out <<
"w_dot:\n" << state.
w_dot;
Eigen::Vector3d p
position
Eigen::Vector3d w
angular velocity,
std::ostream & operator<<(std::ostream &out, const CartesianState &state)
geometry_msgs::Vector3 toMsg(const Eigen::Vector3d &in)
void fromMsg(const A &, B &b)
Eigen::Vector3d v
linear velocity,
Eigen::Vector3d v_dot
linear acceleration,
Cartesian state with pose, velocity and acceleration.
Eigen::Quaterniond q
rotation
Eigen::Vector3d w_dot
angular acceleration,