Skip to content

Commit

Permalink
Adding cone primitives. (gazebosim#442)
Browse files Browse the repository at this point in the history

Signed-off-by: Benjamin Perseghetti <[email protected]>
  • Loading branch information
bperseghetti committed May 17, 2024
1 parent 459478a commit 15f2cd6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/include/gz/msgs/convert/GeometryType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions proto/gz/msgs/particle_emitter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions test/integration/Utility_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 15f2cd6

Please sign in to comment.