ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

Comments

1

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
1

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 http://wiki.ros.org/message_filters.

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

edit flag offensive delete link more

Comments

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

Question Tools

1 follower

Stats

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

Seen: 89 times

Last updated: Jul 15 '21