@@ -52,11 +52,34 @@ inline Eigen::Isometry3d pose_from_rotation_translation(const Eigen::Quaterniond
52
52
}
53
53
54
54
/* *
55
- * Change a point's frame of reference.
56
- * Both the point and the child frame need to have the same parent frame.
55
+ * Compute the roll, pitch and yaw angles from a given pose.
56
+ *
57
+ * \param pose: Pose of which the rotation matrix shall be expressed in Euler angles.
58
+ */
59
+ inline Eigen::Vector3d get_pose_roll_pitch_yaw (const Eigen::Isometry3d& pose) {
60
+ return pose.rotation ().matrix ().eulerAngles (2 , 1 , 0 ).reverse ();
61
+ }
62
+
63
+ /* *
64
+ * Change a point's frame of reference from the parent frame to the child frame.
65
+ *
66
+ * \param child_frame: Pose of the child reference frame w.r.t. the parent frame.
67
+ * \param pt_vec: Point coordinate vector w.r.t. the parent frame.
68
+ */
69
+ inline void transform_point_to_child_frame (const Eigen::Isometry3d& child_frame,
70
+ Eigen::Vector3d* pt_vec) {
71
+ *pt_vec = child_frame.inverse () * (*pt_vec);
72
+ }
73
+
74
+ /* *
75
+ * Change a point's frame of reference from the child frame to the parent frame.
76
+ *
77
+ * \param child_frame: Pose of the child reference frame w.r.t. the parent frame.
78
+ * \param pt_vec_child: Point coordinate vector w.r.t. the child frame.
57
79
*/
58
- inline void transform_to_child_frame (const Eigen::Isometry3d& child_frame, Eigen::Vector3d* point) {
59
- *point = child_frame.inverse () * (*point);
80
+ inline void transform_point_to_parent_frame (const Eigen::Isometry3d& child_frame,
81
+ Eigen::Vector3d* pt_vec_child) {
82
+ *pt_vec_child = child_frame * (*pt_vec_child);
60
83
}
61
84
62
85
} // namespace utility
0 commit comments