original_docstring: 
          Records the current joint positions to a csv file if outputFilename was
          provided at construction this function will record the latest set of
          joint angles in a csv format.
  
          This function does not test to see if a file exists and will overwrite
          existing files.
          
docstring: Records the current joint positions to a csv file if outputFilename was
  provided at construction this function will record the latest set of
  joint angles in a csv format.
  
  This function does not test to see if a file exists and will overwrite
  existing files.
docstring_tokens: Records the current joint positions to a csv file if outputFilename was provided at construction this function will record the latest set of joint angles in a csv format . This function does not test to see if a file exists and will overwrite existing files .
code: def record(self):
          """
          Records the current joint positions to a csv file if outputFilename was
          provided at construction this function will record the latest set of
          joint angles in a csv format.
  
          This function does not test to see if a file exists and will overwrite
          existing files.
          """
          if self._filename:
              joints_left = self._limb_left.joint_names()
              joints_right = self._limb_right.joint_names()
              with open(self._filename, 'w') as f:
                  f.write('time,')
                  f.write(','.join([j for j in joints_left]) + ',')
                  f.write('left_gripper,')
                  f.write(','.join([j for j in joints_right]) + ',')
                  f.write('right_gripper\n')
  
                  while not self.done():
                      # Look for gripper button presses
                      if self._io_left_lower.state:
                          self._gripper_left.open()
                      elif self._io_left_upper.state:
                          self._gripper_left.close()
                      if self._io_right_lower.state:
                          self._gripper_right.open()
                      elif self._io_right_upper.state:
                          self._gripper_right.close()
                      angles_left = [self._limb_left.joint_angle(j)
                                     for j in joints_left]
                      angles_right = [self._limb_right.joint_angle(j)
                                      for j in joints_right]
  
                      f.write("%f," % (self._time_stamp(),))
  
                      f.write(','.join([str(x) for x in angles_left]) + ',')
                      f.write(str(self._gripper_left.position()) + ',')
  
                      f.write(','.join([str(x) for x in angles_right]) + ',')
                      f.write(str(self._gripper_right.position()) + '\n')
  
                      self._rate.sleep()
code_tokens: def record ( self ) : if self . _filename : joints_left = self . _limb_left . joint_names ( ) joints_right = self . _limb_right . joint_names ( ) with open ( self . _filename , 'w' ) as f : f . write ( 'time,' ) f . write ( ',' . join ( [ j for j in joints_left ] ) + ',' ) f . write ( 'left_gripper,' ) f . write ( ',' . join ( [ j for j in joints_right ] ) + ',' ) f . write ( 'right_gripper\n' ) while not self . done ( ) : if self . _io_left_lower . state : self . _gripper_left . open ( ) elif self . _io_left_upper . state : self . _gripper_left . close ( ) if self . _io_right_lower . state : self . _gripper_right . open ( ) elif self . _io_right_upper . state : self . _gripper_right . close ( ) angles_left = [ self . _limb_left . joint_angle ( j ) for j in joints_left ] angles_right = [ self . _limb_right . joint_angle ( j ) for j in joints_right ] f . write ( "%f," % ( self . _time_stamp ( ) , ) ) f . write ( ',' . join ( [ str ( x ) for x in angles_left ] ) + ',' ) f . write ( str ( self . _gripper_left . position ( ) ) + ',' ) f . write ( ',' . join ( [ str ( x ) for x in angles_right ] ) + ',' ) f . write ( str ( self . _gripper_right . position ( ) ) + '\n' ) self . _rate . sleep ( )
short_docstring: Records the current joint positions to a csv file if outputFilename was
  provided at construction this function will record the latest set of
  joint angles in a csv format.
short_docstring_tokens: Records the current joint positions to a csv file if outputFilename was provided at construction this function will record the latest set of joint angles in a csv format .
comment: """
          Records the current joint positions to a csv file if outputFilename was
          provided at construction this function will record the latest set of
          joint angles in a csv format.
  
          This function does not test to see if a file exists and will overwrite
          existing files.
          """$SEP$# Look for gripper button presses