python connector- get sender's ID

4 posts / 0 new
Last post
Offline
Last seen: 4 weeks 15 hours ago
Joined: 08/12/2021
Posts: 14
python connector- get sender's ID

I'm getting started with python connector.  I'm able to communicate with some existing topics that are written/read from c++ services.  When I read/take data from the bus using connector, is it possible to know who the sender is?  I know that doing a 

input.wait_for_publications()

print(input.matched_publications) 

will give me a the names of publications.  However, the names are all 'None', except for Admin Console that I have running.  

When I do input.take(), is there a way to see who the sender is?  Admin console is able to display the process id's.  Can I do something similar in connector?

 

Thanks!

Bobby

Offline
Last seen: 4 weeks 1 day ago
Joined: 04/02/2013
Posts: 174

You have to set a publication name for your writers if you want to see the publication name in Connector:

See EntityName Qos policy: https://community.rti.com/static/documentation/connext-dds/6.1.0/doc/manuals/connext_dds_professional/qos_reference/index.htm#qos_reference/qos_guide_all_in_one.htm#EntityNa

Connector documentation: https://community.rti.com/static/documentation/connector/1.1.0/api/python/input.html#rticonnextdds_connector.Input.matched_publications

In your XML configuration set:

...

<datawriter_qos>
<publication_name>
<name>My Publication</name>
</publication_name>
...
</datawriter_qos>

...

 

Offline
Last seen: 4 weeks 15 hours ago
Joined: 08/12/2021
Posts: 14

Thanks alexc.  I have some existing services that publish to topics, and I'm hoping to not change any source code or configuration.  They don't currently have names defined in the xml, so I was trying to find another way to identify the senders.  I notice that Admin Console knows each process ID, but I don't know how it determines that info, or if it is possible in python connector.

Offline
Last seen: 4 weeks 15 hours ago
Joined: 08/12/2021
Posts: 14

I see that there is a sample.info["identity"] that provides a writer_guid.  I think that's what I need, although I'm not yet sure how to determine which guid goes with which writer.