Robotics StackExchange | Archived questions

Subscribe to a ROS topic from non-ROS python code

I have a ROS publisher on my catkinws that publishes a message to a topic in rospy. I need to subscribe to it using a pure python file that does not use ROS and is not in catkinws.

Is it possible to do this?

Thanks in advance

Asked by brother on 2022-09-27 22:53:13 UTC

Comments

Not the kind of response you were looking for, I understand, but this topic has been discussed quite a few times, so please tell us what you searched for, what you've already found, what you've tried and why that didn't work.

Without such information, this is just another duplicate and we'll end up answering the same thing again.

Asked by gvdhoorn on 2022-09-28 02:21:42 UTC

Sorry about that. I searched for ways to receive UDP files from rospy publisher, and read that the publisher cannot set transport types, but the subscriber can request for UDP. I am somewhat able to subscribe to a port, but I am not sure how I can subscribe to a topic while requesting it to be sent using UDP. I don't know how I'm supposed to program a subscriber to connect to a topic.

Asked by brother on 2022-09-28 15:25:38 UTC

I'm confused. Your question asks for a way to "subscribe to a ROS topic from a non-ROS [program]", but in your comment just now you mention about UDP.

How are these two questions connected? Perhaps it would be better if you could describe what it is you actually want/need to do.

Asked by gvdhoorn on 2022-09-29 02:22:27 UTC

Answers