From 7e9ac91c1cdc45ec0164255d9f99dc3e624e3b38 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Fri, 17 May 2024 13:58:02 -0400 Subject: [PATCH] Adding cone primitives. (#442) Signed-off-by: Benjamin Perseghetti --- core/include/gz/msgs/convert/GeometryType.hh | 9 +++++++++ proto/gz/msgs/particle_emitter.proto | 2 ++ test/integration/Utility_TEST.cc | 1 + 3 files changed, 12 insertions(+) diff --git a/core/include/gz/msgs/convert/GeometryType.hh b/core/include/gz/msgs/convert/GeometryType.hh index 155adc4d..167e18c3 100644 --- a/core/include/gz/msgs/convert/GeometryType.hh +++ b/core/include/gz/msgs/convert/GeometryType.hh @@ -41,6 +41,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; @@ -100,6 +104,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/proto/gz/msgs/particle_emitter.proto b/proto/gz/msgs/particle_emitter.proto index 564b88ff..e5e478a1 100644 --- a/proto/gz/msgs/particle_emitter.proto +++ b/proto/gz/msgs/particle_emitter.proto @@ -55,6 +55,8 @@ message ParticleEmitter CYLINDER = 2; /// \brief Ellipsoid emitter. ELLIPSOID = 3; + /// \brief Cone emitter. + CONE = 4; } /// \brief The emitter type. EmitterType type = 4; 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);