Wrist orientation

Updated: Nov 16, 2026

Overview

The Meta Neural Band reports its own orientation as a fused quaternion, so the attitude of the wearer’s wrist is updated continuously. Your Web App reads that single value and derives its desired input needs from it.
Inputs you can build on this data include:
  • Wrist roll. Twisting the forearm steers a dial, slider, or rotating object without the need to raise a hand into the field of view.
  • Pointing. Treating the forearm as a laser pointer moves a cursor or an aim point around the display.
  • Tilt. Raising and lowering the forearm drives a throttle, scroll position, or level indicator.
None of these arrives as a ready-made number. The platform provides the quaternion, and then each app derives the quantity it needs. Wrist roll and pointing are worked through below. Tilt follows the same pattern as pointing.
Note: Wrist orientation uses a different sensor from the glasses IMU described in Sensors. DeviceMotionEvent and DeviceOrientationEvent report the motion of the wearer’s head, while the Meta Neural Band reports the motion of the wearer’s wrist. Wrist orientation cannot be derived from the head APIs, and the two surfaces are read completely differently.
The band is exposed through the standard W3C Generic Sensor API⁠ as a RelativeOrientationSensor, selected with a sensorId of emg-wrist.
const wrist = new RelativeOrientationSensor({ sensorId: 'emg-wrist' });
wrist.onreading = () => { /* wrist.quaternion */ };
wrist.start();
Readings arrive in a canonical wrist frame. The runtime mirrors the band’s physical frame before your page sees it, so the same intended movement produces the same quaternion on either wrist. Never ask the wearer which wrist they are wearing the band on.
The mirror engages once the runtime learns which wrist the band is on, which can take a few seconds after start(), but occasionally, it never resolves. Treat a sudden sign inversion early in a stream as the frame settling rather than as wearer input, and do not capture a reference until readings are stable.
The band is a relative sensor, not an absolute one. It fuses its accelerometer and gyroscope only, with no magnetometer, so orientation is referenced to gravity, while its heading drifts slowly. Measure rotation as an offset from a reference you capture yourself, rather than trusting an absolute angle.

Check for the wrist sensor

Do not feature-detect with a bare typeof RelativeOrientationSensor. On hosts without the wrist sensor, this name still resolves to the browser’s own constructor, which ignores sensorId entirely. You would silently subscribe to the orientation of the host device instead of the band.
The glasses runtime adds the marker property. Remember to check it.
function hasWristSensor() {
  const Ctor = window.RelativeOrientationSensor;
  return typeof Ctor === 'function' && Ctor.__imuQuatWrapped === true;
}
The marker is injected after your page finishes loading, so it is reliably absent when your first scripts run and then usually lands a few hundred milliseconds later. Poll for a few seconds before concluding the sensor is unavailable, and design a keyboard or pinch fallback for hosts where it is genuinely not available. A device that has a band can still legitimately lack the marker because the surface is rolled out separately from the runtime.

Read the quaternion

Each reading exposes a four-component unit quaternion on sensor.quaternion and a sensor.timestamp.
const wrist = new RelativeOrientationSensor({ sensorId: 'emg-wrist' });

wrist.addEventListener('reading', () => {
  // Reorder into W3C [x, y, z, w] with the helpers in "Component order" below.
  const q = toW3C(wrist.quaternion, wristQuaternionOrder());
  if (!q) return;
  const [x, y, z, w] = q;
});

wrist.addEventListener('error', (e) => {
  // `NotAllowedError` when permission is denied or revoked mid-stream.
  // `NotReadableError` when the stream cannot start, most often a band that is not being worn. Retry this with a backoff.
  console.warn('wrist sensor stopped:', e.error.name);
});

wrist.start();
The frequency option is accepted as a best-effort hint but is not yet honored, and the underlying source runs at a fixed rate. Derive your own delta time from timestamp between readings rather, than assume a fixed interval.
Note:timestamp records when the reading is delivered to your page, not when the band samples it, so it carries some scheduling jitter.

Component order

On current builds, the four numbers arrive as [w, x, y, z], cyclically shifted by one from the [x, y, z, w] that the W3C Orientation Sensor specification defines. Newer builds say which order they use in RelativeOrientationSensor.__imuQuatOrder, either 'wxyz' or 'xyzw'. It applies to the emg-wrist sensor only and appears together with the __imuQuatWrapped marker. Read it once the marker is present, treat a missing value as 'wxyz', and reorder once at the boundary so everything downstream stays in spec order.
// The order the runtime fills `quaternion` in. Builds without the property send w-first.
function wristQuaternionOrder() {
  return window.RelativeOrientationSensor.__imuQuatOrder || 'wxyz';
}

// Reorder an incoming reading into W3C [x, y, z, w].
function toW3C(q, order) {
  if (!q || q.length < 4) return null;
  return order === 'xyzw' ? [q[0], q[1], q[2], q[3]] : [q[1], q[2], q[3], q[0]];
}
A shifted unit quaternion is still a unit quaternion, so nothing will throw and the stream will look healthy. It simply rotates about the wrong axis. If your input responds to wrist movement but in an axis you did not expect, check the order first. Read the order rather than assuming it, so your app stays correct when the platform is corrected.
Every example below assumes a reading already reordered into the W3C standard [x, y, z, w].

Derive an input

Two conventions anchor everything below:
  • The axis running along the forearm is local +Y in the band’s own frame.
  • Up is +Z in the world frame the readings are expressed in.
const FOREARM_AXIS = [0, 1, 0];
Resist the obvious approach of decomposing the quaternion into Euler angles and steering from one of them. No single Euler axis survives a wrist turning over: forearm twist rotates the band’s body frame and bleeds each angle into the others, so an axis that behaves correctly at one wrist position drifts as soon as the wearer rotates their arm. Derive the specific quantity your interaction needs instead.

Wrist roll

Roll is a rotation about the forearm axis. Project the vector part of the quaternion onto that axis to get the signed twist.
// Signed twist about the forearm axis, in radians, from a W3C [x, y, z, w] quaternion.
function twistAngle(q) {
  const d = q[0] * FOREARM_AXIS[0] + q[1] * FOREARM_AXIS[1] + q[2] * FOREARM_AXIS[2];
  return 2 * Math.atan2(d, q[3]);
}

// Wrap to [-PI, PI) so the step from +179 to -179 degrees reads as 2 degrees, not 358.
function wrapAngle(a) {
  const x = (a + Math.PI) % (2 * Math.PI);
  return (x < 0 ? x + 2 * Math.PI : x) - Math.PI;
}
Because the sensor is relative, you can capture a reference when your interaction begins and then report the difference from it.
let reference = null;

wrist.addEventListener('reading', () => {
  // Reorder first. Passing a raw w-first reading to twistAngle projects onto the
  // wrong components and yields an angle that moves but means nothing.
  const q = toW3C(wrist.quaternion, wristQuaternionOrder());
  if (!q) return;

  const angle = twistAngle(q);
  if (reference === null) reference = angle;
  const roll = wrapAngle(angle - reference); // offset from the reference, wrapped to +/-180 degrees
});
This form is accurate for a gesture performed with the arm held roughly where it was when you captured the reference (for example, a dial twisted once or a value nudged up or down). Where the forearm points leaks into how far the wrist reads as twisted, so moving the whole arm changes the reading even when the wrist does not turn.
Re-capturing the reference as the arm moves removes that leak at the cost of a drift that is geometric rather than noise. If you swing the forearm through a loop and back to rest, the reading comes back tens of degrees from where it started, and sampling faster does not reduce this disparity. That may be tolerable for a dial twisted once but is not tolerable for a control steered for minutes.
For a zero that survives a long session, anchor the angle to gravity instead. The quaternion is already gravity-referenced, so this needs no extra sensor. If you rotate an axis lying across the forearm into the world, the world in turn projects into the plane at right angles to the rotated forearm axis. The quaternion measures the rotated across-axis against what is left. The degree to which world up survives this projection is your confidence in the result. It falls to zero as the forearm approaches vertical, where gravity cannot resolve rotation about itself. Accordingly, make sure to gate on it before trusting the angle.

Where the forearm points

Pointing treats the forearm as a laser pointer. Rotate the forearm axis into the world and compare its direction against the one it had as a reference pose. Unlike roll, pointing is unaffected by the wrist turning over, because rotating about the pointing axis leaves that axis where it is.
// Rotate a vector by a W3C [x, y, z, w] quaternion.
function rotate(q, v) {
  const [x, y, z, w] = q;
  const [vx, vy, vz] = v;
  const tx = 2 * (y * vz - z * vy);
  const ty = 2 * (z * vx - x * vz);
  const tz = 2 * (x * vy - y * vx);
  return [
    vx + w * tx + (y * tz - z * ty),
    vy + w * ty + (z * tx - x * tz),
    vz + w * tz + (x * ty - y * tx),
  ];
}

// Where the forearm is aimed, in the world frame. The unit is as long as the reading is.
function pointingDirection(q) {
  return rotate(q, FOREARM_AXIS);
}
The horizontal part of that direction inherits the band’s heading drift, so you need to re-capture the reference pose at the start of each interaction, rather than once per session.

Keep the stream alive

By default, the band only streams its quaternion while a pinch is held. By default, there are no readings between pinches, but holding an active sensor subscription changes that. While any page can hold a started wrist sensor, the runtime asks the band to stream continuously and releases it back to pinch-only on the last stop(). The subscription is not merely how you read the samples-- it is what makes them exist.
In practice:
  • Call start() once when your input becomes relevant and keep the sensor running for as long as you need continuous readings.
  • Call stop() when you are done. Leaving a subscription open keeps the band in its higher-power streaming mode and costs user battery.
  • Do not create a new sensor per gesture. Repeated start and stop cycles make the band oscillate between modes and drop readings at the boundaries.
  • Expect the first few readings after start() to be unreliable while the band’s fusion settles. Discard them before capturing a reference, or you will zero your control at a pose the wearer was never in.
  • A subscription can be accepted and then stay silent, most often when the band is not being worn. The platform normally fails that case with NotReadableError after about five seconds, but it does not always manage to. Keep your own silence timer as a backstop, and set it comfortably longer than five seconds so the platform gets to name the failure first.

Permission

The wrist sensor uses the same sensor permission as DeviceMotionEvent and DeviceOrientationEvent. Since no separate wrist permission exists, granting sensor access once covers both the head and wrist surfaces for your domain.
Calling start() triggers the permission prompt if the wearer has not already decided. Handle the outcome on the sensor’s error event rather than a promise:
  • Permission denied: An error event with NotAllowedError.
  • Permission revoked mid-session: The wearer can turn sensor access off while your app is running. The stream is torn down, and you receive an error event with NotAllowedError. Re-calling start() will not restore it until the wearer re-grants the permission.
Do not block your app’s core flow on wrist input. Anything the wearer must finish should be reachable without it.

Best practices

ConsiderAvoid
Feature-detect with the __imuQuatWrapped marker.
typeof RelativeOrientationSensor, which silently subscribes to the wrong device.
Reorder each reading into [x, y, z, w] once, at the boundary, using __imuQuatOrder.
Passing the raw array to code that expects specification order, or hardcoding the order.
Derive the one quantity your interaction needs from the quaternion.
Decomposing to Euler angles and steering from a single axis.
Treat any angle as an offset from a reference you captured.
Trusting an absolute heading, which drifts.
Hold one subscription for the life of the interaction.
Creating and destroying a sensor per gesture.
Derive delta time from timestamp.
Assuming readings arrive at the frequency you requested.
Offer a pinch or keyboard path to the same action.
Making wrist movement the only way to complete a task.
Stop the sensor when the input is no longer needed.
Leaving the band in continuous mode for the whole session.