6 #ifndef MRS_LIB_MSG_EXTRACTOR_H
7 #define MRS_LIB_MSG_EXTRACTOR_H
9 #include <mrs_msgs/TrackerCommand.h>
10 #include <mrs_msgs/Reference.h>
11 #include <mrs_msgs/ReferenceStamped.h>
13 #include <nav_msgs/Odometry.h>
29 std::tuple<double, double, double>
getXYZ(
const geometry_msgs::Point& data) {
35 return std::tuple(x, y, z);
45 std::tuple<double, double, double>
getXYZ(
const geometry_msgs::PointConstPtr& data) {
61 std::tuple<double, double, double>
getXYZ(
const geometry_msgs::Vector3& data) {
67 return std::tuple(x, y, z);
77 std::tuple<double, double, double>
getXYZ(
const geometry_msgs::Vector3ConstPtr& data) {
95 std::tuple<double, double, double>
getPosition(
const geometry_msgs::Pose& data) {
97 return getXYZ(data.position);
107 std::tuple<double, double, double>
getPosition(
const geometry_msgs::PoseConstPtr& data) {
151 double getYaw(
const geometry_msgs::Pose& data) {
163 double getYaw(
const geometry_msgs::PoseConstPtr& data) {
183 std::tuple<double, double, double>
getPosition(
const geometry_msgs::PoseWithCovariance& data) {
195 std::tuple<double, double, double>
getPosition(
const geometry_msgs::PoseWithCovarianceConstPtr& data) {
211 double getHeading(
const geometry_msgs::PoseWithCovariance& data) {
223 double getHeading(
const geometry_msgs::PoseWithCovarianceConstPtr& data) {
239 double getYaw(
const geometry_msgs::PoseWithCovariance& data) {
251 double getYaw(
const geometry_msgs::PoseWithCovarianceConstPtr& data) {
271 std::tuple<double, double, double>
getVelocity(
const geometry_msgs::Twist& data) {
273 return getXYZ(data.linear);
283 std::tuple<double, double, double>
getPosition(
const geometry_msgs::TwistConstPtr& data) {
303 std::tuple<double, double, double>
getVelocity(
const geometry_msgs::TwistWithCovariance& data) {
315 std::tuple<double, double, double>
getPosition(
const geometry_msgs::TwistWithCovarianceConstPtr& data) {
335 std::tuple<double, double, double>
getPosition(
const nav_msgs::Odometry& data) {
347 std::tuple<double, double, double>
getPosition(
const nav_msgs::OdometryConstPtr& data) {
363 std::tuple<double, double, double>
getVelocity(
const nav_msgs::Odometry& data) {
375 std::tuple<double, double, double>
getVelocity(
const nav_msgs::OdometryConstPtr& data) {
419 double getYaw(
const nav_msgs::Odometry& data) {
431 double getYaw(
const nav_msgs::OdometryConstPtr& data) {
447 geometry_msgs::Pose
getPose(
const nav_msgs::Odometry& data) {
449 return data.pose.pose;
459 geometry_msgs::Pose
getPose(
const nav_msgs::OdometryConstPtr& data) {
479 std::tuple<double, double, double>
getPosition(
const mrs_msgs::TrackerCommand& data) {
481 return getXYZ(data.position);
491 std::tuple<double, double, double>
getPosition(
const mrs_msgs::TrackerCommandConstPtr& data) {
507 std::tuple<double, double, double>
getVelocity(
const mrs_msgs::TrackerCommand& data) {
509 return getXYZ(data.velocity);
519 std::tuple<double, double, double>
getVelocity(
const mrs_msgs::TrackerCommandConstPtr& data) {
539 if (data.use_heading) {
541 heading = data.heading;
543 }
else if (data.use_orientation) {
558 double getHeading(
const mrs_msgs::TrackerCommandConstPtr& data) {
578 std::tuple<double, double, double>
getPosition(
const mrs_msgs::Reference& data) {
580 return getXYZ(data.position);
590 std::tuple<double, double, double>
getPosition(
const mrs_msgs::ReferenceConstPtr& data) {
638 std::tuple<double, double, double>
getPosition(
const mrs_msgs::ReferenceStamped& data) {
650 std::tuple<double, double, double>
getPosition(
const mrs_msgs::ReferenceStampedConstPtr& data) {
678 double getHeading(
const mrs_msgs::ReferenceStampedConstPtr& data) {
691 #endif // MRS_LIB_MSG_EXTRACTOR_H