convertTrajMsg.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # Copyright (C) 2014 Aldebaran Robotics
00004 #
00005 # Licensed under the Apache License, Version 2.0 (the "License");
00006 # you may not use this file except in compliance with the License.
00007 # You may obtain a copy of the License at
00008 #
00009 # http://www.apache.org/licenses/LICENSE-2.0
00010 #
00011 # Unless required by applicable law or agreed to in writing, software
00012 # distributed under the License is distributed on an "AS IS" BASIS,
00013 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 # See the License for the specific language governing permissions and
00015 # limitations under the License.
00016 #
00017 
00018 # authors: Mikael Arguedas [mikael DOT arguedas AT gmail DOT com]
00019 #FIXME Add : Fingers for Humanoids and Sensors
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 


romeo_gazebo_plugin
Author(s): Natalia Lyubova , Mikael Arguedas
autogenerated on Thu Jan 12 2017 04:12:17