ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Is there a way to subscribe to different topics at the same time in rospy?

asked 2021-07-15 17:21:19 -0500

argahsuknesib gravatar image

I am subscribing to various topics and I wish to print them into a .csv log file, but I am not able to print any one of them outside their own callback function.

You can see the code at Click for Code and it will be great if you could let me know what I am doing wrong?

Thank you.

edit retag flag offensive close merge delete



Isn't this something you'd want to do with rosbag? Especially because you want to convert the data to .csv?

gvdhoorn gravatar image gvdhoorn  ( 2021-07-16 07:55:10 -0500 )edit

Yes, I am trying to do that. But I was not successful in doing the conversion to csv, will you please tell me a working rosabg_to_csv convertor?

argahsuknesib gravatar image argahsuknesib  ( 2021-07-16 08:13:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-07-15 19:43:59 -0500

You could just create the subscriber inside a class and use a member variable to save them in the correct order or use the time as a key and then create a table when you desire.

Or if the data is synchronized you could try to take a look at

In any case, take a look at the message filters package.

edit flag offensive delete link more


Thank you so much, I will look into it. Have a good day

argahsuknesib gravatar image argahsuknesib  ( 2021-07-15 20:01:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-07-15 17:21:19 -0500

Seen: 70 times

Last updated: Jul 15 '21