Skip to content
Mobile
Skill

/motion

Stream accelerometer, gyroscope, magnetometer, and orientation samples from connected wearables on Android

BOOST
From plugin
meta-wearables-dat-android
38117 skills
Install
$ npx -y skills add facebook/meta-wearables-dat-android --skill motion --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/motion

Context preview

The summary Claude sees to decide when to auto-load this skill.

Stream accelerometer, gyroscope, magnetometer, and orientation samples from connected wearables on Android

SKILL.md

motion.SKILL.md
name: motion
description: Stream accelerometer, gyroscope, magnetometer, and orientation samples from connected wearables on Android

Motion (Android)

Motion is an experimental capability for streaming inertial sensor samples. Enable it for the app in Wearables Developer Center. It has no runtime `Permission` value.

Attach, collect, and start

Call `addMotion` only after `DeviceSessionState.STARTED`. The returned capability starts in `STOPPED`; launch collectors before calling `start()`.

session.addMotion(
    MotionConfiguration(samplingRate = MotionSamplingRate.HZ_30),
).fold(
    onSuccess = { motion ->
        motionSampleJob = lifecycleScope.launch {
            motion.samples.collect { sample -> render(sample) }
        }
        motion.start()
    },
    onFailure = { error, _ -> showError(error.description) },
)

Retain the sample job while streaming. Collect `state` for lifecycle updates and `errors` for sensor, connection, and closure failures.

Sampling rates are 5, 10, 15, 24, 30, and 60 Hz; 10 Hz is the default.

Read samples defensively

`timestampNs` uses the device monotonic clock. Accelerometer values are m/s², gyroscope values are rad/s, and magnetometer values are µT. Each sensor value and orientation can be `null`; `source` identifies glasses, Neural Band, or an unknown source.

Motion normally transitions `STOPPED -> STARTING -> STARTED`. When its parent session pauses, it reports `MotionState.PAUSED` and automatically restarts when the session resumes.

Stop and remove

`motion.stop()` is reusable. Cancel the sample job before calling `session.removeMotion()` and handle its `DatResult`; removal is terminal.

Test with MockDeviceKit

Replay an in-memory recording with `glasses.services.motion.setMotionFeed(samples, loop = true)` or provide a CSV file URI. App logic should observe the SDK Motion state rather than `isStreaming`, which is a test assertion helper.

Availability

Motion is experimental. Apps can use it for development and beta testing, but cannot publish it to production release channels yet.

Read more
Ships withmeta-wearables-dat-android

The Meta Wearables Device Access Toolkit enables developers to utilize Meta's AI glasses to build hands-free wearable experiences into their mobile applications.

Get the whole plugin