A rosbag implementation in Java

| No Comments | No TrackBacks
From Aaron Schiffman via @ros-users

Dear ROS-Users,

I've created a rosbag writer implementation for Java, and posted it to a new BitBucket repository. It should be functional for writing a rosbag format 2.0 none compression rosbag in Android or Java ROS implementations (Client or Server). If your interested the source repository is located at:
 
 
 
 
 
 
aaron_sims / jrosbag / source / -- Bitbucket
Source Branch master Check out branch jrosbag /
Preview by Yahoo
 
How to use the Bag class:
  1. Initialize the org.happy.artist.rmdmia.utilities.ros.bag.Bag class.
  2. Call bag.start(OutputStream os, Bag.CHUNK_COMPRESSION_NONE)); // Where os is the OutputStream you intend to write the file. Examples could be a FileOutputStream, or a network output stream that writes the file to Google Drive, or Dropbox (just examples).
  3. Call bag.addConnectionHeader(char[] topic, int conn, char[] connection_header_hex); for each new connection header on connection handshake. int conn is a unique int connection id chosen for the connection (might be a good idea to iterate through topic ids to create an int array, or other mechanism to chose a unique int. connection_header_hex will be the ROS Serialized Message in the connection header.
  4. Call bag.addMessage(long time, int conn, char[] message_data_hex); Pass in the long time, associated connection header int conn id, and the ROS serialized message to add to the rosbag file.
This Java code is poorly documented, however, I wanted to share it with ROS Community for Java/Android ROS clients that want to record rosbag files. Good luck using it. Releasing under Apache 2.0 license.

I wish I had more time to clean up the code better, and if you have questions or want to contribute send me a message.

Thanks,

Aaron 

No TrackBacks

TrackBack URL: https://www.ros.org/mt-tb.cgi/1411

Leave a comment

Find this blog and more at planet.ros.org.


Monthly Archives

About this Entry

This page contains a single entry by Tully Foote published on November 17, 2014 11:51 AM.

New Tutorials: Adding a global path planner as plugin in ROS was the previous entry in this blog.

ROS Japan Users Group + Kawada host a successful ROS Meetup #4 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.