eProsima / Micro-XRCE-DDS

An XRCE DDS implementation. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
156 stars 17 forks source link

Can I get topic_id automatically? #71

Closed liyue75 closed 3 years ago

liyue75 commented 3 years ago

When I use uxr_buffer_create_topic_xml to create a topic, I have to specify a object_id which is the identifier of the XRCE Topic. But if there are lots of devices and lots of topics, it is hard to maintain these topic id, topic name and topic type. Can DDS-Agent generate topic_id by topic_name and topic_type? so that I can ask the agent for the topic id.

liyue75 commented 3 years ago

Can I use different topic id for the same topic name and type in different participant? If so, I just need to make sure that different topics have different id in same participant, without having to worry about whether it's id conflicts with other topic in other participant. I mean is topic id only valid within a participant?

pablogs9 commented 3 years ago

But if there are lots of devices and lots of topics, it is hard to maintain these topic id, topic name and topic type. Can DDS-Agent generate topic_id by topic_name and topic_type?

Currently, it is not implemented a way of auto-generating topics id and is the client who needs to identify its own entities by creating a related uxrObjectId.

Can I use different topic id for the same topic name and type in different participant?

An uxrObjectId is an identifier for an object inside of the context of an XRCE session. So once you create an XRCE session, all the objects that that client creates should have a unique uxrObjectId. Objects created from different XRCE sessions can have duplicated uxrObjectId. So, if your participants are created from different sessions, yes, they can use the same uxrObjectId for the topic, if you create all your DDS participants within the same XRCE session you should take care of the

If so, I just need to make sure that different topics have different id in same participant, without having to worry about whether it's id conflicts with other topic in other participant. I mean is topic id only valid within a participant?

That's it.