@@ -14,6 +14,11 @@ namespace vortex::utils::types {
1414 */
1515typedef Eigen::Matrix<double , 6 , 1 > Vector6d;
1616
17+ /* *
18+ * @brief 6x1 column vector of doubles
19+ */
20+ typedef Eigen::Matrix<double , 6 , 6 > Matrix6d;
21+
1722/* *
1823 * @brief Struct to represent the pose vector according to eq. 2.3 in
1924 * Fossen, 2021, containing the position and orientation as euler angles.
@@ -109,6 +114,7 @@ struct PoseEuler {
109114 Eigen::Matrix3d as_rotation_matrix () const {
110115 return vortex::utils::math::get_rotation_matrix (roll, pitch, yaw);
111116 }
117+
112118 /* *
113119 * @brief Make the transformation matrix according to eq. 2.41 in Fossen,
114120 * 2021
@@ -210,6 +216,10 @@ struct Pose {
210216 return quat.normalized ();
211217 }
212218
219+ Eigen::Vector3d ori_quaternion_vector_part () const {
220+ return Eigen::Vector3d{qx, qy, qz};
221+ }
222+
213223 /* *
214224 * @brief Set the position from an Eigen::Vector3d.
215225 * @param pos Eigen::Vector3d
@@ -274,6 +284,21 @@ struct Pose {
274284 ori_quaternion ());
275285 }
276286
287+ /* *
288+ * @brief Make the Q, based on quaternion derivative and error state
289+ * formulation.
290+ * @return Eigen::Matrix3d transformation matrix
291+ */
292+ Eigen::Matrix3d as_Q_matrix () const {
293+ Eigen::Matrix3d Diagonal = Eigen::Matrix3d::Identity () * qw;
294+ const Eigen::Vector3d q_vector_part = {qx, qy, qz};
295+ Eigen::Matrix3d Skewsymmetric =
296+ vortex::utils::math::get_skew_symmetric_matrix (q_vector_part);
297+
298+ Eigen::Matrix3d Q_matrix = Diagonal + Skewsymmetric;
299+ return Q_matrix;
300+ }
301+
277302 /* *
278303 * @brief Make the J matrix according to eq. 2.83 in Fossen, 2021
279304 * @return Eigen::Matrix<double, 7, 6> J matrix
@@ -289,6 +314,21 @@ struct Pose {
289314
290315 return j_matrix;
291316 }
317+
318+ /* *
319+ * @brief Make the J matrix according to eq. 2.83 in Fossen, 2021
320+ * @return Eigen::Matrix<double, 7, 6> J matrix
321+ */
322+ Matrix6d as_L_matrix () const {
323+ Eigen::Matrix3d R = as_rotation_matrix ();
324+ Eigen::Matrix3d Q = as_Q_matrix ();
325+
326+ Matrix6d L_matrix = Matrix6d::Zero ();
327+ L_matrix.topLeftCorner <3 , 3 >() = R;
328+ L_matrix.bottomRightCorner <3 , 3 >() = Q;
329+ return L_matrix;
330+ }
331+
292332 /* *
293333 * @brief Convert to PoseEuler with Euler angles
294334 * @return PoseEuler
0 commit comments