nova-control-node 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
|
@@ -94,12 +94,13 @@ Controls how servo movements are executed when `withinMS` is specified on a move
|
|
|
94
94
|
|
|
95
95
|
```typescript
|
|
96
96
|
interface NovaController {
|
|
97
|
-
home ():Promise<void>
|
|
98
|
-
shiftHeadTo (
|
|
99
|
-
rollHeadTo (
|
|
100
|
-
pitchHeadTo (
|
|
101
|
-
liftHeadTo (
|
|
102
|
-
rotateBodyTo (
|
|
97
|
+
home (withinMS?:number):Promise<void>
|
|
98
|
+
shiftHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
99
|
+
rollHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
100
|
+
pitchHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
101
|
+
liftHeadTo (Angle:number, withinMS?:number):Promise<void>
|
|
102
|
+
rotateBodyTo (Angle:number, withinMS?:number):Promise<void>
|
|
103
|
+
moveTo (Target:ServoUpdate, withinMS?:number):Promise<void>
|
|
103
104
|
get State ():ServoState
|
|
104
105
|
set State (Update:ServoUpdate)
|
|
105
106
|
sendServoState ():Promise<void>
|
|
@@ -109,12 +110,12 @@ interface NovaController {
|
|
|
109
110
|
|
|
110
111
|
| method / property | description |
|
|
111
112
|
| --- | --- |
|
|
112
|
-
| `home()` | sends all servos to `HomePosition` |
|
|
113
|
-
| `shiftHeadTo(
|
|
114
|
-
| `rollHeadTo(
|
|
115
|
-
| `pitchHeadTo(
|
|
116
|
-
| `liftHeadTo(
|
|
117
|
-
| `rotateBodyTo(
|
|
113
|
+
| `home(withinMS?)` | sends all servos to `HomePosition` |
|
|
114
|
+
| `shiftHeadTo(Angle, withinMS?)` | sets s1 — head forward `> 90°`, back `< 90°` |
|
|
115
|
+
| `rollHeadTo(Angle, withinMS?)` | sets s2 — head clockwise `> 90°`, counter-clockwise `< 90°` |
|
|
116
|
+
| `pitchHeadTo(Angle, withinMS?)` | sets s3 — head up `> 110°`, down toward `40°` |
|
|
117
|
+
| `liftHeadTo(Angle, withinMS?)` | sets s5 — secondary head up/down, range `20°`–`150°` |
|
|
118
|
+
| `rotateBodyTo(Angle, withinMS?)` | sets s4 — rotates the entire body around the Z-axis |
|
|
118
119
|
| `moveTo(Target, withinMS?)` | moves the servos listed in `Target` to their target angles; with `withinMS`, uses the trapezoidal profile |
|
|
119
120
|
| `State` (get) | returns a deep copy of the pending state if any, else the last-sent state |
|
|
120
121
|
| `State` (set) | replaces any pending entry with `Update` merged onto the *last-sent* state (not onto pending); flush with `sendServoState()` |
|
|
@@ -140,12 +141,12 @@ Supported commands:
|
|
|
140
141
|
| command | description |
|
|
141
142
|
| --- | --- |
|
|
142
143
|
| `home [<within_ms>]` | send all servos to home positions |
|
|
143
|
-
| `shift-to <
|
|
144
|
-
| `roll-to <
|
|
145
|
-
| `pitch-to <
|
|
146
|
-
| `rotate-to <
|
|
147
|
-
| `lift-to <
|
|
148
|
-
| `move [shift-to <
|
|
144
|
+
| `shift-to <angle> [<within_ms>]` | s1 — head forward / back |
|
|
145
|
+
| `roll-to <angle> [<within_ms>]` | s2 — head CW / CCW |
|
|
146
|
+
| `pitch-to <angle> [<within_ms>]` | s3 — head up / down |
|
|
147
|
+
| `rotate-to <angle> [<within_ms>]` | s4 — body Z-axis rotation |
|
|
148
|
+
| `lift-to <angle> [<within_ms>]` | s5 — secondary head axis |
|
|
149
|
+
| `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`) |
|
|
149
150
|
| `wait <ms>` | pause for the given number of milliseconds |
|
|
150
151
|
|
|
151
152
|
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.
|