@digipair/skill-mybuddy 0.23.11 → 0.23.12
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/index.cjs.js +12 -2
- package/index.esm.js +12 -3
- package/package.json +1 -1
- package/schema.json +45 -0
- package/src/lib/skill-mybuddy.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -52,15 +52,23 @@ let MyBuddyService = class MyBuddyService {
|
|
|
52
52
|
return result;
|
|
53
53
|
}
|
|
54
54
|
async sendAngle(params, _pinsSettingsList, context) {
|
|
55
|
-
const { device, id
|
|
55
|
+
const { device, id, degree, speed = 50 } = params;
|
|
56
56
|
const connection = await this.connect(params, context);
|
|
57
57
|
const result = connection.write(mybuddy__default["default"].sendAngle(device, id, degree, speed));
|
|
58
58
|
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
59
59
|
connection.close();
|
|
60
60
|
return result;
|
|
61
61
|
}
|
|
62
|
+
async sendCoord(params, _pinsSettingsList, context) {
|
|
63
|
+
const { device, id, coord, speed = 50 } = params;
|
|
64
|
+
const connection = await this.connect(params, context);
|
|
65
|
+
const result = connection.write(mybuddy__default["default"].sendCoord(device, id, coord, speed));
|
|
66
|
+
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
67
|
+
connection.close();
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
62
70
|
async sendCoords(params, _pinsSettingsList, context) {
|
|
63
|
-
const { device, coords, speed, mode } = params;
|
|
71
|
+
const { device, coords, speed = 50, mode = 0 } = params;
|
|
64
72
|
const connection = await this.connect(params, context);
|
|
65
73
|
const result = connection.write(mybuddy__default["default"].sendCoords(device, coords, speed, mode));
|
|
66
74
|
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
@@ -564,6 +572,7 @@ const powerOn = (params, pinsSettingsList, context)=>new MyBuddyService().powerO
|
|
|
564
572
|
const powerOff = (params, pinsSettingsList, context)=>new MyBuddyService().powerOff(params, pinsSettingsList, context);
|
|
565
573
|
const releaseAllServos = (params, pinsSettingsList, context)=>new MyBuddyService().releaseAllServos(params, pinsSettingsList, context);
|
|
566
574
|
const sendAngle = (params, pinsSettingsList, context)=>new MyBuddyService().sendAngle(params, pinsSettingsList, context);
|
|
575
|
+
const sendCoord = (params, pinsSettingsList, context)=>new MyBuddyService().sendCoord(params, pinsSettingsList, context);
|
|
567
576
|
const sendCoords = (params, pinsSettingsList, context)=>new MyBuddyService().sendCoords(params, pinsSettingsList, context);
|
|
568
577
|
const programPause = (params, pinsSettingsList, context)=>new MyBuddyService().programPause(params, pinsSettingsList, context);
|
|
569
578
|
const programResume = (params, pinsSettingsList, context)=>new MyBuddyService().programResume(params, pinsSettingsList, context);
|
|
@@ -632,6 +641,7 @@ exports.releaseAllServos = releaseAllServos;
|
|
|
632
641
|
exports.releaseServo = releaseServo;
|
|
633
642
|
exports.sendAngle = sendAngle;
|
|
634
643
|
exports.sendAngles = sendAngles;
|
|
644
|
+
exports.sendCoord = sendCoord;
|
|
635
645
|
exports.sendCoords = sendCoords;
|
|
636
646
|
exports.setBasicOutput = setBasicOutput;
|
|
637
647
|
exports.setColor = setColor;
|
package/index.esm.js
CHANGED
|
@@ -44,15 +44,23 @@ let MyBuddyService = class MyBuddyService {
|
|
|
44
44
|
return result;
|
|
45
45
|
}
|
|
46
46
|
async sendAngle(params, _pinsSettingsList, context) {
|
|
47
|
-
const { device, id
|
|
47
|
+
const { device, id, degree, speed = 50 } = params;
|
|
48
48
|
const connection = await this.connect(params, context);
|
|
49
49
|
const result = connection.write(mybuddy.sendAngle(device, id, degree, speed));
|
|
50
50
|
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
51
51
|
connection.close();
|
|
52
52
|
return result;
|
|
53
53
|
}
|
|
54
|
+
async sendCoord(params, _pinsSettingsList, context) {
|
|
55
|
+
const { device, id, coord, speed = 50 } = params;
|
|
56
|
+
const connection = await this.connect(params, context);
|
|
57
|
+
const result = connection.write(mybuddy.sendCoord(device, id, coord, speed));
|
|
58
|
+
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
59
|
+
connection.close();
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
54
62
|
async sendCoords(params, _pinsSettingsList, context) {
|
|
55
|
-
const { device, coords, speed, mode } = params;
|
|
63
|
+
const { device, coords, speed = 50, mode = 0 } = params;
|
|
56
64
|
const connection = await this.connect(params, context);
|
|
57
65
|
const result = connection.write(mybuddy.sendCoords(device, coords, speed, mode));
|
|
58
66
|
await new Promise((resolve)=>setTimeout(resolve, 50));
|
|
@@ -556,6 +564,7 @@ const powerOn = (params, pinsSettingsList, context)=>new MyBuddyService().powerO
|
|
|
556
564
|
const powerOff = (params, pinsSettingsList, context)=>new MyBuddyService().powerOff(params, pinsSettingsList, context);
|
|
557
565
|
const releaseAllServos = (params, pinsSettingsList, context)=>new MyBuddyService().releaseAllServos(params, pinsSettingsList, context);
|
|
558
566
|
const sendAngle = (params, pinsSettingsList, context)=>new MyBuddyService().sendAngle(params, pinsSettingsList, context);
|
|
567
|
+
const sendCoord = (params, pinsSettingsList, context)=>new MyBuddyService().sendCoord(params, pinsSettingsList, context);
|
|
559
568
|
const sendCoords = (params, pinsSettingsList, context)=>new MyBuddyService().sendCoords(params, pinsSettingsList, context);
|
|
560
569
|
const programPause = (params, pinsSettingsList, context)=>new MyBuddyService().programPause(params, pinsSettingsList, context);
|
|
561
570
|
const programResume = (params, pinsSettingsList, context)=>new MyBuddyService().programResume(params, pinsSettingsList, context);
|
|
@@ -595,4 +604,4 @@ const getBasicOutput = (params, pinsSettingsList, context)=>new MyBuddyService()
|
|
|
595
604
|
const isGripperMoving = (params, pinsSettingsList, context)=>new MyBuddyService().isGripperMoving(params, pinsSettingsList, context);
|
|
596
605
|
const sleep = (params, pinsSettingsList, context)=>new MyBuddyService().sleep(params, pinsSettingsList, context);
|
|
597
606
|
|
|
598
|
-
export { focusServo, getAngles, getBasicOutput, getCoords, getDigitalInput, getEncoder, getEncoders, getGripperValue, getJointMax, getJointMin, getServodata, getSpeed, isAllServoEnable, isControllerConnect, isGripperMoving, isInPosition, isPowerOn, isServoEnable, jogAngle, jogCoord, jogStop, powerOff, powerOn, programPause, programResume, releaseAllServos, releaseServo, sendAngle, sendAngles, sendCoords, setBasicOutput, setColor, setDigitalOutput, setEncoder, setEncoders, setGripperIni, setGripperState, setGripperValue, setPinMode, setServoCalibration, setServoData, setSpeed, sleep, stop };
|
|
607
|
+
export { focusServo, getAngles, getBasicOutput, getCoords, getDigitalInput, getEncoder, getEncoders, getGripperValue, getJointMax, getJointMin, getServodata, getSpeed, isAllServoEnable, isControllerConnect, isGripperMoving, isInPosition, isPowerOn, isServoEnable, jogAngle, jogCoord, jogStop, powerOff, powerOn, programPause, programResume, releaseAllServos, releaseServo, sendAngle, sendAngles, sendCoord, sendCoords, setBasicOutput, setColor, setDigitalOutput, setEncoder, setEncoders, setGripperIni, setGripperState, setGripperValue, setPinMode, setServoCalibration, setServoData, setSpeed, sleep, stop };
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -164,6 +164,51 @@
|
|
|
164
164
|
"x-events": []
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
|
+
"/sendCoord": {
|
|
168
|
+
"post": {
|
|
169
|
+
"tags": ["service"],
|
|
170
|
+
"summary": "Envoie les coordonnées",
|
|
171
|
+
"parameters": [
|
|
172
|
+
{
|
|
173
|
+
"name": "device",
|
|
174
|
+
"summary": "Identifiant du device",
|
|
175
|
+
"required": true,
|
|
176
|
+
"description": "Identifiant du device concerné (0 = Tous, 1 = Bras gauche, 2 = Bras droit, 3 = Corps)",
|
|
177
|
+
"schema": {
|
|
178
|
+
"type": "number"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "id",
|
|
183
|
+
"summary": "Coordonnée à modifier",
|
|
184
|
+
"required": true,
|
|
185
|
+
"description": "Identifiant de la coordonnée à envoyer",
|
|
186
|
+
"schema": {
|
|
187
|
+
"type": "number"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "coord",
|
|
192
|
+
"summary": "Valeur",
|
|
193
|
+
"required": true,
|
|
194
|
+
"description": "Valeur de la coordonnée à envoyer",
|
|
195
|
+
"schema": {
|
|
196
|
+
"type": "number"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "speed",
|
|
201
|
+
"summary": "Vitesse",
|
|
202
|
+
"required": false,
|
|
203
|
+
"description": "Vitesse de déplacement",
|
|
204
|
+
"schema": {
|
|
205
|
+
"type": "number"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"x-events": []
|
|
210
|
+
}
|
|
211
|
+
},
|
|
167
212
|
"/sendCoords": {
|
|
168
213
|
"post": {
|
|
169
214
|
"tags": ["service"],
|
|
@@ -5,6 +5,7 @@ export declare const powerOn: (params: any, pinsSettingsList: PinsSettings[], co
|
|
|
5
5
|
export declare const powerOff: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
6
6
|
export declare const releaseAllServos: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
7
7
|
export declare const sendAngle: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
8
|
+
export declare const sendCoord: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
8
9
|
export declare const sendCoords: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
9
10
|
export declare const programPause: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
10
11
|
export declare const programResume: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|