gazebosim / gz-msgs

Messages for Gazebo robot simulation.
https://gazebosim.org
Apache License 2.0
23 stars 47 forks source link

MessageFactory::Types returns duplicate message types #470

Closed VincidaB closed 1 month ago

VincidaB commented 1 month ago

Environment

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.

https://github.com/gazebosim/gz-msgs/blob/eaf96af23a10344366d1b457141ffc982d73fd4e/core/src/MessageFactory.cc#L129-L142

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 : https://github.com/gazebosim/gz-msgs/blob/eaf96af23a10344366d1b457141ffc982d73fd4e/core/src/MessageFactory.cc#L141

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