Skip to content
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

Not a bug persay but a question! #126

Open
bulldogc opened this issue Jul 5, 2023 · 6 comments
Open

Not a bug persay but a question! #126

bulldogc opened this issue Jul 5, 2023 · 6 comments

Comments

@bulldogc
Copy link

bulldogc commented Jul 5, 2023

I have a custom node to receive the outgoing detections topic and would like to display the detection IDs and confidence. I was able to output hypothesis.class_id and .score to do this but the ID is not the real text ID but instead (I assume?) the internal network ID. Based on the detectnet code I assume I am suppose to call GetModelPath, but that requires setting up a full detectNet object on the receiving node. Seems like this subscriber node shouldn't care about the network at all if all it wants is the data hat the node is spitting out. Am i missing something in the message structure that stores the plain text objects? OR is there a better way to convert the coded object id to plain text?

@dusty-nv
Copy link
Owner

dusty-nv commented Jul 5, 2023

Hi @bulldogc, the detectNet node follows the vision_msgs paradigm of exposing the class labels through ROS params, and the database name info you are looking for (based on a hash of the model path and model name) is published through the vision_info topic:

// populate the vision info msg

so subscribe to vision_info, and this will give you a vision_msgs::VisionInfo message where the database_location is the ROS param to query that contains the class label list. Then fetch that ROS param, and it will return you a list of the class names (the raw IDs correspond to their index in the list)

@bulldogc
Copy link
Author

bulldogc commented Jul 5, 2023

Thanks for the quick replay, so I checked my setup, and I am seeing /detectnet/class_labels_3185375291238328062 as the topic stored with database_location but no matching published topic for it if I try to ros2 topic echo it. also doesn't show up in ros2 topic list. Do I a param in detect net to publish this topic or something?

If it matters any I have re-mapped some the various detectnet nodes to "/sensors/video0/..." there is no similar looking topic being published in that grouping either though as reported by topic list.

@dusty-nv
Copy link
Owner

dusty-nv commented Jul 5, 2023

/detectnet/class_labels_3185375291238328062 as the topic stored with database_location but no matching published topic for it if I try to ros2 topic echo it

/detectnet/class_labels_3185375291238328062 isn't a topic, it's a param. Try listing the params instead and see if you can find it that way.

@bulldogc
Copy link
Author

bulldogc commented Jul 5, 2023

oooo yep there it is indeed! thanks!

@bulldogc bulldogc closed this as completed Jul 5, 2023
@bulldogc bulldogc reopened this Mar 12, 2024
@bulldogc
Copy link
Author

Got locked away from a while so finally got back to this. Having some issues accessing the params, might not be the best place to ask but figured I'd try.

So I was able to pull the info from the vision topic and see that it points me to a param xxx/class_labels_XXXX. in my subscriber I am attempting to access the param using

auto parameters_client = std::make_shared<rclcpp::SyncParametersClient>(this, "detectnetnodename"); while (!parameters_client->wait_for_service(1s)) { if (!rclcpp::ok()) { RCLCPP_ERROR(this->get_logger(), "Interrupted while waiting for the service. Exiting."); rclcpp::shutdown(); } RCLCPP_INFO(this->get_logger(), "service not available, waiting again..."); }

but it never seems to connect, jsut spins on service not available waiting again. any ideas what im doing wrong?

@bulldogc
Copy link
Author

bulldogc commented Mar 12, 2024

Additional thing that I noticed, it looks like the path published to vision_info doesn't match up with the node name, in my case I am launching detect net with the node name /detectnet/video0_detectnet and the ros2 param list is showing that the params are being published to /detectnet/video0_detectnet/class_labels_XXX but the topic is reporting that they are at database_location: /detectnet/class_labels_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants