Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageFactory::Types returns duplicate message types #470

Open
VincidaB opened this issue Oct 10, 2024 · 0 comments
Open

MessageFactory::Types returns duplicate message types #470

VincidaB opened this issue Oct 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@VincidaB
Copy link

VincidaB commented Oct 10, 2024

Environment

  • OS Version: Ubuntu 24.04 (docker)
  • Source or binary build?
    Harmonic
    And harmonic from source

Description

Multiple identical types sent by MessageFactory::Types()
This issues was found as it breaks gazebo web, and is mentioned on gz-launch issue #246.

Steps to reproduce

  1. Install gz-harmonic
  2. On a terminal run gz sim -v 4 -s -r shapes.sdf
  3. In another terminal run gz launch -v 4 /usr/share/gz/gz-launch7/configs/websocket.gzlaunch
  4. Go to web app and click connect

Output

In the browser's console we get

ERROR Error: duplicate name 'Any' in Namespace .gz.msgs

cf the aforementioned gz-launch issue where the op posted logs.

I was able to fix the problem on the gz-launch side of things but my fix isn't great for many reasons.

void MessageFactory::Types(std::vector<std::string> &_types)
{
_types.clear();
// Return the list of all known message types.
std::map<std::string, FactoryFn>::const_iterator iter;
for (iter = msgMap.begin(); iter != msgMap.end(); ++iter)
{
_types.push_back(iter->first);
}
// Add the types loaded from descriptor files
this->dynamicFactory->Types(_types);
}

I am not familiar yet with all of gazebo's components, and not at all with gz-msgs, but the above piece of code might be responsible for adding additional messages on the line :

this->dynamicFactory->Types(_types);

The messages that are part of msgMap have no duplicate of course, but after wrench, we get an additional message of type Any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

1 participant