-
Notifications
You must be signed in to change notification settings - Fork 118
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
Getting QoS policies of all the publishers publishing to and subscribers subscribing to a topic #319
Comments
AFAIK, you're analysis is correct. There is no way to access the data if you don't store it at discovery.
Haven't check thoroughly, but if it's not part of the discovery data I don't see a way of recover it.
Sure! any change that improves code reuse is ok.
I would have done the same, so I don't have a better way. |
@richiprosima Is this somehow available from the publisher/subscriber discovery information? |
@ivanpauno Yes, the discovery info structure has an XXXProxyData info field, that is the one processed here. This structure has an XXXQos m_qos field with the QoS parameters of the discovered endpoint. See here and here |
@richiprosima Sorry for the unclear question. |
@ivanpauno I want to display the participant name along with their QoS Profile. For this I plan on leveraging the discovered_names map, but I've observed that some participants do not have names and therefore do not have an entry in the Question 1: Why is it that some participants do not have names? Question 2: My plan is to display their name as Question 3: Is there another way to retrieve participant name that I may be missing? Moreover, on further thought, I think it makes sense to modify the ParticipantTopicMap to
As opposed to introducing a new map inside
Question 4: Have I missed something with the above change in approach? |
All nodes have names. All participants associated with a node have names. Still, the
IMO, If the participant doesn't have an entry in discovered_names, we could left the node name empty.
Using the same map sounds reasonable. And |
Alright!
If this is obvious then leaving it empty makes sense, but if not, leaving something that might help the user identify why some publishers/subscribers do not have names might be helpful IMO.
Hmm, interesting. The reason why I went with including the
Is there a reason why you prefer adding the Moreover, just to make sure that I've understood correctly, the Question: What exactly does |
Leaving a message is fine too.
Watch out, it's the participant GUID, not the publisher/subscriber GUID (see rmw_fastrtps/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_participant_info.hpp Lines 172 to 173 in 455d214
So, each entry to the map is directly associated with a node (well, with a participant). |
This is a little confusing because this line resides in a function which is called from Ok, so to summarize on the design:
struct TopicData {
vector<string> types;
vector<rmw_qos_profile_t> qos_profiles;
} Here,
bool addTopic(
const eprosima::fastrtps::rtps::InstanceHandle_t & rtpsParticipantKey,
const std::string & topic_name,
const std::string & type_name,
const WriterQos & dds_qos) {..} Question 2: Should - Question 3: how will If we can finalize on |
If we only need the "by topic" info, and we don't provide an equivalent "by node" introspection ability,
Both a template or taking directly
Good question. |
Thank you for answering these @ivanpauno
Yeah, that seems to be the only way. This is why I initially thought that modifying the `ParticipantQosMap So here is what I am thinking about the struct: struct TopicData {
vector<GUID_t> guids;
vector<string> types;
vector<rmw_qos_profile_t> qos_profiles;
} where all three have the same indexing. Alternatively, we could also have them be a Is there a reason to go for separate arrays with same indexing as opposed to encapsulating it into one type? Let me know what you think? |
Encapsulating in only one type sounds reasonable, whatever you prefer. |
@dirk-thomas this one is also complete |
Feature request
Feature description
As a part of implementing this feature for the ros2cli, some form of map of topic to publisher and subscriber qos policies need to be maintained.
Implementation considerations
Similar to how
rmw_count_publishers
andrmw_count_subscribers
works;custom_participant_info.hpp
has two variables;reader_topic_cache
andwriter_topic_cache
which can be used to get a list of subscribers and publishers to a topic represented by their GUID.Question 1: Is there a way to get Publisher and Subscriber attributes from their respective GUIDs?
Assuming that the answer to the above question is "No", I was thinking that a new
qos_cache.hpp
could be created which stores a map ofGUID
tormw_qos_profile_t
and this map could be populated inside theprocess_discovery_info
method found insidecustom_participant_info.hpp
in a manner similar to howtopic_cache
.add/removeTopic works, i.e get theWriter/ReaderQos
from their correspondingWriter/ReaderProxyData
.This leaves us with figuring out a way to convert
Writer/ReaderQos
tormw_qos_profile_t
; There is a functiondds_qos_to_rmw_qos
insideqos.hpp
. However, this method expects data of typeSubscriberAttributes
orPublisherAttributes
; this is becausermw_qos_profile
storeshistory
anddepth
data which comes fromTopicAttributes
.Question 2: How do we go about getting the TopicAttributes in this case?
Question 3: Should the
dds_qos_to_rmw_qos
function be using two functions inside: one to populate data fromTopicAttributes
and another to populate data fromWriter/ReaderQos
(this code can now be reused for our use-case)?Question 4: Is there a better way to do what I'm trying to do?
The text was updated successfully, but these errors were encountered: