Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rosbag post-processing #268

Open
ebretl opened this issue Sep 29, 2019 · 2 comments
Open

rosbag post-processing #268

ebretl opened this issue Sep 29, 2019 · 2 comments

Comments

@ebretl
Copy link
Contributor

ebretl commented Sep 29, 2019

ROS bag files are logs of ROS messages. We often test our computer vision nodes by playing back bag files (using rosbag play) in simulated time so that our code thinks the robot is driving. We would like to test our mapping code in this way as well, once we collect bag files with GPS data.

Unfortunately, rosbags tend to be large files. We often wish to decrease the size of these files by limiting the number of topics and amount of time in the recording. We usually use rosbag filter to do this, but this tool has a clumsy interface. For example, beginning and ending times for trimming are specified in absolute time (e.g. 152982629.262) rather than relative to the start of the file. We would also like to have a list of topics in a text file and use this to select which topics should be in the new bag file.

We also want some new filtering features that rosbag filter does not support. We would like to filter to only include messages if the car is moving or if the car is not e-stopped (this information can be found in the /chassis_state topic).

Deliverable: rosbag_filter.py
Arguments and effects:

  • --start-time T
    • Excludes all messages before this time (relative to the start time of the bag file). An exception to this should be the /tf_static topic which is a special "latched" topic that is usually only at the beginning of the bag file.
  • --end-time T
    • Excludes messages after this time, again relative to the start time
  • --exclude-estop
    • Exclude messages if /chassis_state says we're in emergency stop mode
  • --only-moving
    • Only include messages published when the wheels are spinning (according to /chassis_state or /speed)
  • --compress
    • Output file should be a compressed archive of a bag file, suitable for archive storage on the RJ server

Useful references:

@ebretl ebretl self-assigned this Sep 29, 2019
@Daniel-Martin576
Copy link
Contributor

Ref to #160

@btdubs
Copy link
Contributor

btdubs commented Feb 9, 2020

@sriharis123 Dylan said there was some confusion on how to go about this which was holding up progress.
Check out the bag_converter.py and rosbag_trajectory_csv.py under util. Those have examples of using the python rosbag library.
If you need further specific help feel free to ask on here or slack.

@NicoBartholomai NicoBartholomai self-assigned this Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants