diff --git a/plugins/telemetry/include/plugins/telemetry/telemetry.h b/plugins/telemetry/include/plugins/telemetry/telemetry.h index a944c775aa..31f8875c57 100644 --- a/plugins/telemetry/include/plugins/telemetry/telemetry.h +++ b/plugins/telemetry/include/plugins/telemetry/telemetry.h @@ -732,6 +732,28 @@ bool operator==(const Telemetry::Position &lhs, const Telemetry::Position &rhs); */ std::ostream &operator<<(std::ostream &str, Telemetry::Position const &position); +/** + * @brief Stream operator to print information about a `Telemetry::PositionNED`. + * + * @return A reference to the stream. + */ +std::ostream &operator<<(std::ostream &str, Telemetry::PositionNED const &position_ned); + +/** + * @brief Stream operator to print information about a `Telemetry::VelocityNED`. + * + * @return A reference to the stream. + */ +std::ostream &operator<<(std::ostream &str, Telemetry::VelocityNED const &velocity_ned); + +/** + * @brief Stream operator to print information about a `Telemetry::PositionVelocityNED`. + * + * @return A reference to the stream. + */ +std::ostream &operator<<(std::ostream &str, + Telemetry::PositionVelocityNED const &position_velocity_ned); + /** * @brief Equal operator to compare two `Telemetry::Health` objects. * diff --git a/plugins/telemetry/telemetry.cpp b/plugins/telemetry/telemetry.cpp index 2cef33b72f..b4c705238c 100644 --- a/plugins/telemetry/telemetry.cpp +++ b/plugins/telemetry/telemetry.cpp @@ -353,6 +353,31 @@ std::ostream &operator<<(std::ostream &str, Telemetry::Position const &position) << ", rel_alt: " << position.relative_altitude_m << "]"; } +std::ostream &operator<<(std::ostream &str, Telemetry::PositionNED const &position_ned) +{ + return str << "[position_north_m: " << position_ned.north_m + << ", position_east_m: " << position_ned.east_m + << ", position_down_m: " << position_ned.down_m << "]"; +} + +std::ostream &operator<<(std::ostream &str, Telemetry::VelocityNED const &velocity_ned) +{ + return str << "[velocity_north_m_s: " << velocity_ned.north_m_s + << ", velocity_east_m_s: " << velocity_ned.east_m_s + << ", velocity_down_m_s: " << velocity_ned.down_m_s << "]"; +} + +std::ostream &operator<<(std::ostream &str, + Telemetry::PositionVelocityNED const &position_velocity_ned) +{ + return str << "[position_north_m: " << position_velocity_ned.position.north_m + << ", position_east_m: " << position_velocity_ned.position.east_m + << ", position_down_m: " << position_velocity_ned.position.down_m << "] " + << "[velocity_north_m_s: " << position_velocity_ned.velocity.north_m_s + << ", velocity_east_m_s: " << position_velocity_ned.velocity.east_m_s + << ", velocity_down_m_s: " << position_velocity_ned.velocity.down_m_s << "]"; +} + bool operator==(const Telemetry::Health &lhs, const Telemetry::Health &rhs) { return lhs.gyrometer_calibration_ok == rhs.gyrometer_calibration_ok &&