Last active
January 30, 2024 10:26
-
-
Save simutisernestas/14047512cbffd355a5c29d0c4cbf0eb5 to your computer and use it in GitHub Desktop.
ROS2 tf2 Quaternion to RPY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
#include <tf2_geometry_msgs/tf2_geometry_msgs.h> | |
int main() | |
{ | |
.... | |
tf2::Quaternion quat_tf; | |
geometry_msgs::msg::Quaternion quat_msg = pose.pose.orientation; | |
tf2::fromMsg(quat_msg, quat_tf); | |
double r{}, p{}, y{}; | |
tf2::Matrix3x3 m(quat_tf); | |
m.getRPY(r, p, y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment