diff --git a/src/Conversions.cc b/src/Conversions.cc index 33548a6843..1ef5df8f82 100644 --- a/src/Conversions.cc +++ b/src/Conversions.cc @@ -259,6 +259,10 @@ msgs::Geometry gz::sim::convert(const sdf::Geometry &_in) } } } + else if (_in.Type() == sdf::GeometryType::EMPTY) + { + out.set_type(msgs::Geometry::EMPTY); + } else { gzerr << "Geometry type [" << static_cast(_in.Type()) diff --git a/src/Conversions_TEST.cc b/src/Conversions_TEST.cc index 3d6e3e5861..2e7deecdd0 100644 --- a/src/Conversions_TEST.cc +++ b/src/Conversions_TEST.cc @@ -1206,3 +1206,13 @@ TEST(Conversions, MsgsPluginToSdf) EXPECT_EQ(innerXml, sdfPlugins[1].Contents()[0]->ToString("")); EXPECT_EQ(innerXml2, sdfPlugins[1].Contents()[1]->ToString("")); } + +///////////////////////////////////////////////// +TEST(Conversions, GeometryEmpty) +{ + sdf::Geometry geometry; + geometry.SetType(sdf::GeometryType::EMPTY); + + auto geometryMsg = convert(geometry); + EXPECT_EQ(msgs::Geometry::EMPTY, geometryMsg.type()); +}