ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The way you attempted to produce the desired CSV isn't really a ROS question at all. Rather, that's a Bash/sed question that would be better asked on something like Super User. That said, there are several ROS ways that you could likely get what you want.

  • The rosbag api would allow you to easily open the bag file and then save the data you want in whatever your desired format. A Python script to do what you're looking for would only be a few lines
  • With a combination of the -p and -b args to rostopic echo you could easily produce a CSV file that included all fields in the topic. Then it would be trivial to extract the columns that you are looking for. See this question on SO for some good examples. I've used cut for this purpose many times.