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

Rosbag as a workspace

asked 2013-12-17 05:42:49 -0600

Phorce gravatar image

updated 2014-01-28 17:18:51 -0600

ngrennan gravatar image

Hey,

I'm creating a rosbag and want to record two topics into a .bag file. I am using a Python script to create this. The problem being is that I don't know whether or not I need to create a workspace, so then I could have the following command: rosrun project bag which would then record the topics or just have a script that I can run from terminal manually?

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-12-17 05:51:53 -0600

David Galdeano gravatar image

updated 2013-12-17 21:54:57 -0600

Hello, use the command tool rosbag record -a to record in a bag file.

See: http://wiki.ros.org/rosbag/Tutorials/Recording%20and%20playing%20back%20data

If you really need the API for python, see: http://wiki.ros.org/rosbag/Code%20API where read and write from python to a bag file are detailled.

edit flag offensive delete link more
0

answered 2013-12-17 21:11:18 -0600

tfoote gravatar image

If you're just writing a single script you can use the default environments from your installation. By sourcing /opt/ros/DISTRO/setup.bash for the appropriate DISTRO.

If you're doing more you should create a workspace for your work.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-12-17 05:42:49 -0600

Seen: 326 times

Last updated: Dec 17 '13