Moving around and renaming some rosbag files.

This commit is contained in:
Jeremy Leibs 2009-12-16 07:50:04 +00:00
parent 6e68c23bf8
commit fbddb70c91
5 changed files with 23 additions and 20 deletions

View File

@ -36,9 +36,9 @@ PKG = 'rosbag'
import roslib; roslib.load_manifest(PKG)
# Import the command wrappers in case someone wants to use them
from record import rosbag_record
from play import rosbag_play
from info import rosbag_info
from record_cmd import record_cmd
from play_cmd import play_cmd
from info_cmd import info_cmd
# Import rosbag main to be used by the $ROS_ROOT/bin/rosbag
from main import rosbagmain

View File

@ -38,25 +38,27 @@ import subprocess
import optparse
from optparse import OptionParser
def rosbag_info(argv):
def info_cmd(argv):
parser = OptionParser(usage="rosbag info BAGFILE",
description="Summarize the contents of a bag file.")
(options, args) = parser.parse_args(argv)
if (len(args) != 1):
parser.error("You must pass in a single bagfile.")
if (len(args) == 0):
parser.error("You must pass in a bagfile.")
cmd = ["rosplay", "-c"]
for arg in args:
cmd.extend(args)
cmd = ["rosplay", "-c", arg]
proc = subprocess.Popen(cmd)
proc = subprocess.Popen(cmd)
# Ignore sigint since we're basically just pretending to be the subprocess now.
signal.signal(signal.SIGINT, signal.SIG_IGN)
# Ignore sigint since we're basically just pretending to be the subprocess now.
signal.signal(signal.SIGINT, signal.SIG_IGN)
res = proc.wait()
res = proc.wait()
print ""
sys.exit(res)

View File

@ -35,9 +35,9 @@
import sys
import UserDict
from record import rosbag_record
from play import rosbag_play
from info import rosbag_info
from record_cmd import record_cmd
from play_cmd import play_cmd
from info_cmd import info_cmd
class RosbagCmds(UserDict.UserDict):
def __init__(self):
@ -72,9 +72,9 @@ class RosbagCmds(UserDict.UserDict):
def rosbagmain(argv=None):
cmds = RosbagCmds()
cmds['record'] = rosbag_record
cmds['play'] = rosbag_play
cmds['info'] = rosbag_info
cmds['record'] = record_cmd
cmds['play'] = play_cmd
cmds['info'] = info_cmd
if argv is None:
argv=sys.argv

View File

@ -38,7 +38,7 @@ import subprocess
import optparse
from optparse import OptionParser
def rosbag_play(argv):
def play_cmd(argv):
parser = OptionParser(usage="rosbag play BAGFILE1 [BAGFILE2 BAGFILE3 ...]",
description="Play back the contents of one or more bag files in a time-synchronized fashion.")
parser.add_option("-q", "--quiet", dest="quiet", default=False, action="store_true",

View File

@ -38,7 +38,7 @@ import subprocess
import optparse
from optparse import OptionParser
def rosbag_record(argv):
def record_cmd(argv):
parser = OptionParser(usage="rosbag record TOPIC1 [TOPIC2 TOPIC3 ...]",
description="Record a bag file with the contents of specified topics.",
formatter=optparse.IndentedHelpFormatter())
@ -75,6 +75,7 @@ def rosbag_record(argv):
if options.prefix: cmd.extend(["-f", options.prefix])
if options.name: cmd.extend(["-F", options.name])
if options.all: cmd.extend(["-a"])
if options.gzip: cmd.extend(["-z"])
if options.bzip: cmd.extend(["-j"])