drakongen 1.4.4 → 1.4.6

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.
Files changed (60) hide show
  1. package/browser/drakongen.js +5 -1
  2. package/exampleproject/.drakontech/history.json +12 -0
  3. package/exampleproject/.drakontech/opened.txt +1 -0
  4. package/exampleproject/foo.drakon +23 -10
  5. package/exampleproject/foo.txt +13 -6
  6. package/exampleproject/math/approximately equal.drakon +15 -7
  7. package/exampleproject/solution.json +3 -0
  8. package/examples/.drakontech/history.json +124 -0
  9. package/examples/.drakontech/opened.txt +1 -0
  10. package/examples/01. /320/221/320/265/320/273/321/213/320/271.txt" +1 -1
  11. package/examples/02. /320/247/321/221/321/200/320/275/321/213/320/271.txt" +1 -1
  12. package/examples/03. /320/241/320/265/321/200/321/213/320/271.txt" +1 -1
  13. package/examples/04. /320/221/321/203/321/200/321/213/320/271.txt" +1 -1
  14. package/examples/05. /320/226/321/221/320/273/321/202/321/213/320/271.txt" +1 -1
  15. package/examples/06. /320/221/320/260/320/263/321/200/320/276/320/262/321/213/320/271.txt" +1 -1
  16. package/examples/07. /320/244/320/270/320/276/320/273/320/265/321/202/320/276/320/262/321/213/320/271.txt" +1 -1
  17. package/examples/08. /320/221/320/270/321/200/321/216/320/267/320/276/320/262/321/213/320/271.txt" +1 -1
  18. package/examples/09. /320/236/321/200/320/260/320/275/320/266/320/265/320/262/321/213/320/271.txt" +1 -1
  19. package/examples/10. /320/240/320/276/320/267/320/276/320/262/321/213/320/271.txt" +1 -1
  20. package/examples/11. /320/227/320/260/321/211/320/270/321/202/320/275/321/213/320/271.txt" +1 -1
  21. package/examples/12. /320/221/320/276/320/273/320/276/321/202/320/275/321/213/320/271.txt" +1 -1
  22. package/examples/13. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/271.txt" +1 -1
  23. package/examples/14. /320/227/320/276/320/273/320/276/321/202/320/276/320/271.txt" +1 -1
  24. package/examples/15. /320/241/320/270/320/275/320/270/320/271.txt" +1 -1
  25. package/examples/16. /320/223/320/276/320/273/321/203/320/261/320/276/320/271.txt" +1 -1
  26. package/examples/17. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/271.txt" +1 -1
  27. package/examples/18. /320/241/321/202/320/260/320/273/321/214/320/275/320/276/320/271.txt" +1 -1
  28. package/examples/How to tune PID on a quadcopter.txt +12 -12
  29. package/examples/Logical_And.drakon +37 -0
  30. package/examples/Logical_And.txt +9 -0
  31. package/examples/Logical_And_Inv.drakon +37 -0
  32. package/examples/Logical_And_Inv.txt +9 -0
  33. package/examples/Logical_And_Inv_x2.drakon +91 -0
  34. package/examples/Logical_And_Inv_x2.txt +15 -0
  35. package/examples/Logical_Or.drakon +37 -0
  36. package/examples/Logical_Or.txt +9 -0
  37. package/examples/Logical_Or_Inv.drakon +37 -0
  38. package/examples/Logical_Or_Inv.txt +9 -0
  39. package/package.json +1 -1
  40. package/src/drakonToStruct.js +394 -325
  41. package/src/translate.js +3 -0
  42. package/src/treeTools.js +1 -0
  43. /package/examples/01. /320/221/320/265/320/273/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  44. /package/examples/02. /320/247/{320/265/314/210/321/200/320/275/321/213/320/270/314/206.drakon" → 321/221/321/200/320/275/321/213/320/271.drakon"} +0 -0
  45. /package/examples/03. /320/241/320/265/321/200/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  46. /package/examples/04. /320/221/321/203/321/200/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  47. /package/examples/05. /320/226/{320/265/314/210/320/273/321/202/321/213/320/270/314/206.drakon" → 321/221/320/273/321/202/321/213/320/271.drakon"} +0 -0
  48. /package/examples/06. /320/221/320/260/320/263/321/200/320/276/320/262/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  49. /package/examples/07. /320/244/320/270/320/276/320/273/320/265/321/202/320/276/320/262/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  50. /package/examples/08. /320/221/320/270/321/200/321/216/320/267/320/276/320/262/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  51. /package/examples/09. /320/236/321/200/320/260/320/275/320/266/320/265/320/262/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  52. /package/examples/10. /320/240/320/276/320/267/320/276/320/262/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  53. /package/examples/11. /320/227/320/260/321/211/320/270/321/202/320/275/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  54. /package/examples/12. /320/221/320/276/320/273/320/276/321/202/320/275/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  55. /package/examples/13. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  56. /package/examples/14. /320/227/320/276/320/273/320/276/321/202/320/276/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  57. /package/examples/15. /320/241/320/270/320/275/320/270/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  58. /package/examples/16. /320/223/320/276/320/273/321/203/320/261/320/276/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  59. /package/examples/17. /320/241/320/260/320/273/320/260/321/202/320/276/320/262/321/213/320/{270/314/206.drakon" → 271.drakon"} +0 -0
  60. /package/examples/18. /320/241/321/202/320/260/320/273/321/214/320/275/320/276/320/{270/314/206.drakon" → 271.drakon"} +0 -0
@@ -376,7 +376,7 @@ function rewireSelect(nodes, selectNode, filename) {
376
376
  if (!caseNode.two) {
377
377
  var errorId = caseNode.id + "-unexpected"
378
378
  var errorAction = insertIcon(nodes, "error", errorId, selectNode.content)
379
- errorAction.message = "Unexpected case value"
379
+ errorAction.message = translate("Unexpected case value")
380
380
 
381
381
  caseNode.two = errorId
382
382
  errorAction.prev.push(caseNode.id)
@@ -1284,6 +1284,7 @@ var translationsRu = {
1284
1284
  "A Loop begin icon must have content": "Икона начала цикла ДЛЯ должна содержать данные",
1285
1285
  "A Question icon must have content": "Икона Вопрос должна содержать данные",
1286
1286
  "A Select icon must have content": "Икона Выбор должна содержать данные",
1287
+ "Unexpected case value": "Неожиданное значение иконы Вариант",
1287
1288
  "Loop end expected here": "Здесь ожидается конец цикла",
1288
1289
  "An exit from the loop must lead to the point right after the loop end": "Выход из цикла должен вести в точку сразу за его концом",
1289
1290
  "A silhouette branch is not referenced": "Нет ссылок на ветку силуэта",
@@ -1314,6 +1315,7 @@ var translationsEn = {
1314
1315
  'A Loop begin icon must have content': 'A Loop begin icon must have content',
1315
1316
  'A Question icon must have content': 'A Question icon must have content',
1316
1317
  'A Select icon must have content': 'A Select icon must have content',
1318
+ "Unexpected case value": "Unexpected case value",
1317
1319
  'Loop end expected here': 'Loop end expected here',
1318
1320
  'An exit from the loop must lead to the point right after the loop end': 'An exit from the loop must lead to the point right after the loop end',
1319
1321
  'A silhouette branch is not referenced': 'A silhouette branch is not referenced',
@@ -1344,6 +1346,7 @@ var translationsNo = {
1344
1346
  'A Loop begin icon must have content': 'Et Loop-startikon må ha innhold',
1345
1347
  'A Question icon must have content': 'Et Spørsmål-ikon må ha innhold',
1346
1348
  'A Select icon must have content': 'Et Velg-ikon må ha innhold',
1349
+ "Unexpected case value": "Uventet tilfelle verdi",
1347
1350
  'Loop end expected here': 'Slutt på løkke forventet her',
1348
1351
  'An exit from the loop must lead to the point right after the loop end': 'En utgang fra løkken må føre til punktet rett etter løkkens slutt',
1349
1352
  'A silhouette branch is not referenced': 'En silhuettgren er ikke referert',
@@ -1403,6 +1406,7 @@ function optimizeTree(steps) {
1403
1406
 
1404
1407
  function optimizeLoop(step) {
1405
1408
  return {
1409
+ id: step.id,
1406
1410
  type: step.type,
1407
1411
  content: step.content,
1408
1412
  body: optimizeTree(step.body)
@@ -0,0 +1,12 @@
1
+ {
2
+ "history": [
3
+ {
4
+ "path": "/Users/stipan/Documents/drakongen/exampleproject/math/approximately equal.drakon",
5
+ "whenOpened": "2025-05-24T09:18:53.776Z"
6
+ },
7
+ {
8
+ "path": "/Users/stipan/Documents/drakongen/exampleproject/foo.drakon",
9
+ "whenOpened": "2025-05-24T09:18:44.471Z"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1 @@
1
+ 2025-05-24T09:18:36.041Z
@@ -10,42 +10,55 @@
10
10
  },
11
11
  "3": {
12
12
  "type": "action",
13
- "content": "<p>return sqrt(x * x + y * y)</p>",
13
+ "content": "return sqrt(\n x * x + y * y\n)",
14
14
  "one": "1"
15
15
  },
16
16
  "4": {
17
17
  "type": "question",
18
- "content": "<p>x &gt; 0</p>",
18
+ "content": "x > 0",
19
19
  "one": "5",
20
20
  "two": "6",
21
21
  "flag1": 1
22
22
  },
23
23
  "5": {
24
24
  "type": "question",
25
- "content": "<p>y &gt; 0</p>",
25
+ "content": "y > 0",
26
26
  "one": "7",
27
27
  "two": "6",
28
28
  "flag1": 1
29
29
  },
30
30
  "6": {
31
31
  "type": "action",
32
- "content": "<p>return 0</p>",
32
+ "content": "return 0",
33
33
  "one": "1"
34
34
  },
35
35
  "7": {
36
36
  "type": "question",
37
- "content": "<p>x is approx. equal y</p>",
38
- "one": "3",
37
+ "content": "x is approx. equal y",
38
+ "one": "9",
39
39
  "two": "6",
40
40
  "flag1": 0
41
41
  },
42
42
  "8": {
43
43
  "type": "action",
44
- "content": "<p>x = point.x</p><p>y = point.y</p>",
45
- "one": "4"
44
+ "one": "4",
45
+ "content": "x = point.x\n\t\ty = point.y\n\t\tError:\tError\tinvoking remote method 'openFolder'.\n\nError:\t\tInvalid folder path\nLomma.js:\t11308"
46
+ },
47
+ "9": {
48
+ "type": "action",
49
+ "one": "3",
50
+ "content": ""
46
51
  }
47
52
  },
48
- "params": "<ul><li>point: Point</li></ul><p><br /></p><p>returns: number</p>",
53
+ "params": "point: Point\n\nreturns: number",
49
54
  "type": "drakon",
50
- "id": "foo.drakon"
55
+ "id": "foo.drakon",
56
+ "keywords": {
57
+ "function": false,
58
+ "machine": false,
59
+ "async": false,
60
+ "export": false,
61
+ "algoprop": false,
62
+ "lazy": false
63
+ }
51
64
  }
@@ -5,14 +5,15 @@ Use "undefined" instead of "null".
5
5
 
6
6
  ## Procedure "approximately equal"
7
7
  Parameters:
8
- - left: number
9
- - right: number
8
+ left: number
9
+ right: number
10
+
10
11
  returns: boolean
11
12
 
12
13
  Algorithm:
13
14
  threshold = 0.00001
14
15
  delta = left - right
15
- If Math.abs(delta) > threshold
16
+ If Math.abs(delta) < threshold
16
17
  return true
17
18
  Else
18
19
  return false
@@ -29,15 +30,21 @@ y: number
29
30
 
30
31
  ## Procedure "foo"
31
32
  Parameters:
32
- - point: Point
33
+ point: Point
33
34
 
34
35
  returns: number
35
36
 
36
37
  Algorithm:
37
38
  x = point.x
38
- y = point.y
39
+ y = point.y
40
+ Error: Error invoking remote method 'openFolder'.
41
+
42
+ Error: Invalid folder path
43
+ Lomma.js: 11308
39
44
  If (x > 0 and y > 0) and not (x is approx. equal y)
40
- return sqrt(x * x + y * y)
45
+ return sqrt(
46
+ x * x + y * y
47
+ )
41
48
  Else
42
49
  return 0
43
50
 
@@ -10,33 +10,41 @@
10
10
  },
11
11
  "3": {
12
12
  "type": "action",
13
- "content": "<p>delta = left - right</p>",
13
+ "content": "delta = left - right",
14
14
  "one": "4"
15
15
  },
16
16
  "4": {
17
17
  "type": "question",
18
- "content": "<p>Math.abs(delta) &gt; threshold</p>",
18
+ "content": "Math.abs(delta) < threshold",
19
19
  "one": "6",
20
20
  "two": "7",
21
21
  "flag1": 1
22
22
  },
23
23
  "5": {
24
24
  "type": "action",
25
- "content": "<p>threshold = 0.00001</p>",
25
+ "content": "threshold = 0.00001",
26
26
  "one": "3"
27
27
  },
28
28
  "6": {
29
29
  "type": "action",
30
- "content": "<p>return true</p>",
30
+ "content": "return true",
31
31
  "one": "1"
32
32
  },
33
33
  "7": {
34
34
  "type": "action",
35
- "content": "<p>return false</p>",
35
+ "content": "return false",
36
36
  "one": "1"
37
37
  }
38
38
  },
39
- "params": "<ul><li>left: number</li><li>right: number</li></ul><p>returns: boolean</p>",
39
+ "params": "left: number\nright: number\n\nreturns: boolean",
40
40
  "type": "drakon",
41
- "id": "approximately equal.drakon"
41
+ "id": "approximately equal.drakon",
42
+ "keywords": {
43
+ "function": false,
44
+ "machine": false,
45
+ "async": false,
46
+ "export": false,
47
+ "algoprop": false,
48
+ "lazy": false
49
+ }
42
50
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "language": "LANG_HUMAN"
3
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "history": [
3
+ {
4
+ "path": "/home/stipan/drakongen/examples/Logical_Or_Inv.drakon",
5
+ "whenOpened": "2026-02-07T15:40:02.946Z"
6
+ },
7
+ {
8
+ "path": "/home/stipan/drakongen/examples/Logical_Or.drakon",
9
+ "whenOpened": "2026-02-07T15:39:53.917Z"
10
+ },
11
+ {
12
+ "path": "/home/stipan/drakongen/examples/Logical_And_Inv_x2.drakon",
13
+ "whenOpened": "2026-02-07T15:39:02.792Z"
14
+ },
15
+ {
16
+ "path": "/home/stipan/drakongen/examples/Logical_And_Inv.drakon",
17
+ "whenOpened": "2026-02-07T15:38:46.764Z"
18
+ },
19
+ {
20
+ "path": "/home/stipan/drakongen/examples/Logical_And.drakon",
21
+ "whenOpened": "2026-02-07T15:38:32.558Z"
22
+ },
23
+ {
24
+ "path": "/home/stipan/drakongen/examples/How to tune PID on a quadcopter.drakon",
25
+ "whenOpened": "2026-02-07T15:18:54.467Z"
26
+ },
27
+ {
28
+ "path": "/home/stipan/drakongen/examples/Find pointing nodes.drakon",
29
+ "whenOpened": "2026-02-07T15:18:28.442Z"
30
+ },
31
+ {
32
+ "path": "/home/stipan/drakongen/examples/DoubleArrow.drakon",
33
+ "whenOpened": "2026-02-07T15:18:00.111Z"
34
+ },
35
+ {
36
+ "path": "/home/stipan/drakongen/examples/Complex arrow.drakon",
37
+ "whenOpened": "2026-02-07T15:16:53.661Z"
38
+ },
39
+ {
40
+ "path": "/home/stipan/drakongen/examples/Comments.drakon",
41
+ "whenOpened": "2026-02-07T15:16:01.626Z"
42
+ },
43
+ {
44
+ "path": "/home/stipan/drakongen/examples/Arrow - double exit.drakon",
45
+ "whenOpened": "2026-02-07T15:15:40.894Z"
46
+ },
47
+ {
48
+ "path": "/home/stipan/drakongen/examples/ar12.drakon",
49
+ "whenOpened": "2026-02-07T15:15:28.846Z"
50
+ },
51
+ {
52
+ "path": "/home/stipan/drakongen/examples/ar11.drakon",
53
+ "whenOpened": "2026-02-07T15:15:01.649Z"
54
+ },
55
+ {
56
+ "path": "/home/stipan/drakongen/examples/ar10.drakon",
57
+ "whenOpened": "2026-02-07T15:14:43.081Z"
58
+ },
59
+ {
60
+ "path": "/home/stipan/drakongen/examples/ar09.drakon",
61
+ "whenOpened": "2026-02-07T15:14:06.640Z"
62
+ },
63
+ {
64
+ "path": "/home/stipan/drakongen/examples/ar08.drakon",
65
+ "whenOpened": "2026-02-07T15:13:34.919Z"
66
+ },
67
+ {
68
+ "path": "/home/stipan/drakongen/examples/ar07.drakon",
69
+ "whenOpened": "2026-02-07T15:13:19.193Z"
70
+ },
71
+ {
72
+ "path": "/home/stipan/drakongen/examples/ar06.drakon",
73
+ "whenOpened": "2026-02-07T15:11:34.033Z"
74
+ },
75
+ {
76
+ "path": "/home/stipan/drakongen/examples/ar05.drakon",
77
+ "whenOpened": "2026-02-07T15:11:09.130Z"
78
+ },
79
+ {
80
+ "path": "/home/stipan/drakongen/examples/ar04.drakon",
81
+ "whenOpened": "2026-02-07T15:10:58.595Z"
82
+ },
83
+ {
84
+ "path": "/home/stipan/drakongen/examples/ar03.drakon",
85
+ "whenOpened": "2026-02-07T15:10:43.814Z"
86
+ },
87
+ {
88
+ "path": "/home/stipan/drakongen/examples/ar02.drakon",
89
+ "whenOpened": "2026-02-07T15:10:29.966Z"
90
+ },
91
+ {
92
+ "path": "/home/stipan/drakongen/examples/ar01.drakon",
93
+ "whenOpened": "2026-02-07T15:10:20.409Z"
94
+ },
95
+ {
96
+ "path": "/home/stipan/drakongen/examples/And test.drakon",
97
+ "whenOpened": "2026-02-07T15:09:58.266Z"
98
+ },
99
+ {
100
+ "path": "/home/stipan/drakongen/examples/Adaptive design.drakon",
101
+ "whenOpened": "2026-02-07T15:05:47.582Z"
102
+ },
103
+ {
104
+ "path": "/home/stipan/drakongen/examples/19. Lilla.drakon",
105
+ "whenOpened": "2026-02-07T15:05:21.259Z"
106
+ },
107
+ {
108
+ "path": "/home/stipan/drakongen/examples/18. Стальной.drakon",
109
+ "whenOpened": "2026-02-07T14:53:44.235Z"
110
+ },
111
+ {
112
+ "path": "/home/stipan/drakongen/examples/17. Салатовый.drakon",
113
+ "whenOpened": "2026-02-07T14:53:31.683Z"
114
+ },
115
+ {
116
+ "path": "/home/stipan/drakongen/examples/16. Голубой.drakon",
117
+ "whenOpened": "2026-02-07T14:53:03.322Z"
118
+ },
119
+ {
120
+ "path": "/home/stipan/drakongen/examples/15. Синий.drakon",
121
+ "whenOpened": "2026-02-07T14:52:20.342Z"
122
+ }
123
+ ]
124
+ }
@@ -0,0 +1 @@
1
+ 2026-02-07T15:09:47.965Z
@@ -1,4 +1,4 @@
1
- ## Procedure "01. Белый"
1
+ ## Procedure "01. Белый"
2
2
 
3
3
  Algorithm:
4
4
 
@@ -1,4 +1,4 @@
1
- ## Procedure "02. Чёрный"
1
+ ## Procedure "02. Чёрный"
2
2
 
3
3
  Algorithm:
4
4
  3
@@ -1,4 +1,4 @@
1
- ## Procedure "03. Серый"
1
+ ## Procedure "03. Серый"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "04. Бурый"
1
+ ## Procedure "04. Бурый"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "05. Жёлтый"
1
+ ## Procedure "05. Жёлтый"
2
2
 
3
3
  Algorithm:
4
4
  If not (3)
@@ -1,4 +1,4 @@
1
- ## Procedure "06. Багровый"
1
+ ## Procedure "06. Багровый"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "07. Фиолетовый"
1
+ ## Procedure "07. Фиолетовый"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "08. Бирюзовый"
1
+ ## Procedure "08. Бирюзовый"
2
2
 
3
3
  Algorithm:
4
4
  If 3 and 4
@@ -1,4 +1,4 @@
1
- ## Procedure "09. Оранжевый"
1
+ ## Procedure "09. Оранжевый"
2
2
 
3
3
  Algorithm:
4
4
  If 3 and 4
@@ -1,4 +1,4 @@
1
- ## Procedure "10. Розовый"
1
+ ## Procedure "10. Розовый"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "11. Защитный"
1
+ ## Procedure "11. Защитный"
2
2
 
3
3
  Algorithm:
4
4
  If 3 or 4
@@ -1,4 +1,4 @@
1
- ## Procedure "12. Болотный"
1
+ ## Procedure "12. Болотный"
2
2
 
3
3
  Algorithm:
4
4
  If (3 or 4) or 7
@@ -1,4 +1,4 @@
1
- ## Procedure "13. Салатовый"
1
+ ## Procedure "13. Салатовый"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "14. Золотой"
1
+ ## Procedure "14. Золотой"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "15. Синий"
1
+ ## Procedure "15. Синий"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "16. Голубой"
1
+ ## Procedure "16. Голубой"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "17. Салатовый"
1
+ ## Procedure "17. Салатовый"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -1,4 +1,4 @@
1
- ## Procedure "18. Стальной"
1
+ ## Procedure "18. Стальной"
2
2
 
3
3
  Algorithm:
4
4
  If 3
@@ -27,13 +27,13 @@ With good P, the control should feel precise
27
27
  Loop forever
28
28
  Cruise around
29
29
  Do some sharp turns
30
- If not (Does the quad dip to one side (like a wobble)?) and not (Do slow oscillations occur?)
30
+ If Does the quad dip to one side (like a wobble)? or Do slow oscillations occur?
31
+ Increase P on Roll
32
+ Else
31
33
  If Do fast oscilations occur?
32
34
  Decrease P on Roll
33
35
  Else
34
36
  break
35
- Else
36
- Increase P on Roll
37
37
  When P is right, you should get minimum oscillations when doing sharp turns.
38
38
  Call subroutine "P on Pitch"
39
39
  End of subroutine
@@ -45,10 +45,10 @@ Loop forever
45
45
  If Does the quad pitch up more than it should?
46
46
  Increase P on Pitch
47
47
  Else
48
- If not (Do fast oscilations occur?) and not (Are the motors making a twitching sound?)
49
- break
50
- Else
48
+ If Do fast oscilations occur? or Are the motors making a twitching sound?
51
49
  Decrease P on Pitch
50
+ Else
51
+ break
52
52
  The quad feels very responsive and nimble
53
53
  Call subroutine "TPA"
54
54
  End of subroutine
@@ -67,13 +67,13 @@ End of subroutine
67
67
  Subroutine: "D on Roll and Pitch"
68
68
  Loop forever
69
69
  Do aggressive maneuvers like flips and rolls
70
- If not (Does the quad overshoot at the end of the move then bounce back?) and not (Does prop wash happen? (oscillation when you descent))
70
+ If Does the quad overshoot at the end of the move then bounce back? or Does prop wash happen? (oscillation when you descent)
71
+ Increase D on the affected axis
72
+ Else
71
73
  If Do fast oscillation happen at the end of a roll or flip?
72
74
  Decrease D on the affected axis
73
75
  Else
74
76
  break
75
- Else
76
- Increase D on the affected axis
77
77
  Note that to eliminate bounces at the end of a flip or roll, you can also use Setpoint Transition
78
78
  Call subroutine "I on Roll"
79
79
  End of subroutine
@@ -83,10 +83,10 @@ Loop forever
83
83
  Bank your quad to the left and right
84
84
  Release stick
85
85
  If Is the quad holding the angle well?
86
- If not (Does the quad have stiff, robotic feeling?) and not (Does the quad have oscilations?)
87
- break
88
- Else
86
+ If Does the quad have stiff, robotic feeling? or Does the quad have oscilations?
89
87
  Decrease I on Roll
88
+ Else
89
+ break
90
90
  Else
91
91
  Increase I on Roll
92
92
  You might want to increase I a bit more on a windy day
@@ -0,0 +1,37 @@
1
+ {
2
+ "type": "drakon",
3
+ "items": {
4
+ "1": {
5
+ "type": "end"
6
+ },
7
+ "2": {
8
+ "type": "branch",
9
+ "branchId": 0,
10
+ "one": "4"
11
+ },
12
+ "3": {
13
+ "type": "action",
14
+ "one": "1",
15
+ "content": "C"
16
+ },
17
+ "4": {
18
+ "type": "question",
19
+ "one": "5",
20
+ "two": "6",
21
+ "flag1": 1,
22
+ "content": "A"
23
+ },
24
+ "5": {
25
+ "type": "question",
26
+ "one": "3",
27
+ "two": "6",
28
+ "flag1": 1,
29
+ "content": "B"
30
+ },
31
+ "6": {
32
+ "type": "action",
33
+ "one": "1",
34
+ "content": "D"
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,9 @@
1
+ ## Procedure "Logical_And"
2
+
3
+ Algorithm:
4
+ If A and B
5
+ C
6
+ Else
7
+ D
8
+
9
+ End of procedure
@@ -0,0 +1,37 @@
1
+ {
2
+ "type": "drakon",
3
+ "items": {
4
+ "1": {
5
+ "type": "end"
6
+ },
7
+ "2": {
8
+ "type": "branch",
9
+ "branchId": 0,
10
+ "one": "4"
11
+ },
12
+ "3": {
13
+ "type": "action",
14
+ "one": "1",
15
+ "content": "C"
16
+ },
17
+ "4": {
18
+ "type": "question",
19
+ "one": "5",
20
+ "two": "6",
21
+ "flag1": 0,
22
+ "content": "A"
23
+ },
24
+ "5": {
25
+ "type": "question",
26
+ "one": "3",
27
+ "two": "6",
28
+ "flag1": 0,
29
+ "content": "B"
30
+ },
31
+ "6": {
32
+ "type": "action",
33
+ "one": "1",
34
+ "content": "D"
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,9 @@
1
+ ## Procedure "Logical_And_Inv"
2
+
3
+ Algorithm:
4
+ If A or B
5
+ D
6
+ Else
7
+ C
8
+
9
+ End of procedure