forked from hcrlab/stretch_web_interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.ts
94 lines (79 loc) · 2.24 KB
/
commands.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { Settings } from "../pages/operator/ts/model/model";
import { ValidJoints, Pose2D, NamedPose, uuid, RobotPose } from "./util";
import { Crop } from "./video_dimensions";
export type cmd = GeneralCommand | IncrementalMoveCommand | VelocityMoveCommand | NavGoalCommand | PoseGoalCommand | ClickMoveCommand | ConfigureCommand | CancelledGoalCommand | StartSessionCommand | StopSessionCommand;
interface Command {
robotState?: {
basePos: ROSLIB.Transform,
jointStates: RobotPose
}
timestamp?: number
}
interface GeneralCommand extends Command {
type: "command",
subtype: string,
name: string,
modifier?: any
}
interface IncrementalMoveCommand extends Command {
type: "incrementalMove",
jointName: ValidJoints,
increment: number
}
interface VelocityMoveCommand extends Command {
type: "velocityMove",
jointName: ValidJoints,
velocity: number
}
export interface NavGoalCommand extends Command {
type: "navGoal",
goal: Pose2D,
id: uuid,
}
export interface PoseGoalCommand extends Command {
type: "poseGoal",
goal: NamedPose,
id: uuid
}
export type CancelledGoalCommand = CancelledNavGoalCommand | CancelledPoseGoalCommand;
interface CancelledNavGoalCommand extends Command {
type: "cancelledGoal",
name: "nav",
goal: Pose2D,
id: uuid,
}
interface CancelledPoseGoalCommand extends Command {
type: "cancelledGoal",
name: "pose",
goal: NamedPose,
id: uuid,
}
export interface ClickMoveCommand extends Command {
type: "clickMove",
lin_vel: number,
ang_vel: number
}
type ConfigureCommand = ConfigureDriveCommand | ConfigureGripperCommand;
interface ConfigureDriveCommand extends Command {
type: "configure",
subtype: "drive",
name: "configure_mode",
modifier: "position" | "navigation"
}
interface ConfigureGripperCommand extends Command {
type: "configure",
subtype: "gripper" | "head",
name: "camera" | "overhead_camera" | "pantilt_camera",
crop: Crop,
rotate: boolean
}
interface StartSessionCommand extends Command {
type: "startSession",
username: string,
settings: Settings,
timestamp: number
}
interface StopSessionCommand extends Command {
type: "stopSession",
timestamp: number
}