From dd209231c58001775d0358c60a6d90b090641052 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Mon, 17 Jun 2024 22:22:50 -0400 Subject: [PATCH] Backport: Adding cone primitives. (#442) Signed-off-by: Benjamin Perseghetti --- core/include/gz/msgs/convert/GeometryType.hh | 9 +++++++++ test/integration/Utility_TEST.cc | 1 + 2 files changed, 10 insertions(+) diff --git a/core/include/gz/msgs/convert/GeometryType.hh b/core/include/gz/msgs/convert/GeometryType.hh index e8152fd7..fb238045 100644 --- a/core/include/gz/msgs/convert/GeometryType.hh +++ b/core/include/gz/msgs/convert/GeometryType.hh @@ -39,6 +39,10 @@ inline msgs::Geometry::Type ConvertGeometryType(const std::string &_str) { result = msgs::Geometry::CAPSULE; } + else if (_str == "cone") + { + result = msgs::Geometry::CONE; + } else if (_str == "cylinder") { result = msgs::Geometry::CYLINDER; @@ -98,6 +102,11 @@ inline std::string ConvertGeometryType(const msgs::Geometry::Type _type) result = "capsule"; break; } + case msgs::Geometry::CONE: + { + result = "cone"; + break; + } case msgs::Geometry::CYLINDER: { result = "cylinder"; diff --git a/test/integration/Utility_TEST.cc b/test/integration/Utility_TEST.cc index 8c40d89f..634afbe3 100644 --- a/test/integration/Utility_TEST.cc +++ b/test/integration/Utility_TEST.cc @@ -1003,6 +1003,7 @@ TEST(MsgsTest, ConvertMsgsGeometryTypeToString) CompareMsgsGeometryTypeToString(msgs::Geometry::BOX); CompareMsgsGeometryTypeToString(msgs::Geometry::SPHERE); CompareMsgsGeometryTypeToString(msgs::Geometry::CAPSULE); + CompareMsgsGeometryTypeToString(msgs::Geometry::CONE); CompareMsgsGeometryTypeToString(msgs::Geometry::CYLINDER); CompareMsgsGeometryTypeToString(msgs::Geometry::ELLIPSOID); CompareMsgsGeometryTypeToString(msgs::Geometry::PLANE);