Universal Robots TypeScript API - v10.12.0
    Preparing search index...

    Function convertValue

    • Converts one value object to another one with a different compatible unit

      Type Parameters

      Parameters

      • value: T

        The value object to be converted

      • toUnit: T["unit"]

        The unit to convert into, must be compatible with the value object's unit

      Returns Value<T["unit"]>

      a new value object that contains the converted value

       const value = { value: 1, unit: m/s };
      const toUnit = mm/s;
      const convertedValue = convertValue(value, toUnit);
      console.log(convertedValue); // outputs { value: 1000, unit: mm/s };

      Error if the value object and the provided unit are incompatible

      valueRawConverter