Gets the pid gain for the specified motors.
437881
def get_pid_gain(self, ids, **kwargs):
        
        return tuple([tuple(reversed(t)) for t in self._get_pid_gain(ids, **kwargs)])
527549
def get_pid(options):
    """"""
    namespace = options['settings'] if options['settings'] else options['wsgi']
    return os.path.join('{}', '{}_{}.pid').format(PID_DIR, options['http_port'], namespace.replace('.', '_'))
606478
def get_gain(self, attr_name):
        
        subset_entropy = 0.0
        for value in iterkeys(self._attr_value_counts[attr_name]):
            value_prob = self.get_value_prob(attr_name, value)
            e = self.get_entropy(attr_name, value)
            subset_entropy += value_prob * e
        return (self.main_entropy - subset_entropy)
472934
def compute_motor_command(self, m_ag):
        
        m_env = bounds_min_max(m_ag, self.conf.m_mins, self.conf.m_maxs)
        return m_env
230880
def get_new_pid(institute):
    
    number = '0001'
    prefix = 'p%s' % institute.name.replace(' ', '')[:4]

    found = True
    while found:
        try:
            Project.objects.get(pid=prefix + number)
            number = str(int(number) + 1)
            if len(number) == 1:
                number = '000' + number
            elif len(number) == 2:
                number = '00' + number
            elif len(number) == 3:
                number = '0' + number
        except Project.DoesNotExist:
            found = False

    return prefix + number
394775
def mag_field_motors(RAW_IMU, SENSOR_OFFSETS, ofs, SERVO_OUTPUT_RAW, motor_ofs):
    ''''''
    mag_x = RAW_IMU.xmag
    mag_y = RAW_IMU.ymag
    mag_z = RAW_IMU.zmag

    ofs = get_motor_offsets(SERVO_OUTPUT_RAW, ofs, motor_ofs)

    if SENSOR_OFFSETS is not None and ofs is not None:
        mag_x += ofs[0] - SENSOR_OFFSETS.mag_ofs_x
        mag_y += ofs[1] - SENSOR_OFFSETS.mag_ofs_y
        mag_z += ofs[2] - SENSOR_OFFSETS.mag_ofs_z
    return sqrt(mag_x**2 + mag_y**2 + mag_z**2)
1159240
def pid(self):
    
    self._assert_bound()
    return PID(self._context.ip, self._context.port, self.name)
1281700
def read_pid_stat(pid):
    
    return {
        "utime": random.randint(0, 999999999),
        "stime": random.randint(0, 999999999),
        "cutime": random.randint(0, 999999999),
        "cstime": random.randint(0, 999999999),
    }
347364
def scale_rc(self, servo, min, max, param):
        ''''''
        # default to servo range of 1000 to 2000
        min_pwm  = self.get_mav_param('%s_MIN'  % param, 0)
        max_pwm  = self.get_mav_param('%s_MAX'  % param, 0)
        if min_pwm == 0 or max_pwm == 0:
            return 0
        if max_pwm == min_pwm:
            p = 0.0
        else:
            p = (servo-min_pwm) / float(max_pwm-min_pwm)
        v = min + p*(max-min)
        if v < min:
            v = min
        if v > max:
            v = max
        return v
272056
def pid(self):
        
        pf = self.path('cmd.pid')
        if not os.path.exists(pf):
            return None
        with open(pf, 'r') as f:
            return int(f.read())
916834
def position_i(self):
        
        self._position_i, value = self.get_attr_int(self._position_i, 'hold_pid/Ki')
        return value
1155206
private static String getPID() {
        String name = ManagementFactory.getRuntimeMXBean().getName();
        int index = name.indexOf('@');
        if (index == -1) {
            return null;
        }

        String pid = name.substring(0, index);
        if (!pid.matches("[0-9]+")) {
            return null;
        }

        return pid;
    }
1275637
function getByPID(pid) {
  var workers = get();
  var i;
  var worker;

  for (i = 0; i < workers.length; i++) {
    worker = workers[i];
    if (worker.pid === pid) {
      return worker;
    }
  }
  // else return undefined
}
1027278
def get_motor_force(self, motor_name):
        
        return self.call_remote_api('simxGetJointForce',
                                    self.get_object_handle(motor_name),
                                    streaming=True)
566748
def get_motor_position(self, motor_name):
        
        return self.call_remote_api('simxGetJointPosition',
                                    self.get_object_handle(motor_name),
                                    streaming=True)
820334
def get_position_d(self):
        
        data = []
        data.append(0x09)
        data.append(self.servoid)
        data.append(RAM_READ_REQ)
        data.append(POSITION_KD_RAM)
        data.append(BYTE2)
        send_data(data)
        rxdata = []
        try:
            rxdata = SERPORT.read(13)
            return (ord(rxdata[10])*256)+(ord(rxdata[9])&0xff)
        except HerkulexError:
            raise HerkulexError("could not communicate with motors")
696432
function get(pid, callback) {
  var ps = processes[pid];
  if( typeof callback === 'function' ) return ps ? callback(null, ps) : callback(new Error('not exists pid:' + pid));
  else return ps;
}