Coder Social home page Coder Social logo

iamphytan / rosbag-compare Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 78 KB

PyPi package for comparing ROS topics contained in a group of rosbags

Home Page: https://pypi.org/project/rosbag-compare/

License: MIT License

Python 100.00%
pypi rosbag ros rosbags python pypi-package

rosbag-compare's Introduction

rosbag-compare

Compare the topic content between rosbags

Say you have a bunch of rosbags inside a folder and you don't know whether or not all those rosbags have the same topics. rosbag-compare will :

  • retrieve the topics contained in each rosbag
  • export a summary of the ros topics in a JSON file
  • plot the topics that are missing for each rosbag :

Summary of missing topics

Installation

rosbag-compare can be installed from PyPi :

$ pip install rosbag-compare

Usage

rosbag-compare can be used both as a command line application and in Python code.

Command line

A basic use of rosbag-compare is to simply call it with the path of the folder that contains rosbags. This will simply generate a JSON file with a summary of the comparison in topics_<name-of-bagfolder>.json.

$ rosbag-compare -b /path/to/folder/with/rosbags

You can also generate a figure that will show what topics are missing in each rosbag with the --plot/-p flag. This figure helps when you want to find out if all rosbags of your experiment contains the topics that are of your interest.

$ rosbag-compare -b /path/to/folder/with/rosbags -p

In Python

You can also call rosbag-compare directly into your Python code :

from rosbag_compare import RosbagComparator

data_path = "/path/to/folder/with/rosbags"
rbag_comp = RosbagComparator(data_path)

# This step may take time as it open each rosbag separately
# Will show a progress bar
rbag_comp.extract_data()

# Export summary to a JSON file
rbag_comp.to_json()  # Defaults to topics_<foldername>.json
rbag_comp.to_json("exported_summary.json")

# Generate a figure with the name of the
# missing topics for each rosbag
rbag_comp.plot()                                              # Show figure
rbag_comp.plot(save_fig=True)                                 # Save figure (defaults to missing_topics.png)
rbag_comp.plot(save_fig=True, img_path="topics_summary.jpg")  # Save figure to path

Contributing

Pull requests are welcome and don't hesitate to open issues

Development requirements can be installed using pip :

$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements/requirements-dev.txt

License

This project is licensed under a MIT license

rosbag-compare's People

Contributors

iamphytan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.