Skip to content
Snippets Groups Projects
Commit d11bf780 authored by Nicolas Mansard's avatar Nicolas Mansard
Browse files

Added a empty constructor.

parent 466b6662
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,17 @@ from numpy import *
# --- FOOT PRINT PARSER ------------------------------------------------------------
class FootPrintParser:
def __init__(self,filename,dt,robotviewer,offset=None):
def __init__(self,robotviewer=None,filename=None,dt=None,offset=None):
if filename==None:
self.clt=robotviewer
self.clt.updateElementConfig('RF',[0,0,-1000,0,0,0])
self.clt.updateElementConfig('LF',[0,0,-1000,0,0,0])
self.events ={}
return
elif dt==None:
print 'Error, if filename is specified, dt should be too.'
return
self.file = open(filename,'r')
self.dt=dt
self.events ={}
......@@ -32,8 +42,10 @@ class FootPrintParser:
R[0,1]=s; R[1,0]=-s
R=matrix(R)
for l in self.file.readlines():
(t,foot,x,y,theta)=[ float(x) for x in l.split()]
for il,l in enumerate(self.file.readlines()):
if len(l.split())==0:continue
try:(t,foot,x,y,theta)=[ float(x) for x in l.split()]
except: print 'Error on line ',il,': ',l
if foot==1: foot='LF'
else: foot='RF'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment