
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
@vmosedge/sensor-simulator
Advanced tools
Android Sensor Simulator SDK - Accelerometer, Gyroscope, Magnetometer calculation based on official Android formulas
Android 传感器模拟器 SDK,用于在浏览器或 Node 环境中根据旋转/位移输入计算传感器数据。
npm install @vmosedge/sensor-simulator
# or
pnpm add @vmosedge/sensor-simulator
import { SensorSimulator, DeviceOrientation } from '@vmosedge/sensor-simulator'
const simulator = new SensorSimulator()
// 监听数据变化
simulator.on('change', (sensors) => {
console.log('accelerometer', sensors.accelerometer)
console.log('gyroscope', sensors.gyroscope)
console.log('magnetometer', sensors.magnetometer)
})
// 设置旋转角度 (度)
simulator.setRotation({ x: 10, y: 20, z: 30 })
// 设置设备方向 (0/90/180/270)
simulator.setDeviceOrientation(DeviceOrientation.LANDSCAPE_LEFT)
// X: Pitch, Y: Roll, Z: Yaw (单位: 度)
simulator.setRotation({
x: 15,
y: -10,
z: 45
})
// 位移 (单位: m)
simulator.setPosition({
x: 1.5,
y: 0.5,
z: -0.3
})
// 需要在动画循环中调用 update 处理线性加速度衰减
let last = performance.now()
const animate = () => {
const now = performance.now()
const deltaSeconds = (now - last) / 1000
last = now
simulator.update(deltaSeconds)
requestAnimationFrame(animate)
}
animate()
simulator.setDeviceOrientation(DeviceOrientation.PORTRAIT)
simulator.setDeviceOrientation(DeviceOrientation.LANDSCAPE_LEFT)
simulator.setDeviceOrientation(DeviceOrientation.PORTRAIT_REVERSE)
simulator.setDeviceOrientation(DeviceOrientation.LANDSCAPE_RIGHT)
const simulator = new SensorSimulator({
gravity: 9.80665,
magneticField: { x: 0, y: 5.9, z: -48.4 },
linearDecaySeconds: 0.08,
maxLinearAccel: 34.3,
linearEpsilon: 0.01
})
SDK 仅负责传感器数值计算,不包含网络请求与 UI 渲染。
FAQs
Android Sensor Simulator SDK - Accelerometer, Gyroscope, Magnetometer calculation based on official Android formulas
We found that @vmosedge/sensor-simulator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.