code: def scale_channel(self, ch, value):
          '''scale a channel to 1000/1500/2000'''
          v = value/10000.0
          if v < -1:
              v = -1
          elif v > 1:
              v = 1
          if ch == 3 and self.mpstate.vehicle_type != 'rover':
              if v < 0:
                  v = 0
              return int(1000 + v*1000)
          return int(1500 + v*500f scale_channel(self, ch, value):
          '''scale a channel to 1000/1500/2000'''
          v = value/10000.0
          if v < -1:
              v = -1
          elif v > 1:
              v = 1
          if ch == 3 and self.mpstate.vehicle_type != 'rover':
              if v < 0:
                  v = 0
              return int(1000 + v*1000)
          return int(1500 + v*500)
docs: scale a channel to 1000/1500/2000