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

How can i use my own rosbag version

asked 2013-02-06 20:16:05 -0500

Josch gravatar image

Hi,

I need to be able to set the duration for a rosbag play command. This feature is not implemented in rosbag yet, there is a pull request though.

Since I need this feature now I would either have to stop the rosbag play process at an given time or I would have to implement it in my own rosbag branch. When I am using my own rosbag branch I will also have to install this custom branch on other computers which will use my package.

Is there a nice way to do any of this?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2013-03-01 15:15:01 -0500

Dirk Thomas gravatar image

You can checkout the rosbag package into a catkin workspace, make arbitrary changes to it and than build the workspace with "catkin_make". After that you source the setup.bash from that workspace instead of /opt/ros/groovy and your version of rosbag overlays the installed one.

This is how you can override any catkin package in ROS.

edit flag offensive delete link more
1

answered 2013-02-06 22:47:38 -0500

dornhege gravatar image

Maybe I misunderstood, what you want to do, but I don't really see a way out of your problem. As long as your pull request isn't processed, there is not other way than actually using a custom version wherever you need it.

For your specific problem there is a solution though. If you only want to play a bag file for a certain time, you can create a new bag file that only contains data up to that time. A standard rosbag play would then do the right thing. rosbag filter is what you are looking for.

edit flag offensive delete link more

Comments

My application should preferably run in real time. So if it would create a filtered bag first it would need some time. The bags I will use are about 1-3 hours long, rosbag filter needs some time then.

Josch gravatar image Josch  ( 2013-02-11 20:19:46 -0500 )edit
0

answered 2013-02-25 19:36:06 -0500

Josch gravatar image

I figured out a way to stop processes after X millseconds have passed. My software is calling rosbag play via a QProcess. As soon as the desired runtime is exceeded the QProcess is killed. Not the nicest way, but it's working just fine.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-06 20:16:05 -0500

Seen: 475 times

Last updated: Mar 01 '13