ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The rosjava implementation used in the android sensors app is broken and is not properly embedding the message definitions in the message stream. rosbag then doesn't know how what a std_msgs message type is inside the bagfile. UGH!

My work around was to play the messages with 'rosbag play /android/imu' and then echo the messages to a text file with 'rostopic echo /android/imu > imu.txt'. rostopic doesn't use the message type information located withing the topic stream, but rather uses the compiled libraries, so this works.

Then I convert the text file to a csv file with this ugly shinanigans:


cp $1 a

tr -d "[a-z:_/ ,]" < a > b
sed 's/' b > a
tr  -s "\n" "," < a > b
sed 's/,---,/#/g' b > a
tr  "#" "\n" < a > b
sed 's/^,//g' b > a

cp a $2
rm a b

Save it as a script and run it with './script.bash imu.txt imu.csv' to convert imu.txt to a csv file.