Gets the current position of Herkulex

        Args:
            none

        Returns:
            int: position of the servo- 0 to 1023

        Raises:
            SerialException: Error occured while opening serial port
351062
def get_servo_position(self):
        
        #global SERPORT

        data = []
        data.append(0x09)
        data.append(self.servoid)
        data.append(RAM_READ_REQ)
        data.append(CALIBRATED_POSITION_RAM)
        data.append(BYTE2)
        send_data(data)
        rxdata = []
        try:
            rxdata = SERPORT.read(13)
            if (self.servomodel==0x06) or (self.servomodel == 0x04):
                return ((ord(rxdata[10])&0xff)<<8) | (ord(rxdata[9])&0xFF)
            else:
                #print ord(rxdata[9]),ord(rxdata[10])
                return ((ord(rxdata[10])&0x03)<<8) | (ord(rxdata[9])&0xFF)

        except HerkulexError:
            print "Could not read from the servos. Check connection"
1030795
def get_window_position(self, windowHandle='current'):
        
        if self.w3c:
            if windowHandle != 'current':
                warnings.warn("Only 'current' window is supported for W3C compatibile browsers.")
            position = self.get_window_rect()
        else:
            position = self.execute(Command.GET_WINDOW_POSITION,
                                    {'windowHandle': windowHandle})['value']

        return {k: position[k] for k in ('x', 'y')}
1027780
def get_current(self):
        

        where = slice(self._oldest_frame_idx(), self._pos)
        major_axis = pd.DatetimeIndex(deepcopy(self.date_buf[where]), tz='utc')
        return pd.Panel(self.buffer.values[:, where, :], self.items,
                        major_axis, self.minor_axis, dtype=self.dtype)
614135
def get_pos(self, sector):
        
        if not self.sector_is_valid(sector):
            raise ByteNotInFile166("Sector %d out of range" % sector)
        pos = sector * self.sector_size + self.header_offset
        size = self.sector_size
        return pos, size
1176353
def get_serialnumber(self):
        
        command = const.CMD_OPTIONS_RRQ
        command_string = b'~SerialNumber\x00'
        response_size = 1024
        cmd_response = self.__send_command(command, command_string, response_size)
        if cmd_response.get('status'):
            serialnumber = self.__data.split(b'=', 1)[-1].split(b'\x00')[0]
            serialnumber = serialnumber.replace(b'=', b'')
            return serialnumber.decode() # string?
        else:
            raise ZKErrorResponse("Can't read serial number")
644486
def servo_config(self, pin, min_pulse=544, max_pulse=2400, angle=0):
        
        if pin > len(self.digital) or self.digital[pin].mode == UNAVAILABLE:
            raise IOError("Pin {0} is not a valid servo pin".format(pin))

        data = bytearray([pin])
        data += to_two_bytes(min_pulse)
        data += to_two_bytes(max_pulse)
        self.send_sysex(SERVO_CONFIG, data)

        # set pin._mode to SERVO so that it sends analog messages
        # don't set pin.mode as that calls this method
        self.digital[pin]._mode = SERVO
        self.digital[pin].write(angle)
13631
def get_motor_offsets(SERVO_OUTPUT_RAW, ofs, motor_ofs):
    ''''''
    import mavutil
    self = mavutil.mavfile_global

    m = SERVO_OUTPUT_RAW
    motor_pwm = m.servo1_raw + m.servo2_raw + m.servo3_raw + m.servo4_raw
    motor_pwm *= 0.25
    rc3_min = self.param('RC3_MIN', 1100)
    rc3_max = self.param('RC3_MAX', 1900)
    motor = (motor_pwm - rc3_min) / (rc3_max - rc3_min)
    if motor > 1.0:
        motor = 1.0
    if motor < 0.0:
        motor = 0.0

    motor_offsets0 = motor_ofs[0] * motor
    motor_offsets1 = motor_ofs[1] * motor
    motor_offsets2 = motor_ofs[2] * motor
    ofs = (ofs[0] + motor_offsets0, ofs[1] + motor_offsets1, ofs[2] + motor_offsets2)

    return ofs
704790
def _get_item_position(self, idx):
        """"""
        start = 0 if idx == 0 else self._index[idx - 1] + 1
        end = self._index[idx]
        return start, end
227955
def _get_at_pos(self, pos):
        """"""

        if pos < 0:
            # line 0 is the start of the file, no more above
            return None, None

        if len(self.lines) > pos:
            # we have that line so return it
            return self.lines[pos], pos

        if self.file is None:
            # file is closed, so there are no more lines
            return None, None

        assert pos == len(self.lines), "out of order request?"

        self.read_next_line()

        return self.lines[-1], pos
1107311
def get_position():
    
    e = Quartz.CGEventCreate(None)
    point = Quartz.CGEventGetLocation(e)
    return (point.x, point.y)
94929
def get_servo_angle(self):
        

        servoposition =  self.get_servo_position()
        if (self.servomodel==0x06) or (self.servomodel == 0x04):
            return scale(servoposition, 10627, 22129, -159.9, 159.6)
        else:
            return scale(servoposition, 21, 1002, -150, 150)
743742
def position(self, pos=None):
		
		if pos is not None:
			if pos >= len(self.__history):
				raise IndexError('History position is out of bound')
			self.__history_position = pos
		return self.__history_position
999814
def process_gps_position(self, helper, sess):
        

        gps_position = helper.get_snmp_value(sess, helper, self.oids['oid_gps_position'])

        if gps_position:
            helper.add_summary(gps_position)
        else:
            helper.add_summary("Could not retrieve GPS position")
            helper.status(unknown)
590228
def get_position(stream=STD_OUTPUT_HANDLE):
    '''  '''
    stream = kernel32.GetStdHandle(stream)
    csbi = CONSOLE_SCREEN_BUFFER_INFO()
    kernel32.GetConsoleScreenBufferInfo(stream, byref(csbi))

    pos = csbi.dwCursorPosition
    # zero based, add ones for compatibility.
    return (pos.X + 1, pos.Y + 1)
873591
def prev_cursor_location(self):
        
        self._verify_entrypoint_selected()
        self.current_trace_frame_index = max(self.current_trace_frame_index - 1, 0)
        self.trace()
831759
def _get_serial_number(self):
        
        return usb.util.get_string(self._device.usb_dev, 64, self._device.usb_dev.iSerialNumber)
1009141
def get_progress(self):
        
        pos = self.reader.reader.tell()
        return min((pos - self.region_start) /
                   float(self.region_end - self.region_start),
                   1.0)