Talos docs

ReleaseOptions

Since 0.6

Options for {@link WorldQuery.release}.

Plain text

Signature

export interface ReleaseOptions {
  /** Replaces the body's linear velocity as it is let go, m/s: a throw. Omitted, it keeps the velocity it was carried at. */
  velocity?: Vec3
}

Import: import type { ReleaseOptions } from "@argus/api"

Members

MemberSignatureDescription
velocityvelocity?: Vec3Replaces the body's linear velocity as it is let go, m/s: a throw. Omitted, it keeps the velocity it was carried at.

Example

The tested fixture fixtures/host/telemetry.ts.

import type { Behavior } from "@argus/api"
// docs/API.md, "Recording data": a flight controller's telemetry for `argus run --record-data`,
// beside the transforms the recorder reads itself. Typechecked by packages/api's tests.
export default {
  update(ctx) {
    const target = (ctx.props as { altitude: number }).altitude
    const y = ctx.entity.worldPosition[1]
    ctx.data.record("altitudeError", target - y)
    ctx.data.record("climbing", (ctx.body?.velocity[1] ?? 0) > 0)
    ctx.data.record("phase", Math.abs(target - y) < 0.1 ? "hold" : "seek")
  },
} satisfies Behavior