nova-control-browser 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,12 +89,13 @@ Controls how servo movements are executed when `withinMS` is specified on a move
|
|
|
89
89
|
|
|
90
90
|
```typescript
|
|
91
91
|
interface NovaController {
|
|
92
|
-
home ():Promise<void>
|
|
93
|
-
shiftHeadTo (
|
|
94
|
-
rollHeadTo (
|
|
95
|
-
pitchHeadTo (
|
|
96
|
-
liftHeadTo (
|
|
97
|
-
rotateBodyTo (
|
|
92
|
+
home (withinMS?:number):Promise<void>
|
|
93
|
+
shiftHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
94
|
+
rollHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
95
|
+
pitchHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
96
|
+
liftHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
97
|
+
rotateBodyTo (Angle:number, withinMS?:number):Promise<void>
|
|
98
|
+
moveTo (Target:ServoUpdate, withinMS?:number):Promise<void>
|
|
98
99
|
get State ():ServoState
|
|
99
100
|
set State (Update:ServoUpdate)
|
|
100
101
|
sendServoState ():Promise<void>
|
|
@@ -104,12 +105,12 @@ interface NovaController {
|
|
|
104
105
|
|
|
105
106
|
| method / property | description |
|
|
106
107
|
| --- | --- |
|
|
107
|
-
| `home()` | sends all servos to `HomePosition` |
|
|
108
|
-
| `shiftHeadTo(
|
|
109
|
-
| `rollHeadTo(
|
|
110
|
-
| `pitchHeadTo(
|
|
111
|
-
| `liftHeadTo(
|
|
112
|
-
| `rotateBodyTo(
|
|
108
|
+
| `home(withinMS?)` | sends all servos to `HomePosition` |
|
|
109
|
+
| `shiftHeadTo(Angle, withinMS?)` | sets s1 — head forward `> 90°`, back `< 90°` |
|
|
110
|
+
| `rollHeadTo(Angle, withinMS?)` | sets s2 — head clockwise `> 90°`, counter-clockwise `< 90°` |
|
|
111
|
+
| `pitchHeadTo(Angle, withinMS?)` | sets s3 — head up `> 110°`, down toward `40°` |
|
|
112
|
+
| `liftHeadTo(Angle, withinMS?)` | sets s5 — secondary head up/down, range `20°`–`150°` |
|
|
113
|
+
| `rotateBodyTo(Angle, withinMS?)` | sets s4 — rotates the entire body around the Z-axis |
|
|
113
114
|
| `moveTo(Target, withinMS?)` | moves the servos listed in `Target` to their target angles; with `withinMS`, uses the trapezoidal profile |
|
|
114
115
|
| `State` (get) | returns a deep copy of the pending state if any, else the last-sent state |
|
|
115
116
|
| `State` (set) | replaces any pending entry with `Update` merged onto the *last-sent* state (not onto pending); flush with `sendServoState()` |
|
|
@@ -135,12 +136,12 @@ Supported commands:
|
|
|
135
136
|
| command | description |
|
|
136
137
|
| --- | --- |
|
|
137
138
|
| `home [<within_ms>]` | send all servos to home positions |
|
|
138
|
-
| `shift-to <
|
|
139
|
-
| `roll-to <
|
|
140
|
-
| `pitch-to <
|
|
141
|
-
| `rotate-to <
|
|
142
|
-
| `lift-to <
|
|
143
|
-
| `move [shift-to <
|
|
139
|
+
| `shift-to <angle> [<within_ms>]` | s1 — head forward / back |
|
|
140
|
+
| `roll-to <angle> [<within_ms>]` | s2 — head CW / CCW |
|
|
141
|
+
| `pitch-to <angle> [<within_ms>]` | s3 — head up / down |
|
|
142
|
+
| `rotate-to <angle> [<within_ms>]` | s4 — body Z-axis rotation |
|
|
143
|
+
| `lift-to <angle> [<within_ms>]` | s5 — secondary head axis |
|
|
144
|
+
| `move [shift-to <angle>] [roll-to <angle>] [pitch-to <angle>] [rotate-to <angle>] [lift-to <angle>] [within-ms <ms>]` | set multiple servos atomically (e.g. `move shift-to 100 rotate-to 120 within-ms 500`) |
|
|
144
145
|
| `wait <ms>` | pause for the given number of milliseconds |
|
|
145
146
|
|
|
146
147
|
Each command is fully awaited before the next begins. Throws a descriptive error containing the line number if an unknown command or invalid argument is encountered.
|