def save_update_data(self, position, sensors):
        if self.logFile:
            data = { 'timestamp' : self.timestamp(),
                     'position' : position,
                     'leftSonar' : sensors.get_sensor('LeftSonar'),
                     'rightSonar' : sensors.get_sensor('RightSonar') }
            jstr = json.dumps(data)
            #self.env.log("Mapper.update: "+jstr)

            if not self.first_write:
                self.logFile.write(",\n")
            self.logFile.write(jstr)
            self.first_write = False
            self.logFile.flush()