From b129021907256dbed33e04a9633ec5a340398c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ag=C3=BCero?= Date: Wed, 4 Dec 2024 21:40:02 +0100 Subject: [PATCH] Remove deprecations: tock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Agüero --- Migration.md | 32 +++++++++++++++++++ .../gz/msgs/convert/SphericalCoordinates.hh | 17 ++-------- core/src/MessageFactory.cc | 13 -------- proto/gz/msgs/camerasensor.proto | 2 +- proto/gz/msgs/gps.proto | 4 +++ proto/gz/msgs/gps_sensor.proto | 4 +++ proto/gz/msgs/spherical_coordinates.proto | 3 -- test/integration/Factory_TEST.cc | 2 +- test/integration/Utility_TEST.cc | 21 ++---------- 9 files changed, 46 insertions(+), 52 deletions(-) diff --git a/Migration.md b/Migration.md index 1f2918c9..5516e87b 100644 --- a/Migration.md +++ b/Migration.md @@ -5,6 +5,38 @@ Deprecated code produces compile-time warnings. These warning serve as notification to users that their code should be upgraded. The next major release will remove the deprecated code. +## Gazebo Msgs 11.X to 12.X + +### Deprecations + +1. **camerasensor.proto** + + The `image_format` field is deprecated. Use `pixel_format` instead. + +1. **gps.proto** + + This message is deprecated. Use `NavSat` instead. + +1. **gps_sensor.proto** + + This message is deprecated. Use `NavSat` instead. + +### Removals + +1. **spherical_coordinates.proto** + + The `LOCAL2` item has been removed from the + `msgs::SphericalCoordinatesType` enum. + +1. **spherical_coordinates.hh** + + The function `inline msgs::SphericalCoordinatesType ConvertCoord( + const math::SphericalCoordinates::CoordinateType &_sc)` + does not accept `math::SphericalCoordinates::CoordinatesType::LOCAL2` anymore. + + The function `inline math::SphericalCoordinates::CoordinateType Convert( + const msgs::SphericalCoordinatesType &_sc)` + does not accept `msgs::SphericalCoordinatesType::LOCAL2` anymore. + +1. **MessageFactory.hh** + + The function `MessageFactory::MessagePtr MessageFactory::New( + const std::string &_msgType)` does not accept non-fully qualified names + anymore. + ## Gazebo Msgs 10.X to 11.X ### Deprecations diff --git a/core/include/gz/msgs/convert/SphericalCoordinates.hh b/core/include/gz/msgs/convert/SphericalCoordinates.hh index 484b8eb7..95860b21 100644 --- a/core/include/gz/msgs/convert/SphericalCoordinates.hh +++ b/core/include/gz/msgs/convert/SphericalCoordinates.hh @@ -34,9 +34,7 @@ inline namespace GZ_MSGS_VERSION_NAMESPACE { inline msgs::SphericalCoordinatesType ConvertCoord( const math::SphericalCoordinates::CoordinateType &_sc) { - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - auto result = msgs::SphericalCoordinatesType::LOCAL2; - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION + auto result = msgs::SphericalCoordinatesType::LOCAL; switch (_sc) { case math::SphericalCoordinates::CoordinateType::ECEF: @@ -51,11 +49,6 @@ inline msgs::SphericalCoordinatesType ConvertCoord( case math::SphericalCoordinates::CoordinateType::LOCAL: result = msgs::SphericalCoordinatesType::LOCAL; break; - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - case math::SphericalCoordinates::CoordinateType::LOCAL2: - result = msgs::SphericalCoordinatesType::LOCAL2; - break; - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION default: std::cerr << "Invalid coordinate type passed" << std::endl; } @@ -76,16 +69,10 @@ inline math::SphericalCoordinates::CoordinateType Convert( return math::SphericalCoordinates::CoordinateType::SPHERICAL; case msgs::SphericalCoordinatesType::LOCAL: return math::SphericalCoordinates::CoordinateType::LOCAL; - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - case msgs::SphericalCoordinatesType::LOCAL2: - return math::SphericalCoordinates::CoordinateType::LOCAL2; - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION default: std::cerr << "Invalid coordinate type passed" << std::endl; } - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - return math::SphericalCoordinates::CoordinateType::LOCAL2; - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION + return math::SphericalCoordinates::CoordinateType::LOCAL; } ///////////////////////////////// diff --git a/core/src/MessageFactory.cc b/core/src/MessageFactory.cc index f246d877..4c432cd2 100644 --- a/core/src/MessageFactory.cc +++ b/core/src/MessageFactory.cc @@ -92,19 +92,6 @@ MessageFactory::MessagePtr MessageFactory::New( }; auto ret = getMessagePtr(type); - - // Message was not found in either static or dynamic message types, - // try again adding the gz.msgs prefix - if (nullptr == ret) - { - ret = getMessagePtr(kGzMsgsPrefix + type); - if (nullptr != ret) - { - std::cerr << "Message (" << kGzMsgsPrefix + type - << ") was retrieved with non-fully qualified name. " - << "This behavior is deprecated in msgs12" << std::endl; - } - } return ret; } diff --git a/proto/gz/msgs/camerasensor.proto b/proto/gz/msgs/camerasensor.proto index 65cc19c3..2ece4ce2 100644 --- a/proto/gz/msgs/camerasensor.proto +++ b/proto/gz/msgs/camerasensor.proto @@ -75,7 +75,7 @@ message CameraSensor Vector2d image_size = 3; /// \brief Image format. This field is deprecated, please use pixel_format. - string image_format = 4; + string image_format = 4 [deprecated = true]; /// \brief Near clip distance in meters. double near_clip = 5; diff --git a/proto/gz/msgs/gps.proto b/proto/gz/msgs/gps.proto index 9207a2b7..0334b73a 100644 --- a/proto/gz/msgs/gps.proto +++ b/proto/gz/msgs/gps.proto @@ -24,11 +24,15 @@ option java_outer_classname = "GPSProtos"; /// \interface GPS /// \brief Data from a GPS sensor /// This message will be deprecated, use NavSat instead. +/// Remove this message in gz-msgs13. import "gz/msgs/header.proto"; message GPS { + /// \brief Deprecated message. + option deprecated = true; + /// \brief Optional header data Header header = 1; diff --git a/proto/gz/msgs/gps_sensor.proto b/proto/gz/msgs/gps_sensor.proto index 8a4d47e5..ff650bf1 100644 --- a/proto/gz/msgs/gps_sensor.proto +++ b/proto/gz/msgs/gps_sensor.proto @@ -24,12 +24,16 @@ option java_outer_classname = "Protos"; /// \interface GPSSensor /// \brief Information about a GPS sensor element /// This message will be deprecated in favor of NavSat sensor. +/// Remove this message in gz-msgs13. import "gz/msgs/sensor_noise.proto"; import "gz/msgs/header.proto"; message GPSSensor { + /// \brief Deprecated message. + option deprecated = true; + /// \brief Sensing information message Sensing { diff --git a/proto/gz/msgs/spherical_coordinates.proto b/proto/gz/msgs/spherical_coordinates.proto index 6c3b4185..99d27ec9 100644 --- a/proto/gz/msgs/spherical_coordinates.proto +++ b/proto/gz/msgs/spherical_coordinates.proto @@ -40,9 +40,6 @@ enum SphericalCoordinatesType /// \brief Heading-adjusted tangent plane (X, Y, Z) LOCAL = 3; - - /// \brief Heading-adjusted tangent plane (X, Y, Z) - LOCAL2 = 4 [deprecated=true]; } message SphericalCoordinates diff --git a/test/integration/Factory_TEST.cc b/test/integration/Factory_TEST.cc index 37e7e2ca..fe15282c 100644 --- a/test/integration/Factory_TEST.cc +++ b/test/integration/Factory_TEST.cc @@ -100,7 +100,7 @@ TEST(FactoryTest, NewWithMalformedData) TEST(FactoryTest, DeprecatedNonFullyQualified) { auto msg = Factory::New("StringMsg"); - EXPECT_TRUE(msg.get() != nullptr); + EXPECT_TRUE(msg.get() == nullptr); } ///////////////////////////////////////////////// diff --git a/test/integration/Utility_TEST.cc b/test/integration/Utility_TEST.cc index 603dcb5a..20bbdb61 100644 --- a/test/integration/Utility_TEST.cc +++ b/test/integration/Utility_TEST.cc @@ -354,10 +354,6 @@ TEST(MsgsTest, ConvertMathSphericalCoordinatesToMsgs) msgs::ConvertCoord(math::SphericalCoordinates::CoordinateType::SPHERICAL)); EXPECT_EQ(msgs::SphericalCoordinatesType::LOCAL, msgs::ConvertCoord(math::SphericalCoordinates::CoordinateType::LOCAL)); - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - EXPECT_EQ(msgs::SphericalCoordinatesType::LOCAL2, - msgs::ConvertCoord(math::SphericalCoordinates::CoordinateType::LOCAL2)); - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION EXPECT_EQ(math::SphericalCoordinates::CoordinateType::ECEF, msgs::Convert(msgs::SphericalCoordinatesType::ECEF)); @@ -367,10 +363,6 @@ TEST(MsgsTest, ConvertMathSphericalCoordinatesToMsgs) msgs::Convert(msgs::SphericalCoordinatesType::SPHERICAL)); EXPECT_EQ(math::SphericalCoordinates::CoordinateType::LOCAL, msgs::Convert(msgs::SphericalCoordinatesType::LOCAL)); - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - EXPECT_EQ(math::SphericalCoordinates::CoordinateType::LOCAL2, - msgs::Convert(msgs::SphericalCoordinatesType::LOCAL2)); - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION auto msg = msgs::Convert( @@ -457,12 +449,8 @@ TEST(MsgsTest, ConvertMsgsSphericalCoordinatesTypeToMath) math::SphericalCoordinates::CoordinateType::SPHERICAL); EXPECT_EQ(Convert(msgs::SphericalCoordinatesType::LOCAL), math::SphericalCoordinates::CoordinateType::LOCAL); - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - EXPECT_EQ(Convert(msgs::SphericalCoordinatesType::LOCAL2), - math::SphericalCoordinates::CoordinateType::LOCAL2); EXPECT_EQ(Convert((msgs::SphericalCoordinatesType)500000), - math::SphericalCoordinates::CoordinateType::LOCAL2); - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION + math::SphericalCoordinates::CoordinateType::LOCAL); } ///////////////////////////////////////////////// @@ -480,14 +468,9 @@ TEST(MsgsTest, ConvertMathSphericalCoordinatedTypeToMsg) EXPECT_EQ(msgs::ConvertCoord( math::SphericalCoordinates::CoordinateType::LOCAL), msgs::SphericalCoordinatesType::LOCAL); - GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - EXPECT_EQ(msgs::ConvertCoord( - math::SphericalCoordinates::CoordinateType::LOCAL2), - msgs::SphericalCoordinatesType::LOCAL2); EXPECT_EQ(msgs::ConvertCoord( (math::SphericalCoordinates::CoordinateType)500000), - msgs::SphericalCoordinatesType::LOCAL2); - GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION + msgs::SphericalCoordinatesType::LOCAL); } /////////////////////////////////////////////////