Ask Your Question
1

Install of the rospy/rosbag python libraries standalone not on Ubuntu

asked 2020-02-04 12:24:34 -0500

JohnH gravatar image

I want to be able to parse out bag files. I don't need to produce or change the bag files just read and parse them so I can use the data downstream in a couple of different systems/formats.

Using python is fine, and I am just trying to run this: import rosbag bag = rosbag.Bag('myfile.bag') for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']): print msg bag.close()

However, I can't seem to find a way to install the rosbag package.

I've tried variations of pip install rosbag.

From reading I see if I was on Ubuntu I should: sudo apt-get install python-rosbag

I don't have Ubuntu. Ideally I'd like to do this on CentOS and/or Mac OSX.

Of course, in testing on OSX, there's no apt-get and doesn't seem to be any homebrew equivalent...

Again I don't want to have to completely install ROS, just the python libs to parse the bag files.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-04 14:27:22 -0500

gvdhoorn gravatar image

updated 2020-02-04 15:04:42 -0500

Use the custom/experimental Pypi index from rospypi/simple:

virtualenv -p python3 venv
source ./venv/bin/activate
pip install --extra-index-url https://rospypi.github.io/simple/ rospy rosbag

A couple of others packages might also come in handy, but that depends on what you want to do.

Also works with Python 2.

On Windows, Linux and most likely OSX as well (but I haven't tested it).

Related ROS Discourse post: Experimental Python package index for ROS.


Edit:

Again I don't want to have to completely install ROS, just the python libs to parse the bag files.

seeing where you're registering from, you may be interested in this company which offers data analytics interopability tools for working with .bags (presentation at the ROS-I Conference 2019, and video recording).

I have no commercial interest here, just linking to a presentation I attended at the ROS-I Conf19 last year.

edit flag offensive delete link more

Comments

That worked. Thank you!

JohnH gravatar image JohnH  ( 2020-02-04 14:45:49 -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

Stats

Asked: 2020-02-04 12:24:34 -0500

Seen: 796 times

Last updated: Feb 04