@wandelbots/nova-js 3.3.0 → 3.3.1-pr.feature-add-program-client.114.5cf553e

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.
@@ -7,6 +7,108 @@ let path_to_regexp = require("path-to-regexp");
7
7
  path_to_regexp = require_LoginWithAuth0.__toESM(path_to_regexp);
8
8
  let __wandelbots_nova_api_v2 = require("@wandelbots/nova-api/v2");
9
9
 
10
+ //#region src/lib/v2/ProgramsClient.ts
11
+ /**
12
+ * Enhanced client for the Programs API providing intuitive program management
13
+ */
14
+ var ProgramsClient = class {
15
+ constructor(client) {
16
+ this.client = client;
17
+ }
18
+ /**
19
+ * Get the underlying programs API for direct access
20
+ */
21
+ get api() {
22
+ return this.client.programs;
23
+ }
24
+ /**
25
+ * List all programs available in the cell
26
+ */
27
+ async list() {
28
+ return await this.api.listPrograms();
29
+ }
30
+ /**
31
+ * Get details of a specific program
32
+ */
33
+ async get(programId) {
34
+ return await this.api.getProgram(programId);
35
+ }
36
+ /**
37
+ * Start a program with the given arguments
38
+ */
39
+ async start(programId, args = {}) {
40
+ const startRequest = { arguments: args };
41
+ return await this.api.startProgram(programId, startRequest);
42
+ }
43
+ /**
44
+ * Stop a running program
45
+ */
46
+ async stop(programId) {
47
+ return await this.api.stopProgram(programId);
48
+ }
49
+ /**
50
+ * Execute a program and wait for it to complete
51
+ *
52
+ * Note: This method has limitations due to current API constraints.
53
+ * Real-time program state tracking will be available via NATS messaging
54
+ * in future versions. For now, this provides basic start functionality.
55
+ *
56
+ * @param programId - The program identifier
57
+ * @param args - Arguments to pass to the program
58
+ * @param options - Basic execution options
59
+ */
60
+ async execute(programId, args = {}, options = {}) {
61
+ const { onStart } = options;
62
+ const run = await this.start(programId, args);
63
+ if (onStart) onStart(run);
64
+ return run;
65
+ }
66
+ /**
67
+ * Create a program runner helper for a specific program
68
+ */
69
+ forProgram(programId) {
70
+ return new ProgramRunner(this, programId);
71
+ }
72
+ };
73
+ /**
74
+ * Helper class for managing a specific program
75
+ */
76
+ var ProgramRunner = class {
77
+ constructor(programs, programId) {
78
+ this.programs = programs;
79
+ this.programId = programId;
80
+ }
81
+ /**
82
+ * Get program details
83
+ */
84
+ async getDetails() {
85
+ return await this.programs.get(this.programId);
86
+ }
87
+ /**
88
+ * Start this program
89
+ */
90
+ async start(args = {}) {
91
+ return await this.programs.start(this.programId, args);
92
+ }
93
+ /**
94
+ * Stop this program
95
+ */
96
+ async stop() {
97
+ return await this.programs.stop(this.programId);
98
+ }
99
+ /**
100
+ * Execute this program (start and get initial run information)
101
+ *
102
+ * Note: This method has limitations due to current API constraints.
103
+ * Real-time program state tracking will be available via NATS messaging
104
+ * in future versions.
105
+ */
106
+ async execute(args = {}, options = {}) {
107
+ return await this.programs.execute(this.programId, args, options);
108
+ }
109
+ };
110
+
111
+ //#endregion
10
112
  //#region src/lib/v2/NovaCellAPIClient.ts
11
113
  /**
12
114
  * API client providing type-safe access to all the Nova API REST endpoints
@@ -25,6 +127,7 @@ var NovaCellAPIClient = class {
25
127
  this.trajectoryPlanning = this.withCellId(__wandelbots_nova_api_v2.TrajectoryPlanningApi);
26
128
  this.trajectoryExecution = this.withCellId(__wandelbots_nova_api_v2.TrajectoryExecutionApi);
27
129
  this.trajectoryCaching = this.withCellId(__wandelbots_nova_api_v2.TrajectoryCachingApi);
130
+ this.programs = this.withCellId(__wandelbots_nova_api_v2.ProgramApi);
28
131
  this.application = this.withCellId(__wandelbots_nova_api_v2.ApplicationApi);
29
132
  this.applicationGlobal = this.withUnwrappedResponsesOnly(__wandelbots_nova_api_v2.ApplicationApi);
30
133
  this.jogging = this.withCellId(__wandelbots_nova_api_v2.JoggingApi);
@@ -75,6 +178,10 @@ var NovaCellAPIClient = class {
75
178
  }
76
179
  return apiClient;
77
180
  }
181
+ get programsClient() {
182
+ if (!this._programsClient) this._programsClient = new ProgramsClient(this);
183
+ return this._programsClient;
184
+ }
78
185
  };
79
186
 
80
187
  //#endregion
@@ -88,6 +195,28 @@ var MockNovaInstance = class {
88
195
  }
89
196
  async handleAPIRequest(config) {
90
197
  const apiHandlers = [
198
+ {
199
+ method: "GET",
200
+ path: "/cells/:cellId/controllers",
201
+ handle() {
202
+ return ["mock-ur5e"];
203
+ }
204
+ },
205
+ {
206
+ method: "GET",
207
+ path: "/cells/:cellId/controllers/:controllerId",
208
+ handle() {
209
+ return {
210
+ configuration: {
211
+ initial_joint_position: "[0,-1.571,-1.571,-1.571,1.571,-1.571,0]",
212
+ kind: "VirtualController",
213
+ manufacturer: "universalrobots",
214
+ type: "universalrobots-ur5e"
215
+ },
216
+ name: "mock-ur5"
217
+ };
218
+ }
219
+ },
91
220
  {
92
221
  method: "GET",
93
222
  path: "/cells/:cellId/controllers/:controllerId/state",
@@ -163,43 +292,6 @@ var MockNovaInstance = class {
163
292
  };
164
293
  }
165
294
  },
166
- {
167
- method: "GET",
168
- path: "/cells/:cellId/controllers/:controllerId/coordinate-systems",
169
- handle() {
170
- return [{
171
- coordinate_system: "",
172
- name: "world",
173
- reference_coordinate_system: "",
174
- position: [
175
- 0,
176
- 0,
177
- 0
178
- ],
179
- orientation: [
180
- 0,
181
- 0,
182
- 0
183
- ],
184
- orientation_type: "ROTATION_VECTOR"
185
- }, {
186
- coordinate_system: "CS-0",
187
- name: "Default-CS",
188
- reference_coordinate_system: "",
189
- position: [
190
- 0,
191
- 0,
192
- 0
193
- ],
194
- orientation: [
195
- 0,
196
- 0,
197
- 0
198
- ],
199
- orientation_type: "ROTATION_VECTOR"
200
- }];
201
- }
202
- },
203
295
  {
204
296
  method: "GET",
205
297
  path: "/cells/:cellId/controllers/:controllerId/motion-groups/:motionGroupId/description",
@@ -218,68 +310,21 @@ var MockNovaInstance = class {
218
310
  0
219
311
  ]
220
312
  },
221
- tcps: {
222
- Flange: {
223
- name: "Default-Flange",
224
- pose: {
225
- position: [
226
- 0,
227
- 0,
228
- 0
229
- ],
230
- orientation: [
231
- 0,
232
- 0,
233
- 0
234
- ]
235
- }
236
- },
237
- "complex-tcp-position": {
238
- name: "Complex TCP Position",
239
- pose: {
240
- position: [
241
- -200,
242
- 300,
243
- 150
244
- ],
245
- orientation: [
246
- -.12139440409113832,
247
- -.06356210998212003,
248
- -.2023240068185639
249
- ]
250
- }
251
- },
252
- "offset-150mm-xy": {
253
- name: "-150mm XY Offset",
254
- pose: {
255
- position: [
256
- -150,
257
- -150,
258
- 0
259
- ],
260
- orientation: [
261
- 0,
262
- 0,
263
- 0
264
- ]
265
- }
266
- },
267
- "rotated-90deg-z": {
268
- name: "90° Z Axis Rotation",
269
- pose: {
270
- position: [
271
- 0,
272
- 0,
273
- 0
274
- ],
275
- orientation: [
276
- 0,
277
- 0,
278
- 1.5708
279
- ]
280
- }
313
+ tcps: { Flange: {
314
+ name: "Default-Flange",
315
+ pose: {
316
+ position: [
317
+ 0,
318
+ 0,
319
+ 0
320
+ ],
321
+ orientation: [
322
+ 0,
323
+ 0,
324
+ 0
325
+ ]
281
326
  }
282
- },
327
+ } },
283
328
  payloads: { "FPay-0": {
284
329
  name: "FPay-0",
285
330
  payload: 0,
@@ -558,861 +603,39 @@ var MockNovaInstance = class {
558
603
  },
559
604
  {
560
605
  method: "GET",
561
- path: "/cells/:cellId/controllers",
562
- handle() {
563
- return { controllers: [{
564
- controller: "mock-ur5e",
565
- model_name: "UniversalRobots::Controller",
566
- host: "mock-ur5e",
567
- allow_software_install_on_controller: true,
568
- motion_groups: [{
569
- motion_group: "0@mock-ur5e",
570
- name_from_controller: "UR5e",
571
- active: false,
572
- model_from_controller: "UniversalRobots_UR5e"
573
- }],
574
- has_error: false,
575
- error_details: ""
576
- }] };
577
- }
578
- },
579
- {
580
- method: "GET",
581
- path: "/cells/:cellId/controllers/:controllerId",
582
- handle() {
583
- return {
584
- configuration: {
585
- kind: "VirtualController",
586
- manufacturer: "universalrobots",
587
- type: "universalrobots-ur5e"
588
- },
589
- name: "mock-ur5"
590
- };
591
- }
592
- },
593
- {
594
- method: "GET",
595
- path: "/cells/:cellId/motion-groups/:motionGroupId/specification",
596
- handle() {
597
- return {
598
- dh_parameters: [
599
- {
600
- alpha: 1.5707963267948966,
601
- theta: 0,
602
- a: 0,
603
- d: 162.25,
604
- reverse_rotation_direction: false
605
- },
606
- {
607
- alpha: 0,
608
- theta: 0,
609
- a: -425,
610
- d: 0,
611
- reverse_rotation_direction: false
612
- },
613
- {
614
- alpha: 0,
615
- theta: 0,
616
- a: -392.2,
617
- d: 0,
618
- reverse_rotation_direction: false
619
- },
620
- {
621
- alpha: 1.5707963267948966,
622
- theta: 0,
623
- a: 0,
624
- d: 133.3,
625
- reverse_rotation_direction: false
626
- },
627
- {
628
- alpha: -1.5707963267948966,
629
- theta: 0,
630
- a: 0,
631
- d: 99.7,
632
- reverse_rotation_direction: false
633
- },
634
- {
635
- alpha: 0,
636
- theta: 0,
637
- a: 0,
638
- d: 99.6,
639
- reverse_rotation_direction: false
640
- }
641
- ],
642
- mechanical_joint_limits: [
643
- {
644
- joint: "JOINTNAME_AXIS_1",
645
- lower_limit: -6.335545063018799,
646
- upper_limit: 6.335545063018799,
647
- unlimited: false
648
- },
649
- {
650
- joint: "JOINTNAME_AXIS_2",
651
- lower_limit: -6.335545063018799,
652
- upper_limit: 6.335545063018799,
653
- unlimited: false
654
- },
655
- {
656
- joint: "JOINTNAME_AXIS_3",
657
- lower_limit: -6.335545063018799,
658
- upper_limit: 6.335545063018799,
659
- unlimited: false
660
- },
661
- {
662
- joint: "JOINTNAME_AXIS_4",
663
- lower_limit: -6.335545063018799,
664
- upper_limit: 6.335545063018799,
665
- unlimited: false
666
- },
667
- {
668
- joint: "JOINTNAME_AXIS_5",
669
- lower_limit: -6.335545063018799,
670
- upper_limit: 6.335545063018799,
671
- unlimited: false
672
- },
673
- {
674
- joint: "JOINTNAME_AXIS_6",
675
- lower_limit: -6.335545063018799,
676
- upper_limit: 6.335545063018799,
677
- unlimited: false
678
- }
679
- ]
680
- };
681
- }
682
- },
683
- {
684
- method: "GET",
685
- path: "/cells/:cellId/motion-groups/:motionGroupId/safety-setup",
686
- handle() {
687
- return {
688
- safety_settings: [{
689
- safety_state: "SAFETY_NORMAL",
690
- settings: {
691
- joint_position_limits: [
692
- {
693
- joint: "JOINTNAME_AXIS_1",
694
- lower_limit: -2.96705961227417,
695
- upper_limit: 2.96705961227417,
696
- unlimited: false
697
- },
698
- {
699
- joint: "JOINTNAME_AXIS_2",
700
- lower_limit: -1.7453292608261108,
701
- upper_limit: 2.7925267219543457,
702
- unlimited: false
703
- },
704
- {
705
- joint: "JOINTNAME_AXIS_3",
706
- lower_limit: -3.3161256313323975,
707
- upper_limit: .40142571926116943,
708
- unlimited: false
709
- },
710
- {
711
- joint: "JOINTNAME_AXIS_4",
712
- lower_limit: -3.4906585216522217,
713
- upper_limit: 3.4906585216522217,
714
- unlimited: false
715
- },
716
- {
717
- joint: "JOINTNAME_AXIS_5",
718
- lower_limit: -2.4434609413146973,
719
- upper_limit: 2.4434609413146973,
720
- unlimited: false
721
- },
722
- {
723
- joint: "JOINTNAME_AXIS_6",
724
- lower_limit: -4.71238899230957,
725
- upper_limit: 4.71238899230957,
726
- unlimited: false
727
- }
728
- ],
729
- joint_velocity_limits: [
730
- {
731
- joint: "JOINTNAME_AXIS_1",
732
- limit: 3.1415927410125732
733
- },
734
- {
735
- joint: "JOINTNAME_AXIS_2",
736
- limit: 3.1415927410125732
737
- },
738
- {
739
- joint: "JOINTNAME_AXIS_3",
740
- limit: 3.4906585216522217
741
- },
742
- {
743
- joint: "JOINTNAME_AXIS_4",
744
- limit: 6.108652591705322
745
- },
746
- {
747
- joint: "JOINTNAME_AXIS_5",
748
- limit: 6.108652591705322
749
- },
750
- {
751
- joint: "JOINTNAME_AXIS_6",
752
- limit: 6.981317043304443
753
- }
754
- ],
755
- joint_acceleration_limits: [],
756
- joint_torque_limits: [],
757
- tcp_velocity_limit: 1800
758
- }
759
- }],
760
- safety_zones: [
761
- {
762
- id: 1,
763
- priority: 0,
764
- geometry: {
765
- compound: { child_geometries: [
766
- {
767
- convex_hull: { vertices: [
768
- { vertex: [
769
- -800,
770
- -1330,
771
- -1820
772
- ] },
773
- { vertex: [
774
- 1650,
775
- -1330,
776
- -1820
777
- ] },
778
- { vertex: [
779
- 1650,
780
- 1330,
781
- -1820
782
- ] },
783
- { vertex: [
784
- -800,
785
- 1330,
786
- -1820
787
- ] }
788
- ] },
789
- init_pose: {
790
- position: [
791
- 0,
792
- 0,
793
- 0
794
- ],
795
- orientation: [
796
- 0,
797
- 0,
798
- 0,
799
- 1
800
- ]
801
- },
802
- id: "box"
803
- },
804
- {
805
- convex_hull: { vertices: [
806
- { vertex: [
807
- -800,
808
- -1330,
809
- -1820
810
- ] },
811
- { vertex: [
812
- 1650,
813
- -1330,
814
- -1820
815
- ] },
816
- { vertex: [
817
- 1650,
818
- -1330,
819
- 1500
820
- ] },
821
- { vertex: [
822
- -800,
823
- -1330,
824
- 1500
825
- ] }
826
- ] },
827
- init_pose: {
828
- position: [
829
- 0,
830
- 0,
831
- 0
832
- ],
833
- orientation: [
834
- 0,
835
- 0,
836
- 0,
837
- 1
838
- ]
839
- },
840
- id: "box"
841
- },
842
- {
843
- convex_hull: { vertices: [
844
- { vertex: [
845
- -800,
846
- -1330,
847
- -1820
848
- ] },
849
- { vertex: [
850
- -800,
851
- 1330,
852
- -1820
853
- ] },
854
- { vertex: [
855
- -800,
856
- 1330,
857
- 1500
858
- ] },
859
- { vertex: [
860
- -800,
861
- -1330,
862
- 1500
863
- ] }
864
- ] },
865
- init_pose: {
866
- position: [
867
- 0,
868
- 0,
869
- 0
870
- ],
871
- orientation: [
872
- 0,
873
- 0,
874
- 0,
875
- 1
876
- ]
877
- },
878
- id: "box"
879
- },
880
- {
881
- convex_hull: { vertices: [
882
- { vertex: [
883
- 1650,
884
- 1330,
885
- 1500
886
- ] },
887
- { vertex: [
888
- -800,
889
- 1330,
890
- 1500
891
- ] },
892
- { vertex: [
893
- -800,
894
- -1330,
895
- 1500
896
- ] },
897
- { vertex: [
898
- 1650,
899
- -1330,
900
- 1500
901
- ] }
902
- ] },
903
- init_pose: {
904
- position: [
905
- 0,
906
- 0,
907
- 0
908
- ],
909
- orientation: [
910
- 0,
911
- 0,
912
- 0,
913
- 1
914
- ]
915
- },
916
- id: "box"
917
- },
918
- {
919
- convex_hull: { vertices: [
920
- { vertex: [
921
- 1650,
922
- 1330,
923
- 1500
924
- ] },
925
- { vertex: [
926
- -800,
927
- 1330,
928
- 1500
929
- ] },
930
- { vertex: [
931
- -800,
932
- 1330,
933
- -1820
934
- ] },
935
- { vertex: [
936
- 1650,
937
- 1330,
938
- -1820
939
- ] }
940
- ] },
941
- init_pose: {
942
- position: [
943
- 0,
944
- 0,
945
- 0
946
- ],
947
- orientation: [
948
- 0,
949
- 0,
950
- 0,
951
- 1
952
- ]
953
- },
954
- id: "box"
955
- },
956
- {
957
- convex_hull: { vertices: [
958
- { vertex: [
959
- 1650,
960
- 1330,
961
- 1500
962
- ] },
963
- { vertex: [
964
- 1650,
965
- -1330,
966
- 1500
967
- ] },
968
- { vertex: [
969
- 1650,
970
- -1330,
971
- -1820
972
- ] },
973
- { vertex: [
974
- 1650,
975
- 1330,
976
- -1820
977
- ] }
978
- ] },
979
- init_pose: {
980
- position: [
981
- 0,
982
- 0,
983
- 0
984
- ],
985
- orientation: [
986
- 0,
987
- 0,
988
- 0,
989
- 1
990
- ]
991
- },
992
- id: "box"
993
- }
994
- ] },
995
- init_pose: {
996
- position: [
997
- 0,
998
- 0,
999
- 0
1000
- ],
1001
- orientation: [
1002
- 0,
1003
- 0,
1004
- 0,
1005
- 1
1006
- ]
1007
- },
1008
- id: "Cell workzone"
1009
- },
1010
- motion_group_uid: 1
1011
- },
1012
- {
1013
- id: 2,
1014
- priority: 0,
1015
- geometry: {
1016
- convex_hull: { vertices: [
1017
- { vertex: [
1018
- 1650,
1019
- 1330,
1020
- -1850
1021
- ] },
1022
- { vertex: [
1023
- 865,
1024
- 1330,
1025
- -1850
1026
- ] },
1027
- { vertex: [
1028
- 865,
1029
- -720,
1030
- -1850
1031
- ] },
1032
- { vertex: [
1033
- 1650,
1034
- -720,
1035
- -1850
1036
- ] },
1037
- { vertex: [
1038
- 1650,
1039
- 1330,
1040
- -920
1041
- ] },
1042
- { vertex: [
1043
- 865,
1044
- 1330,
1045
- -920
1046
- ] },
1047
- { vertex: [
1048
- 865,
1049
- -720,
1050
- -920
1051
- ] },
1052
- { vertex: [
1053
- 1650,
1054
- -720,
1055
- -920
1056
- ] }
1057
- ] },
1058
- init_pose: {
1059
- position: [
1060
- 0,
1061
- 0,
1062
- 0
1063
- ],
1064
- orientation: [
1065
- 0,
1066
- 0,
1067
- 0,
1068
- 1
1069
- ]
1070
- },
1071
- id: "Transport"
1072
- },
1073
- motion_group_uid: 1
1074
- },
1075
- {
1076
- id: 3,
1077
- priority: 0,
1078
- geometry: {
1079
- convex_hull: { vertices: [
1080
- { vertex: [
1081
- 1650,
1082
- 1330,
1083
- -600
1084
- ] },
1085
- { vertex: [
1086
- 865,
1087
- 1330,
1088
- -600
1089
- ] },
1090
- { vertex: [
1091
- 865,
1092
- 430,
1093
- -600
1094
- ] },
1095
- { vertex: [
1096
- 1650,
1097
- 430,
1098
- -600
1099
- ] },
1100
- { vertex: [
1101
- 1650,
1102
- 1330,
1103
- -1250
1104
- ] },
1105
- { vertex: [
1106
- 865,
1107
- 1330,
1108
- -1250
1109
- ] },
1110
- { vertex: [
1111
- 865,
1112
- 430,
1113
- -1250
1114
- ] },
1115
- { vertex: [
1116
- 1650,
1117
- 430,
1118
- -1250
1119
- ] }
1120
- ] },
1121
- init_pose: {
1122
- position: [
1123
- 0,
1124
- 0,
1125
- 0
1126
- ],
1127
- orientation: [
1128
- 0,
1129
- 0,
1130
- 0,
1131
- 1
1132
- ]
1133
- },
1134
- id: "Tunel"
1135
- },
1136
- motion_group_uid: 1
1137
- },
1138
- {
1139
- id: 4,
1140
- priority: 0,
1141
- geometry: {
1142
- convex_hull: { vertices: [
1143
- { vertex: [
1144
- 1650,
1145
- -760,
1146
- -440
1147
- ] },
1148
- { vertex: [
1149
- 900,
1150
- -760,
1151
- -440
1152
- ] },
1153
- { vertex: [
1154
- 900,
1155
- -1330,
1156
- -440
1157
- ] },
1158
- { vertex: [
1159
- 1650,
1160
- -1330,
1161
- -440
1162
- ] },
1163
- { vertex: [
1164
- 1650,
1165
- -760,
1166
- -1800
1167
- ] },
1168
- { vertex: [
1169
- 900,
1170
- -760,
1171
- -1800
1172
- ] },
1173
- { vertex: [
1174
- 900,
1175
- -1330,
1176
- -1800
1177
- ] },
1178
- { vertex: [
1179
- 1650,
1180
- -1330,
1181
- -1800
1182
- ] }
1183
- ] },
1184
- init_pose: {
1185
- position: [
1186
- 0,
1187
- 0,
1188
- 0
1189
- ],
1190
- orientation: [
1191
- 0,
1192
- 0,
1193
- 0,
1194
- 1
1195
- ]
1196
- },
1197
- id: "Fanuc controller"
1198
- },
1199
- motion_group_uid: 1
1200
- },
1201
- {
1202
- id: 6,
1203
- priority: 0,
1204
- geometry: {
1205
- convex_hull: { vertices: [
1206
- { vertex: [
1207
- -200,
1208
- -200,
1209
- -1900
1210
- ] },
1211
- { vertex: [
1212
- 200,
1213
- -200,
1214
- -1900
1215
- ] },
1216
- { vertex: [
1217
- 200,
1218
- 200,
1219
- -1900
1220
- ] },
1221
- { vertex: [
1222
- -200,
1223
- 200,
1224
- -1900
1225
- ] },
1226
- { vertex: [
1227
- -200,
1228
- -200,
1229
- -350
1230
- ] },
1231
- { vertex: [
1232
- 200,
1233
- -200,
1234
- -350
1235
- ] },
1236
- { vertex: [
1237
- 200,
1238
- 200,
1239
- -350
1240
- ] },
1241
- { vertex: [
1242
- -200,
1243
- 200,
1244
- -350
1245
- ] }
1246
- ] },
1247
- init_pose: {
1248
- position: [
1249
- 0,
1250
- 0,
1251
- 0
1252
- ],
1253
- orientation: [
1254
- 0,
1255
- 0,
1256
- 0,
1257
- 1
1258
- ]
1259
- },
1260
- id: "Robot base"
1261
- },
1262
- motion_group_uid: 1
1263
- }
1264
- ],
1265
- robot_model_geometries: [
1266
- {
1267
- link_index: 1,
1268
- geometry: {
1269
- sphere: { radius: 270 },
1270
- init_pose: {
1271
- position: [
1272
- -70,
1273
- -70,
1274
- -50
1275
- ],
1276
- orientation: [
1277
- 0,
1278
- 0,
1279
- 0,
1280
- 1
1281
- ]
1282
- },
1283
- id: "link1_sphere"
1284
- }
1285
- },
1286
- {
1287
- link_index: 2,
1288
- geometry: {
1289
- capsule: {
1290
- radius: 160,
1291
- cylinder_height: 800
1292
- },
1293
- init_pose: {
1294
- position: [
1295
- -450,
1296
- 40,
1297
- 170
1298
- ],
1299
- orientation: [
1300
- 0,
1301
- -Math.SQRT1_2,
1302
- 0,
1303
- Math.SQRT1_2
1304
- ]
1305
- },
1306
- id: "link2_capsule"
1307
- }
1308
- },
1309
- {
1310
- link_index: 3,
1311
- geometry: {
1312
- sphere: { radius: 270 },
1313
- init_pose: {
1314
- position: [
1315
- -110,
1316
- 10,
1317
- -100
1318
- ],
1319
- orientation: [
1320
- 0,
1321
- 0,
1322
- 0,
1323
- 1
1324
- ]
1325
- },
1326
- id: "link3_sphere"
1327
- }
1328
- },
1329
- {
1330
- link_index: 4,
1331
- geometry: {
1332
- capsule: {
1333
- radius: 110,
1334
- cylinder_height: 600
1335
- },
1336
- init_pose: {
1337
- position: [
1338
- 0,
1339
- 300,
1340
- 40
1341
- ],
1342
- orientation: [
1343
- -Math.SQRT1_2,
1344
- 0,
1345
- 0,
1346
- Math.SQRT1_2
1347
- ]
1348
- },
1349
- id: "link4_capsule"
1350
- }
1351
- },
1352
- {
1353
- link_index: 5,
1354
- geometry: {
1355
- sphere: { radius: 75 },
1356
- init_pose: {
1357
- position: [
1358
- 0,
1359
- 0,
1360
- -50
1361
- ],
1362
- orientation: [
1363
- 0,
1364
- 0,
1365
- 0,
1366
- 1
1367
- ]
1368
- },
1369
- id: "link5_sphere"
1370
- }
1371
- }
1372
- ],
1373
- tool_geometries: []
1374
- };
1375
- }
1376
- },
1377
- {
1378
- method: "GET",
1379
- path: "/cells/:cellId/motion-groups/:motionGroupId/tcps",
606
+ path: "/cells/:cellId/controllers/:controllerId/coordinate-systems",
1380
607
  handle() {
1381
- return { tcps: [{
1382
- id: "Flange",
1383
- readable_name: "Default-Flange",
608
+ return [{
609
+ coordinate_system: "",
610
+ name: "world",
611
+ reference_coordinate_system: "",
1384
612
  position: [
1385
613
  0,
1386
614
  0,
1387
615
  0
1388
616
  ],
1389
- rotation: {
1390
- angles: [
1391
- 0,
1392
- 0,
1393
- 0,
1394
- 0
1395
- ],
1396
- type: "ROTATION_VECTOR"
1397
- }
617
+ orientation: [
618
+ 0,
619
+ 0,
620
+ 0
621
+ ],
622
+ orientation_type: "ROTATION_VECTOR"
1398
623
  }, {
1399
- id: "complex-tcp-position",
1400
- readable_name: "Complex TCP Position",
624
+ coordinate_system: "CS-0",
625
+ name: "Default-CS",
626
+ reference_coordinate_system: "",
1401
627
  position: [
1402
- -200,
1403
- 300,
1404
- 150
628
+ 0,
629
+ 0,
630
+ 0
1405
631
  ],
1406
- rotation: {
1407
- angles: [
1408
- -.12139440409113832,
1409
- -.06356210998212003,
1410
- -.2023240068185639,
1411
- 0
1412
- ],
1413
- type: "ROTATION_VECTOR"
1414
- }
1415
- }] };
632
+ orientation: [
633
+ 0,
634
+ 0,
635
+ 0
636
+ ],
637
+ orientation_type: "ROTATION_VECTOR"
638
+ }];
1416
639
  }
1417
640
  }
1418
641
  ];
@@ -1440,209 +663,9 @@ var MockNovaInstance = class {
1440
663
  socket.dispatchEvent(new Event("open"));
1441
664
  console.log("Websocket connection opened from", socket.url);
1442
665
  if (socket.url.includes("/state-stream")) socket.dispatchEvent(new MessageEvent("message", { data: JSON.stringify(defaultMotionState) }));
1443
- if (socket.url.includes("/move-joint")) socket.dispatchEvent(new MessageEvent("message", { data: JSON.stringify({ result: {
1444
- motion_group: "0@ur",
1445
- state: {
1446
- controller: "ur",
1447
- operation_mode: "OPERATION_MODE_AUTO",
1448
- safety_state: "SAFETY_STATE_NORMAL",
1449
- timestamp: "2024-09-18T12:48:26.096266444Z",
1450
- velocity_override: 100,
1451
- motion_groups: [{
1452
- motion_group: "0@ur",
1453
- controller: "ur",
1454
- joint_position: [
1455
- 1.3492152690887451,
1456
- -1.5659207105636597,
1457
- 1.6653711795806885,
1458
- -1.0991662740707397,
1459
- -1.829018235206604,
1460
- 1.264623761177063
1461
- ],
1462
- joint_velocity: { joints: [
1463
- 0,
1464
- 0,
1465
- 0,
1466
- 0,
1467
- 0,
1468
- 0
1469
- ] },
1470
- flange_pose: {
1471
- position: [
1472
- 6.437331889439328,
1473
- -628.4123774830913,
1474
- 577.0569957147832
1475
- ],
1476
- orientation: {
1477
- x: -1.683333649797158,
1478
- y: -1.9783363827298732,
1479
- z: -.4928031860165713
1480
- },
1481
- coordinate_system: ""
1482
- },
1483
- tcp_pose: {
1484
- position: [
1485
- 6.437331889439328,
1486
- -628.4123774830913,
1487
- 577.0569957147832
1488
- ],
1489
- orientation: {
1490
- x: -1.683333649797158,
1491
- y: -1.9783363827298732,
1492
- z: -.4928031860165713
1493
- },
1494
- coordinate_system: "",
1495
- tcp: "Flange"
1496
- },
1497
- velocity: {
1498
- linear: {
1499
- x: 0,
1500
- y: 0,
1501
- z: 0
1502
- },
1503
- angular: {
1504
- x: -0,
1505
- y: 0,
1506
- z: 0
1507
- },
1508
- coordinate_system: ""
1509
- },
1510
- force: {
1511
- force: {
1512
- x: 0,
1513
- y: 0,
1514
- z: 0
1515
- },
1516
- moment: {
1517
- x: 0,
1518
- y: 0,
1519
- z: 0
1520
- },
1521
- coordinate_system: ""
1522
- },
1523
- joint_limit_reached: { limit_reached: [
1524
- false,
1525
- false,
1526
- false,
1527
- false,
1528
- false,
1529
- false
1530
- ] },
1531
- joint_current: { joints: [
1532
- 0,
1533
- 0,
1534
- 0,
1535
- 0,
1536
- 0,
1537
- 0
1538
- ] },
1539
- sequence_number: "671259"
1540
- }],
1541
- sequence_number: "671259"
1542
- },
1543
- movement_state: "MOVEMENT_STATE_MOVING"
1544
- } }) }));
1545
- if (socket.url.includes("/move-tcp")) socket.dispatchEvent(new MessageEvent("message", { data: JSON.stringify({ result: {
1546
- motion_group: "0@ur",
1547
- state: {
1548
- controller: "ur",
1549
- operation_mode: "OPERATION_MODE_AUTO",
1550
- safety_state: "SAFETY_STATE_NORMAL",
1551
- timestamp: "2024-09-18T12:43:12.188335774Z",
1552
- velocity_override: 100,
1553
- motion_groups: [{
1554
- motion_group: "0@ur",
1555
- controller: "ur",
1556
- joint_position: { joints: [
1557
- 1.3352527618408203,
1558
- -1.5659207105636597,
1559
- 1.6653711795806885,
1560
- -1.110615611076355,
1561
- -1.829018235206604,
1562
- 1.264623761177063
1563
- ] },
1564
- joint_velocity: { joints: [
1565
- 0,
1566
- 0,
1567
- 0,
1568
- 0,
1569
- 0,
1570
- 0
1571
- ] },
1572
- flange_pose: {
1573
- position: [
1574
- -2.763015284002938,
1575
- -630.2151479701106,
1576
- 577.524509114342
1577
- ],
1578
- orientation: {
1579
- x: -1.704794877102097,
1580
- y: -1.9722372952861567,
1581
- z: -.4852079204210754
1582
- },
1583
- coordinate_system: ""
1584
- },
1585
- tcp_pose: {
1586
- position: [
1587
- -2.763015284002938,
1588
- -630.2151479701106,
1589
- 577.524509114342
1590
- ],
1591
- orientation: {
1592
- x: -1.704794877102097,
1593
- y: -1.9722372952861567,
1594
- z: -.4852079204210754
1595
- },
1596
- coordinate_system: "",
1597
- tcp: "Flange"
1598
- },
1599
- velocity: {
1600
- linear: {
1601
- x: 0,
1602
- y: 0,
1603
- z: 0
1604
- },
1605
- angular: {
1606
- x: -0,
1607
- y: 0,
1608
- z: 0
1609
- },
1610
- coordinate_system: ""
1611
- },
1612
- force: {
1613
- force: {
1614
- x: 0,
1615
- y: 0,
1616
- z: 0
1617
- },
1618
- moment: {
1619
- x: 0,
1620
- y: 0,
1621
- z: 0
1622
- },
1623
- coordinate_system: ""
1624
- },
1625
- joint_limit_reached: { limit_reached: [
1626
- false,
1627
- false,
1628
- false,
1629
- false,
1630
- false,
1631
- false
1632
- ] },
1633
- joint_current: { joints: [
1634
- 0,
1635
- 0,
1636
- 0,
1637
- 0,
1638
- 0,
1639
- 0
1640
- ] },
1641
- sequence_number: "627897"
1642
- }],
1643
- sequence_number: "627897"
1644
- },
1645
- movement_state: "MOVEMENT_STATE_MOVING"
666
+ if (socket.url.includes("/execution/jogging")) socket.dispatchEvent(new MessageEvent("message", { data: JSON.stringify({ result: {
667
+ message: "string",
668
+ kind: "INITIALIZE_RECEIVED"
1646
669
  } }) }));
1647
670
  }, 10);
1648
671
  }
@@ -1821,6 +844,8 @@ function poseToWandelscriptString(pose) {
1821
844
  //#endregion
1822
845
  exports.NovaCellAPIClient = NovaCellAPIClient;
1823
846
  exports.NovaClient = NovaClient;
847
+ exports.ProgramRunner = ProgramRunner;
848
+ exports.ProgramsClient = ProgramsClient;
1824
849
  exports.poseToWandelscriptString = poseToWandelscriptString;
1825
850
  Object.keys(__wandelbots_nova_api_v2).forEach(function (k) {
1826
851
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {