convertTrajMsg.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2014 Aldebaran Robotics
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 
18 # authors: Mikael Arguedas [mikael DOT arguedas AT gmail DOT com]
19 #FIXME Add : Fingers for Humanoids and Sensors
20 
21 import sys
22 import argparse
23 import subprocess
24 import os
25 import math
26 from os import path
27 
28 parser = argparse.ArgumentParser(usage='Load an URDF file')
29 parser.add_argument('-i','--input', default=None, help='file containing the trajectory (rostopic echo controller/follow_joint_trajectory/goal)')
30 
31 
32 args = parser.parse_args()
33 if os.path.isfile(args.input):
34  output = args.input[0:args.input.rfind('.')] + '_modified' + args.input[args.input.rfind('.'):]
35  print output
36  file = open(args.input,'r')
37  lines = file.readlines()
38  outfile = open(output,'w+')
39  for i in range(12,len(lines)-6):
40  outfile.write(lines[i][2:])
41  file.close()
42  outfile.close()
43 else:
44  print "input file doesn't exist"
45 


romeo_gazebo_plugin
Author(s): Natalia Lyubova , Mikael Arguedas
autogenerated on Mon Jun 10 2019 14:44:28