-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.json
754 lines (754 loc) · 26.6 KB
/
commands.json
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
{
"version": "1.0.4",
"commands": [
{
"command": "INITIALIZE_MOTOR",
"code": "0x01",
"description": "This command initializes a motor and prepares it for use.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to initialize."
},
{
"name": "is_reversed",
"type": "bool",
"default": false,
"description": "Whether or not the motor is reversed."
}
],
"category": "Motor"
},
{
"command": "SET_MOTOR_SPEED",
"code": "0x02",
"description": "This command sets the speed of the specified motor in PWM.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to set the speed for."
},
{
"name": "pwm",
"type": "double",
"range": [
-100.0,
100.0
],
"description": "The speed of the motor."
}
],
"category": "Motor"
},
{
"command": "STOP_MOTOR",
"code": "0x03",
"description": "This command stops motor by setting its speed to 0.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to set the speed for."
}
],
"category": "Motor"
},
{
"command": "BRAKE_MOTOR",
"code": "0x04",
"description": "This command brakes motor.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to set the speed for."
}
],
"category": "Motor"
},
{
"command": "INITIALIZE_MOTOR_CONTROLLER",
"code": "0x05",
"description": "This command sets the controller for the specified motor.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to set the controller for."
},
{
"name": "is_reversed",
"type": "bool",
"default": false,
"description": "Whether or not the motor is reversed."
},
{
"name": "encoder_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the encoder to use for the controller."
},
{
"name": "encoder_resolution",
"type": "double",
"description": "Encoder resolution in ticks per revolution. The value can not be negative or zero."
},
{
"name": "kp",
"type": "double",
"description": "Proportional constant of PID"
},
{
"name": "ki",
"type": "double",
"description": "Integral constant of PID"
},
{
"name": "kd",
"type": "double",
"description": "Derivative constant of PID"
},
{
"name": "integral_limit",
"type": "double",
"description": "Integral limit of PID controller. The value can not be negative or zero. If the value is zero or negative, the integral limit is disabled."
}
],
"category": "Motor Controller"
},
{
"command": "SET_MOTOR_TARGET_SPEED",
"code": "0x06",
"description": "This command sets the target speed for the specified motor in radians.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to set the target velocity for."
},
{
"name": "speed",
"type": "double",
"description": "The speed of the motor."
}
],
"category": "Motor Controller"
},
{
"command": "RESET_MOTOR_CONTROLLER",
"code": "0x07",
"description": "This command resets the controller for the specified motor.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to reset the controller for."
}
],
"category": "Motor Controller"
},
{
"command": "GET_MOTOR_CONTROLLER_STATE",
"code": "0x08",
"description": "This command gets the state of the controller for the specified motor.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to get the state for."
}
],
"response": {
"name": "motor_controller_state",
"type": "object",
"description": "The state of the controller for the specified motor."
}
},
{
"command": "DELETE_MOTOR_CONTROLLER",
"code": "0x09",
"description": "This command deletes the controller for the specified motor.",
"properties": [
{
"name": "motor_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the motor to delete the controller for."
}
],
"category": "Motor Controller"
},
{
"command": "INITIALIZE_ENCODER",
"code": "0x11",
"description": "This command initializes an encoder and prepares it for use.",
"properties": [
{
"name": "encoder_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the encoder to initialize."
},
{
"name": "encoder_resolution",
"type": "double",
"description": "Encoder resolution in ticks per revolution. The value can not be negative or zero."
},
{
"name": "is_reversed",
"type": "bool",
"default": false,
"description": "Whether or not the encoder is reversed."
}
],
"category": "Encoder"
},
{
"command": "GET_ENCODER_VALUE",
"code": "0x12",
"description": "This command retrieves the current value of the encoder.",
"properties": [
{
"name": "encoder_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the encoder to retrieve the value for."
}
],
"response": {
"name": "encoderValue",
"type": "uint16_t",
"description": "The current value of the encoder."
},
"category": "Encoder"
},
{
"command": "START_ENCODER_ODOMETRY",
"code": "0x13",
"description": "This command starts the odometry calculation for the specified encoder.",
"properties": [
{
"name": "encoder_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the encoder to start the odometry calculation for."
}
],
"category": "Encoder"
},
{
"command": "RESET_ENCODER_ODOMETRY",
"code": "0x14",
"description": "This command resets the odometry calculation for the specified encoder.",
"properties": [
{
"name": "encoder_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the encoder to reset the odometry calculation for."
}
],
"category": "Encoder"
},
{
"command": "STOP_ENCODER_ODOMETRY",
"code": "0x15",
"description": "This command stops the odometry calculation for the specified encoder.",
"properties": [
{
"name": "encoder_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the encoder to stop the odometry calculation for."
}
],
"category": "Encoder"
},
{
"command": "GET_ENCODER_ODOMETRY",
"code": "0x16",
"description": "This command retrieves the odometry of the specified encoder.",
"properties": [
{
"name": "encoder_index",
"type": "uint8_t",
"range": [
0,
3
],
"description": "The index of the encoder to retrieve the odometry for."
}
],
"response": {
"name": "odometry",
"type": "double",
"description": "The odometry of the encoder in radians."
},
"category": "Encoder"
},
{
"command": "INITIALIZE_GPIO_PIN",
"code": "0x20",
"description": "This command initializes a digital pin and prepares it for use.",
"properties": [
{
"name": "pin_number",
"type": "uint8_t",
"description": "The number of the pin to initialize."
},
{
"name": "mode",
"type": "uint8_t",
"description": "Set digital pin as input or output. Modes: 0 = INPUT_PULLDOWN, 1 = INPUT_PULLUP, 2 = INPUT_NOPULL, 3 = OUTPUT."
}
],
"category": "GPIO"
},
{
"command": "SET_GPIO_PIN_STATE",
"code": "0x21",
"description": "This command sets the specified pin to a state.",
"properties": [
{
"name": "pin_number",
"type": "uint8_t",
"description": "The number of the pin to set to a state."
},
{
"name": "state",
"type": "uint8_t",
"description": "The state of the pin. 0 = LOW, 1 = HIGH."
}
],
"category": "GPIO"
},
{
"command": "GET_GPIO_PIN_STATE",
"code": "0x22",
"description": "This command gets the state of the specified pin.",
"properties": [
{
"name": "pin_number",
"type": "uint8_t",
"description": "The number of the pin to get the state for."
}
],
"response": {
"name": "state",
"type": "uint8_t",
"description": "The state of the pin. 0 = LOW, 1 = HIGH."
},
"category": "GPIO"
},
{
"command": "TOGGLE_GPIO_PIN_STATE",
"code": "0x23",
"description": "This command toggles the specified pin.",
"properties": [
{
"name": "pin_number",
"type": "uint8_t",
"description": "The number of the pin to toggle."
}
],
"category": "GPIO"
},
{
"command": "SET_STATUS_LED_STATE",
"code": "0x25",
"description": "This command sets the status LED to a state.",
"properties": [
{
"name": "state",
"type": "uint8_t",
"description": "The state of the status LED. 0 = OFF, 1 = ON."
}
],
"category": "GPIO"
},
{
"command": "TOGGLE_STATUS_LED_STATE",
"code": "0x26",
"description": "This command toggles the status LED.",
"properties": [],
"category": "GPIO"
},
{
"command": "INITIALIZE_MECANUM_PLATFORM",
"code": "0x30",
"description": "This command initializes a mecanum platform and prepares it for use.",
"properties": [
{
"name": "is_reversed_0",
"type": "bool",
"default": false,
"description": "Determins if motor 0 is reversed."
},
{
"name": "is_reversed_1",
"type": "bool",
"default": false,
"description": "Determins if motor 1 is reversed."
},
{
"name": "is_reversed_2",
"type": "bool",
"default": false,
"description": "Determins if motor 2 is reversed."
},
{
"name": "is_reversed_3",
"type": "bool",
"default": false,
"description": "Determins if motor 3 is reversed."
},
{
"name": "length",
"type": "double",
"default": 1,
"description": "Length of the platform in meters."
},
{
"name": "width",
"type": "double",
"default": 1,
"description": "Width of the platform in meters."
},
{
"name": "wheels_diameter",
"type": "double",
"default": 1,
"description": "Diameter of the robot wheels in meters."
},
{
"name": "encoder_resolution",
"type": "double",
"default": 0,
"description": "Encoder resolution in ticks per revolution. The value can not be negative. If platform does not have encoders, the value should be set to zero."
}
],
"category": "Platform"
},
{
"command": "INITIALIZE_OMNI_PLATFORM",
"code": "0x31",
"description": "This command initializes a omni platform and prepares it for use.",
"properties": [
{
"name": "is_reversed_0",
"type": "bool",
"default": false,
"description": "Determins if motor 0 is reversed."
},
{
"name": "is_reversed_1",
"type": "bool",
"default": false,
"description": "Determins if motor 1 is reversed."
},
{
"name": "is_reversed_2",
"type": "bool",
"default": false,
"description": "Determins if motor 2 is reversed."
},
{
"name": "wheels_diameter",
"type": "double",
"default": 1,
"description": "Diameter of the robot wheels in millimeters."
},
{
"name": "robot_radius",
"type": "double",
"default": 1,
"description": "Distance berween the center of the robot and the center of the wheels in millimeters."
},
{
"name": "encoder_resolution",
"type": "double",
"default": 0,
"description": "Encoder resolution in ticks per revolution. The value can not be negative. If platform does not have encoders, the value should be set to zero."
}
],
"category": "Platform"
},
{
"command": "SET_PLATFORM_VELOCITY",
"code": "0x40",
"description": "This command sets the velocity for the platform in PWM.",
"properties": [
{
"name": "x",
"type": "double",
"description": "X component of platform velocity in PWM",
"range": [
-100.0,
100.0
]
},
{
"name": "y",
"type": "double",
"description": "Y component of platform velocity in PWM",
"range": [
-100.0,
100.0
]
},
{
"name": "t",
"type": "double",
"description": "Theta component of platform velocity in PWM",
"range": [
-100.0,
100.0
]
}
],
"category": "Platform"
},
{
"command": "START_PLATFORM_CONTROLLER",
"code": "0x41",
"description": "This command sets the controller for the platform.",
"properties": [
{
"name": "kp",
"type": "double",
"description": "Proportional constant of PID"
},
{
"name": "ki",
"type": "double",
"description": "Integral constant of PID"
},
{
"name": "kd",
"type": "double",
"description": "Derivative constant of PID"
},
{
"name": "integral_limit",
"type": "double",
"description": "Integral limit of PID controller. The value can not be negative or zero. If the value is zero or negative, the integral limit is disabled."
}
],
"category": "Platform"
},
{
"command": "SET_PLATFORM_TARGET_VELOCITY",
"code": "0x42",
"description": "This command set the target velocity for the platform in meters per second.",
"properties": [
{
"name": "x",
"type": "double",
"description": "X component of platform velocity in meters per second"
},
{
"name": "y",
"type": "double",
"description": "Y component of platform velocity in meters per second"
},
{
"name": "t",
"type": "double",
"description": "Theta component of platform velocity in radians per second"
}
],
"category": "Platform"
},
{
"command": "GET_PLATFORM_CURRENT_VELOCITY",
"code": "0x43",
"description": "This command gets the current velocity of the platform in meters per second.",
"response":{
"name": "platform_velocity",
"type": "object",
"description": "The current velocity of the platform in meters per second."
},
"category": "Platform"
},
{
"command": "STOP_PLATFORM_CONTROLLER",
"code": "0x44",
"description": "This command stops the controller for the platform.",
"category": "Platform"
},
{
"command": "START_PLATFORM_ODOMETRY",
"code": "0x45",
"description": "This command starts the odometry calculation for the platform.",
"category": "Platform"
},
{
"command": "RESET_PLATFORM_ODOMETRY",
"code": "0x46",
"description": "This command resets the odometry calculation for the platform.",
"category": "Platform"
},
{
"command": "STOP_PLATFORM_ODOMETRY",
"code": "0x47",
"description": "This command stops the odometry calculation for the platform.",
"category": "Platform"
},
{
"command": "GET_PLATFORM_ODOMETRY",
"code": "0x48",
"description": "This command retrieves the odometry of the platform in meters and radians.",
"response":{
"name": "platform_odometry",
"type": "object",
"description": "The odometry of the platform in meters and radians."
},
"category": "Platform"
}
],
"objects": [
{
"name": "motor_controller_state",
"description": "The state of the controller for the specified motor.",
"properties": [
{
"name": "motor_index",
"type": "int8_t",
"description": "Index of the motor with the controller."
},
{
"name": "kp",
"type": "double",
"description": "Proportional constant of PID"
},
{
"name": "ki",
"type": "double",
"description": "Integral constant of PID"
},
{
"name": "kd",
"type": "double",
"description": "Derivative constant of PID"
},
{
"name": "target_speed",
"type": "double",
"description": "The target speed of the motor."
},
{
"name": "current_speed",
"type": "double",
"description": "The current speed of the motor."
},
{
"name": "error",
"type": "double",
"description": "The error of the motor."
},
{
"name": "output",
"type": "double",
"description": "The output of the motor."
}
]
},
{
"name": "platform_velocity",
"description": "The velocity of the platform in meters per second.",
"properties": [
{
"name": "x",
"type": "double",
"description": "X component of platform velocity in meters per second"
},
{
"name": "y",
"type": "double",
"description": "Y component of platform velocity in meters per second"
},
{
"name": "t",
"type": "double",
"description": "Theta component of platform velocity in radians per second"
}
]
},
{
"name": "platform_odometry",
"description": "The odometry of the platform in meters and radians.",
"properties": [
{
"name": "x",
"type": "double",
"description": "X component of platform odometry in meters"
},
{
"name": "y",
"type": "double",
"description": "Y component of platform odometry in meters"
},
{
"name": "t",
"type": "double",
"description": "Theta component of platform odometry in radians"
}
]
}
]
}