Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ release will remove the deprecated code.
const msgs::SphericalCoordinatesType &_sc)`
does not accept `msgs::SphericalCoordinatesType::LOCAL2` anymore.

1. **MessageFactory.hh**
+ The function `MessageFactory::MessagePtr MessageFactory::New(
const std::string &_msgType)` does not accept non-fully qualified names
anymore.

## Gazebo Msgs 10.X to 11.X
### Deprecations

Expand Down
15 changes: 15 additions & 0 deletions core/src/MessageFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ MessageFactory::MessagePtr MessageFactory::New(
};

auto ret = getMessagePtr(type);

// Message was not found in either static or dynamic message types,
// try again adding the gz.msgs prefix
if (nullptr == ret)
{
ret = getMessagePtr(kGzMsgsPrefix + type);
if (nullptr != ret)
{
// Do not remove this until support is added to gz-transport:
// https://github.com/gazebosim/gz-transport/issues/435
std::cerr << "Message (" << kGzMsgsPrefix + type
<< ") was retrieved with non-fully qualified name. "
<< "This behavior is deprecated in msgs12" << std::endl;
}
}
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Factory_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ TEST(FactoryTest, NewWithMalformedData)
TEST(FactoryTest, DeprecatedNonFullyQualified)
{
auto msg = Factory::New("StringMsg");
EXPECT_TRUE(msg.get() == nullptr);
EXPECT_TRUE(msg.get() != nullptr);
}

/////////////////////////////////////////////////
Expand Down