Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 import sys
00022 import argparse
00023 import subprocess
00024 import os
00025 import math
00026 from os import path
00027
00028 parser = argparse.ArgumentParser(usage='Load an URDF file')
00029 parser.add_argument('-i','--input', default=None, help='file containing the trajectory (rostopic echo controller/follow_joint_trajectory/goal)')
00030
00031
00032 args = parser.parse_args()
00033 if os.path.isfile(args.input):
00034 output = args.input[0:args.input.rfind('.')] + '_modified' + args.input[args.input.rfind('.'):]
00035 print output
00036 file = open(args.input,'r')
00037 lines = file.readlines()
00038 outfile = open(output,'w+')
00039 for i in range(12,len(lines)-6):
00040 outfile.write(lines[i][2:])
00041 file.close()
00042 outfile.close()
00043 else:
00044 print "input file doesn't exist"
00045