9 #include <px4_msgs/msg/vehicle_attitude.hpp>
10 #include <px4_ros2/common/context.hpp>
11 #include <px4_ros2/utils/geometry.hpp>
12 #include <px4_ros2/utils/subscription.hpp>
35 const px4_msgs::msg::VehicleAttitude & att =
last();
36 return Eigen::Quaternionf{att.q[0], att.q[1], att.q[2], att.q[3]};
Definition: context.hpp:20
Provides access to the vehicle's attitude estimate.
Definition: attitude.hpp:24
Eigen::Quaternionf attitude() const
Get the vehicle's attitude.
Definition: attitude.hpp:33
float pitch() const
Get the vehicle's pitch in extrinsic RPY order.
Definition: attitude.hpp:54
float roll() const
Get the vehicle's roll in extrinsic RPY order.
Definition: attitude.hpp:44
float yaw() const
Get the vehicle's yaw in extrinsic RPY order.
Definition: attitude.hpp:64
Provides a subscription to arbitrary ROS topics.
Definition: subscription.hpp:23
const px4_msgs::msg::VehicleAttitude & last() const
Get the last-received message.
Definition: subscription.hpp:58
Type quaternionToRoll(const Eigen::Quaternion< Type > &q)
Convert quaternion to roll angle in extrinsic RPY order (intrinsic YPR)
Definition: geometry.hpp:148
Type quaternionToPitch(const Eigen::Quaternion< Type > &q)
Convert quaternion to pitch angle in extrinsic RPY order (intrinsic YPR)
Definition: geometry.hpp:165
Type quaternionToYaw(const Eigen::Quaternion< Type > &q)
Convert quaternion to yaw angle in extrinsic RPY order (intrinsic YPR)
Definition: geometry.hpp:182