예제 #1
0
파일: recording.py 프로젝트: berickson/car
 def __init__(self, recording_file_path = None):
   if recording_file_path == None:
     folder = 'recordings'
     prefix = 'recording'
     suffix = '.csv'
     recording_file_path = filenames.latest_filename(folder=folder,prefix=prefix,suffix=suffix)
   self.recording = open(recording_file_path,'r');
예제 #2
0
파일: animate.py 프로젝트: berickson/car
          cr.line_to(self.world.right, y )
          cr.stroke()
          y += 1
        x = math.floor(self.world.left)
        while x <= math.ceil(self.world.right):
          cr.move_to(x,self.world.top)
          cr.line_to(x, self.world.bottom)
          cr.stroke()
          x += 1
        # draw circle at origin
        cr.arc(0.,0.,.25,0.,2*math.pi);
        cr.stroke()

        carView = CarView()
        carView.draw(cr,self.world.car)
    
        cr.set_matrix(oldmatrix)


import argparse
parser = argparse.ArgumentParser(description = 'RC recording animation')
parser.add_argument(
  'infile',
  nargs='?',
#  type=argparse.FileType('r'),
  default= filenames.latest_filename('recordings','recording','csv'),
  help='csv file recorded with recorder')
args = parser.parse_args()

run(App)