Go to the documentation of this file.00001
00002
00003 from __future__ import print_function
00004 import roslib
00005 roslib.load_manifest('semanticmodel')
00006 import sys
00007 import os
00008 import rospy
00009 from os import path
00010 import subprocess as sp
00011
00012 args = rospy.myargv(sys.argv)
00013 if len(args)!=2:
00014 print("Must specify exactly one argument to record_data. Args were", args)
00015 sys.exit(1)
00016
00017 d = args[1]
00018 print("Target directory is ", d)
00019
00020 if not path.isdir(d):
00021 print("Directory {0} does not exist".format(d))
00022 sys.exit(1)
00023
00024
00025 topics = "tf camera/rgb/image_raw camera/depth/image_raw tilt_scan_filtered "\
00026 "camera/depth/camera_info camera/rgb/camera_info map base_scan bag_metadata"
00027 cmd = "rosbag record -o {0} {1}".format(path.join(d, "passive"), topics)
00028 print("About to execute {0}".format(cmd))
00029 sp.check_call(cmd.split())