/** * Keyboard teleoperator for Web platform */ import { BaseWebTeleoperator, type TeleoperatorSpecificState } from "./base-teleoperator.js"; import type { KeyboardControl } from "../types/robot-config.js"; import type { KeyboardTeleoperatorConfig, MotorConfig, TeleoperationState } from "../types/teleoperation.js"; import type { MotorCommunicationPort } from "../utils/motor-communication.js"; /** * Default configuration values for keyboard teleoperator */ export declare const KEYBOARD_TELEOPERATOR_DEFAULTS: { readonly stepSize: 8; readonly updateRate: 60; readonly keyTimeout: 10000; }; export declare class KeyboardTeleoperator extends BaseWebTeleoperator { private keyboardControls; private updateInterval; private keyStates; private onStateUpdate?; private readonly stepSize; private readonly updateRate; private readonly keyTimeout; constructor(config: KeyboardTeleoperatorConfig, port: MotorCommunicationPort, motorConfigs: MotorConfig[], keyboardControls: { [key: string]: KeyboardControl; }, onStateUpdate?: (state: TeleoperationState) => void); initialize(): Promise; start(): void; stop(): void; getState(): TeleoperatorSpecificState; updateKeyState(key: string, pressed: boolean): void; /** * Move motor to exact position (for sliders and direct control) * This ensures sliders update the same motor configs that the UI displays */ moveMotor(motorName: string, targetPosition: number): Promise; private buildTeleoperationState; /** * IMPORTANT: This method implements the WORKING keyboard control logic. * * ⚠️ DO NOT MODIFY THIS LOGIC! ⚠️ * * This simple approach works perfectly: * - If key is pressed → apply movement every update cycle * - stepSize: 8 units per cycle at 60Hz = smooth, responsive control * - Single taps work naturally (brief key press = few cycles = small movement) * - Held keys work naturally (continuous press = continuous movement) * * Previous "improvements" that BROKE this: * ❌ Trying to detect "first press" vs "held" - breaks everything * ❌ Adding delays/thresholds - makes it clunky * ❌ Event-driven immediate movement - causes multiple applications * ❌ Higher stepSize values - too large jumps * * Keep it simple - this works! */ private updateMotorPositions; } //# sourceMappingURL=keyboard-teleoperator.d.ts.map