From 7caef580bee0e90097883d14ad3ae671a6fab213 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Sun, 12 May 2024 03:55:01 -0400 Subject: [PATCH 1/2] Adding cone primitives. Squashing commits to make requested target of main with backports to harmonic. Signed-off-by: Benjamin Perseghetti --- core/include/gz/msgs/convert/GeometryType.hh | 9 +++++++++ proto/gz/msgs/particle_emitter.proto | 2 ++ 2 files changed, 11 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; From 398374122547d78a8374acfdb61d9b3298844491 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Thu, 16 May 2024 13:32:48 -0400 Subject: [PATCH 2/2] Add cone to utility test. Signed-off-by: Benjamin Perseghetti --- test/integration/Utility_TEST.cc | 1 + 1 file changed, 1 insertion(+) 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);