Skip to content

Endpoint info never sets topic_type_hash: ros2 topic info -v shows "Topic type hash: INVALID" #46

Description

@benaliabderrahmane

ros2 topic info -v reports Topic type hash: INVALID for every endpoint. Under rmw_cyclonedds the same command shows the real RIHS01 hash.

Cause: rmw_get_publishers_info_by_topic / rmw_get_subscriptions_info_by_topic fill node name, namespace, type, QoS and gid, but never call rmw_topic_endpoint_info_set_topic_type_hash (src/rmw_graph.cpp:404-418), so the hash stays zero-initialized. RegistryEntry has no field to carry it either.

Anything that reads type hashes from endpoint info (ros2 topic info -v, rosbag2 topic metadata) gets zeros with this RMW.

Fix outline:

  • capture type_supports->get_type_hash_func(type_supports) in rmw_create_publisher / rmw_create_subscription
  • add the hash (1-byte version + 32-byte value) to RegistryEntry / RegistryEntrySlot in registry.hpp (layout static_asserts need updating)
  • set it via rmw_topic_endpoint_info_set_topic_type_hash in both *_info_by_topic functions

For reference, rmw_cyclonedds encodes the hash into USER_DATA at endpoint creation and parses it back during discovery.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions