rosbag publish messages outside ros environment melodic

asked 2020-06-07 08:28:35 -0500

krishnaros gravatar image

updated 2020-06-08 03:55:14 -0500

mgruhler gravatar image

I want to publish the messages in my rosbag to outside python using rosbridge. can anyone help?

Thank you.

roslibpy

melodic

rospy

edit retag flag offensive close merge delete

Comments

Where exactly do you have problems? Check the rosbridge. There is also the roslibpy library that eases the usage from the python side. This should be all you need. In short:

  1. Run rosbridge
  2. play the bag
  3. your "outside python code" needs to subscribe via rosbridge to the topics it is interested in

If you've checked those pages and still have problems, please add more details about your issues.

mgruhler gravatar image mgruhler  ( 2020-06-08 02:21:18 -0500 )edit

how to subscribe the topics via rosbridge? can you help? I am new to ros

krishnaros gravatar image krishnaros  ( 2020-06-08 02:35:16 -0500 )edit

please add more details. What do you want to do exactly (i.e. what subscribes to what)? What have you tried? What resources did you check? what did work and what does not?

did you serach around ROS answers? E.g. #q334898 might give some pointers

mgruhler gravatar image mgruhler  ( 2020-06-08 03:54:54 -0500 )edit

So far I have been able to launch a rosbridge through the web socket. on my python side I have connected to this. Now I want to play a rosbag on ros side and subscribe to the messages from python side outside ros. I am unable to find resources on subscribing to topics outside ros environment. should I use roslibpy.Topic()? I do not know.

krishnaros gravatar image krishnaros  ( 2020-06-08 04:35:01 -0500 )edit

one more question I had was that on my python side, it keeps getting disconnected. I have to restart my system to make it work. Have you come across such an issue? Timeout- error raise Exception('Failed to connect to ROS')

Exception: Failed to connect to ROS

krishnaros gravatar image krishnaros  ( 2020-06-08 05:20:43 -0500 )edit