mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-07 09:11:29 +08:00
Compare commits
620 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c76c8fda04 | ||
|
|
bcd5f98cb1 | ||
|
|
278b607f62 | ||
|
|
37230f4c5d | ||
|
|
102f5b54d7 | ||
|
|
bbe3525377 | ||
|
|
6ac79aa55f | ||
|
|
08f5ece306 | ||
|
|
699b6a2cb3 | ||
|
|
bc7178c538 | ||
|
|
e8a87538b8 | ||
|
|
95e80cc29b | ||
|
|
a956429c4c | ||
|
|
8566cabd76 | ||
|
|
a3a855203c | ||
|
|
8351afdca8 | ||
|
|
6aa8fcdf53 | ||
|
|
0b7fa4f5ad | ||
|
|
e600e29ea4 | ||
|
|
0481c002df | ||
|
|
074a71173b | ||
|
|
db174cf8b1 | ||
|
|
815c367294 | ||
|
|
8aa3b245a5 | ||
|
|
aaeeb1684d | ||
|
|
aa0c89c3ec | ||
|
|
b4d9f44904 | ||
|
|
078aca1966 | ||
|
|
6689a3d1b1 | ||
|
|
6d3aba1c5f | ||
|
|
49844f52d5 | ||
|
|
00d4eae373 | ||
|
|
ea9c8b968a | ||
|
|
d748f6ca71 | ||
|
|
cfa203ca22 | ||
|
|
422cf7e21c | ||
|
|
eeb73888fd | ||
|
|
f3c5c2c5a9 | ||
|
|
feccb9bfc1 | ||
|
|
5b06b40ed9 | ||
|
|
e287b05d67 | ||
|
|
547592fddf | ||
|
|
391eb7f8df | ||
|
|
579d420db1 | ||
|
|
86d1488e52 | ||
|
|
d089c427ec | ||
|
|
6f1eda2b18 | ||
|
|
92ddc30b69 | ||
|
|
92185945bc | ||
|
|
0cc44a82c5 | ||
|
|
45a4472a47 | ||
|
|
bae5416819 | ||
|
|
033e9e140d | ||
|
|
e2d1524a7a | ||
|
|
670b0f7c6d | ||
|
|
437221bec2 | ||
|
|
c22e7ed5c9 | ||
|
|
aefa319fc4 | ||
|
|
457526ebe7 | ||
|
|
a58c2f416f | ||
|
|
ccea9c9e6f | ||
|
|
623b99327d | ||
|
|
5710a0c040 | ||
|
|
a38263b8e7 | ||
|
|
dd70b3752a | ||
|
|
d809faec63 | ||
|
|
21bc5d1716 | ||
|
|
4e81263d3a | ||
|
|
11f1a11934 | ||
|
|
a1c8585342 | ||
|
|
c835fb36a6 | ||
|
|
0d80a77e46 | ||
|
|
8f1d350d3c | ||
|
|
6bf4bd5f35 | ||
|
|
50cac88e5b | ||
|
|
9f928308c4 | ||
|
|
3d0fa410a8 | ||
|
|
fd6ad6565c | ||
|
|
f7ad8c03b4 | ||
|
|
93acff8641 | ||
|
|
740bfc0b32 | ||
|
|
ee1669e174 | ||
|
|
f365832c0b | ||
|
|
401d807261 | ||
|
|
36299c59b4 | ||
|
|
788f04ea58 | ||
|
|
94fc8bda02 | ||
|
|
2bca19fc5e | ||
|
|
e4f20f98cd | ||
|
|
b5ef5cabb5 | ||
|
|
5f16c97662 | ||
|
|
390a7165dd | ||
|
|
5a262ec6bc | ||
|
|
a18eabead4 | ||
|
|
2de66b1a9d | ||
|
|
ad2a13dcc8 | ||
|
|
0fa3bd4691 | ||
|
|
1b0f41e36e | ||
|
|
fa421a91e2 | ||
|
|
6ab9dc0acf | ||
|
|
99aa5f49fc | ||
|
|
6aa935fed6 | ||
|
|
e70223c2be | ||
|
|
1f1839d978 | ||
|
|
9ece090dbe | ||
|
|
499d362b8b | ||
|
|
302719527a | ||
|
|
e8d44da2c0 | ||
|
|
2241ab9cac | ||
|
|
78a9472b25 | ||
|
|
dcb7c0e4c2 | ||
|
|
79a1b84b09 | ||
|
|
de76c398ca | ||
|
|
ec035b7268 | ||
|
|
57b3bbf657 | ||
|
|
31d5c59ab7 | ||
|
|
a9a5f3a19e | ||
|
|
55d21242fe | ||
|
|
b6a9ff756c | ||
|
|
3b7ba915a8 | ||
|
|
9f5b081257 | ||
|
|
4b414d96eb | ||
|
|
0ce08ed9f8 | ||
|
|
ce3749d04f | ||
|
|
0cf77a30b1 | ||
|
|
415fbae31e | ||
|
|
50a14cfd29 | ||
|
|
3a0f4c84a5 | ||
|
|
cbcbce3a28 | ||
|
|
6245a9b134 | ||
|
|
d660fb094b | ||
|
|
d6d3a56116 | ||
|
|
c55c978145 | ||
|
|
4045068187 | ||
|
|
8602ff7856 | ||
|
|
3f9f320f18 | ||
|
|
a8e28c7232 | ||
|
|
632e4630b1 | ||
|
|
a71cfe92f1 | ||
|
|
664092b7d4 | ||
|
|
3289e0cee6 | ||
|
|
d63870ad71 | ||
|
|
f4e35873a1 | ||
|
|
c4eb65862f | ||
|
|
a9cb2d2fbe | ||
|
|
c4cb916afa | ||
|
|
4656b34244 | ||
|
|
4fa59c3cde | ||
|
|
b6e57e1347 | ||
|
|
83feb83fe2 | ||
|
|
c3b58822a8 | ||
|
|
50175ca7ea | ||
|
|
aea7bd5b47 | ||
|
|
f069880504 | ||
|
|
254358ef86 | ||
|
|
89a2f5057f | ||
|
|
6ff65cd8b2 | ||
|
|
0a997577f5 | ||
|
|
9f7f6e4d3d | ||
|
|
6226a0c77d | ||
|
|
ec334f7c9b | ||
|
|
8c8120e2fc | ||
|
|
fd51bf44d5 | ||
|
|
e3f3233ee4 | ||
|
|
880fa47ba2 | ||
|
|
7458f1e07d | ||
|
|
563122f5d3 | ||
|
|
4f62a35993 | ||
|
|
05315abc89 | ||
|
|
5cee3fa0e1 | ||
|
|
76d74640ae | ||
|
|
7399e60e96 | ||
|
|
a4ef364f80 | ||
|
|
0730e681bc | ||
|
|
2b93f16118 | ||
|
|
317fd270d1 | ||
|
|
b99f51a035 | ||
|
|
ae66085f89 | ||
|
|
1fc8e38157 | ||
|
|
7d11b32981 | ||
|
|
2197bf518d | ||
|
|
28de6d2cbd | ||
|
|
d94bdb0829 | ||
|
|
e73d8d73e1 | ||
|
|
8ab841e046 | ||
|
|
03b3bfa98d | ||
|
|
2c0c30eadf | ||
|
|
38e4882b5f | ||
|
|
0f6a6f7150 | ||
|
|
9a8c092116 | ||
|
|
5ded579bf3 | ||
|
|
7b52eced66 | ||
|
|
a420d47797 | ||
|
|
5b85fdb636 | ||
|
|
9fcf121380 | ||
|
|
981353f439 | ||
|
|
fa614a3cc1 | ||
|
|
2bf40efe8b | ||
|
|
17be06cf1a | ||
|
|
1939b88a33 | ||
|
|
f241518d0e | ||
|
|
d733fc9139 | ||
|
|
a1b710025b | ||
|
|
ee58f0d11d | ||
|
|
b48c081e5c | ||
|
|
87e964ec10 | ||
|
|
f430c39f5b | ||
|
|
1cfa429efe | ||
|
|
33e4f38d82 | ||
|
|
e2a6ae676f | ||
|
|
4a199c1360 | ||
|
|
f1b8bed5df | ||
|
|
8a2df2a458 | ||
|
|
5d1bd6fb2c | ||
|
|
8d13dba0cc | ||
|
|
5e8d6375c9 | ||
|
|
39ce201efe | ||
|
|
78bc7d850b | ||
|
|
3ed8b735c2 | ||
|
|
399d4ef833 | ||
|
|
eda2915f0b | ||
|
|
d9343fa925 | ||
|
|
8345a0368b | ||
|
|
8ded6a58ab | ||
|
|
314ee6b7e0 | ||
|
|
631ce1fc55 | ||
|
|
af8cd3f880 | ||
|
|
13905c2480 | ||
|
|
08bbd6dbfa | ||
|
|
71e2a43790 | ||
|
|
f0dd5a103c | ||
|
|
784883af22 | ||
|
|
7718343b27 | ||
|
|
de14418e93 | ||
|
|
ebce725720 | ||
|
|
59b4350aa0 | ||
|
|
7419151314 | ||
|
|
0576031a81 | ||
|
|
f8382a2713 | ||
|
|
5cc58fa067 | ||
|
|
817f695297 | ||
|
|
a740d80a20 | ||
|
|
021f0840ae | ||
|
|
4fa2c54485 | ||
|
|
c9652fd42a | ||
|
|
4ec9e53deb | ||
|
|
68e14ceb29 | ||
|
|
49614cfe38 | ||
|
|
db13ac4c53 | ||
|
|
e9726af54c | ||
|
|
80134d2b7d | ||
|
|
71d150f6ec | ||
|
|
c7130081cc | ||
|
|
02b3adc4a7 | ||
|
|
18330f7ab7 | ||
|
|
d2194d787f | ||
|
|
f39d284193 | ||
|
|
7601788c43 | ||
|
|
8b3045baa2 | ||
|
|
c0a406b81f | ||
|
|
826eaed2ee | ||
|
|
4f875560b7 | ||
|
|
07384d6b5a | ||
|
|
19b56c1574 | ||
|
|
5bd574dd05 | ||
|
|
f69e9a3d37 | ||
|
|
a23785842c | ||
|
|
ea4d9a34fd | ||
|
|
a36f392b58 | ||
|
|
da96144e80 | ||
|
|
5de19500c2 | ||
|
|
09227526b6 | ||
|
|
7afe2e8dd8 | ||
|
|
eb6af9afb9 | ||
|
|
38652ec940 | ||
|
|
3c11c0d8d8 | ||
|
|
2317589950 | ||
|
|
e86c1851a7 | ||
|
|
ddba274496 | ||
|
|
544ea72d4c | ||
|
|
03dbcf5464 | ||
|
|
772dc302b6 | ||
|
|
fe91527604 | ||
|
|
5f18f9bbba | ||
|
|
1631cfdc83 | ||
|
|
f7bb43b20b | ||
|
|
168c744232 | ||
|
|
6e44760819 | ||
|
|
84a1a10006 | ||
|
|
28ad6066aa | ||
|
|
ffcefd9047 | ||
|
|
4252511b8e | ||
|
|
9974b6f747 | ||
|
|
15880f8d13 | ||
|
|
aa77e8ee23 | ||
|
|
50b93b161c | ||
|
|
78f7f00ae2 | ||
|
|
4683e20187 | ||
|
|
9c73eae941 | ||
|
|
8e136779ec | ||
|
|
c5ea4b43be | ||
|
|
c66f26245c | ||
|
|
30301187f0 | ||
|
|
d846ad5dac | ||
|
|
c50d267bfb | ||
|
|
0c30ee8d37 | ||
|
|
b4ecc5a8d9 | ||
|
|
c407123a72 | ||
|
|
2c2477a07d | ||
|
|
ac45c9001b | ||
|
|
78b45c4778 | ||
|
|
ddc4d70d51 | ||
|
|
1d5c5497b5 | ||
|
|
056f73f5d2 | ||
|
|
703141d650 | ||
|
|
332f669d9b | ||
|
|
7ed0eba50e | ||
|
|
8a2155f2af | ||
|
|
96f053273c | ||
|
|
09ecc84cc7 | ||
|
|
7e883809e3 | ||
|
|
c38f23c0e1 | ||
|
|
9c0ed52bb8 | ||
|
|
09ddc24801 | ||
|
|
3524fd7d24 | ||
|
|
e342299204 | ||
|
|
c4e77cf411 | ||
|
|
c94fe845ec | ||
|
|
a455962e17 | ||
|
|
dc1f343501 | ||
|
|
7f89994785 | ||
|
|
a9a3050682 | ||
|
|
8d254058fa | ||
|
|
d96810f250 | ||
|
|
29be7c3003 | ||
|
|
9131647566 | ||
|
|
00243a9842 | ||
|
|
97d9fd38be | ||
|
|
bc6e83f5e3 | ||
|
|
d85e416680 | ||
|
|
9258bb2ae8 | ||
|
|
88cf8f23f6 | ||
|
|
fd17c87eb4 | ||
|
|
972a6f7be8 | ||
|
|
2a729028bd | ||
|
|
7e282f579b | ||
|
|
ee58188162 | ||
|
|
506d1855ff | ||
|
|
b871b322d2 | ||
|
|
76ee17e532 | ||
|
|
54e14cd4b6 | ||
|
|
cb3120764a | ||
|
|
a0fdfb0c21 | ||
|
|
ed19d1ff6b | ||
|
|
fad07a45b9 | ||
|
|
8162300522 | ||
|
|
e43625cfc1 | ||
|
|
42d8459e87 | ||
|
|
82b2fa5ecb | ||
|
|
37edb43b60 | ||
|
|
6268cdc86a | ||
|
|
00dfc99e08 | ||
|
|
2a395c3fec | ||
|
|
1548a9a2a1 | ||
|
|
25e749de77 | ||
|
|
a2b1269b27 | ||
|
|
2214e7c202 | ||
|
|
998579befc | ||
|
|
0a40034159 | ||
|
|
5dcc62d8f9 | ||
|
|
377726a9a7 | ||
|
|
07fa814597 | ||
|
|
9649050c2e | ||
|
|
036f42999a | ||
|
|
57a665ad99 | ||
|
|
fcee34a9d1 | ||
|
|
5ed4e4e3a5 | ||
|
|
53b5758eb4 | ||
|
|
85b5b399b9 | ||
|
|
26de353d4f | ||
|
|
2f581a296e | ||
|
|
c9f278e46f | ||
|
|
0e5a83f3c1 | ||
|
|
37884dc5dd | ||
|
|
d995f758c2 | ||
|
|
f252ac3eff | ||
|
|
57fa9d2070 | ||
|
|
05dc643f17 | ||
|
|
361abd7f04 | ||
|
|
00d56b9ef8 | ||
|
|
150eb779ae | ||
|
|
5c88353d05 | ||
|
|
8a12dee125 | ||
|
|
b28bfce186 | ||
|
|
ec35e77175 | ||
|
|
050eedc4f8 | ||
|
|
5935b18581 | ||
|
|
04e8b40a5c | ||
|
|
422acc0b69 | ||
|
|
b8b855f2aa | ||
|
|
3c2bd4f6dd | ||
|
|
acc8acd059 | ||
|
|
33e259e827 | ||
|
|
47a4b95217 | ||
|
|
e9fb929f50 | ||
|
|
cb320f6e8a | ||
|
|
27e20acbae | ||
|
|
e6bb21db65 | ||
|
|
6618cac10a | ||
|
|
fedde86bf4 | ||
|
|
e56be33e50 | ||
|
|
8b8766e840 | ||
|
|
ea7cebbf10 | ||
|
|
4c0ed8bdd5 | ||
|
|
ef729ab2d8 | ||
|
|
f0dbae2e19 | ||
|
|
8b8513fe8c | ||
|
|
ae6600e48f | ||
|
|
705a08bbbd | ||
|
|
8ba5afcd5a | ||
|
|
52c790b184 | ||
|
|
645204eb42 | ||
|
|
e432a406b6 | ||
|
|
bf9f3b6061 | ||
|
|
286efb6b34 | ||
|
|
d49598b8b3 | ||
|
|
7b2367cdff | ||
|
|
993831aba8 | ||
|
|
eabc4647c2 | ||
|
|
f754d23a0f | ||
|
|
925c340915 | ||
|
|
e0c11f5545 | ||
|
|
cf5d959f1b | ||
|
|
940ac5471d | ||
|
|
f8e9a19889 | ||
|
|
e2a7145379 | ||
|
|
89f5bd27e8 | ||
|
|
bf0b3c1585 | ||
|
|
34c0d3e99a | ||
|
|
b04e2526a1 | ||
|
|
de1c865881 | ||
|
|
1f8b75c9f3 | ||
|
|
fab201a2d6 | ||
|
|
40a7bd009f | ||
|
|
024a86c309 | ||
|
|
571798c318 | ||
|
|
9f95f457a9 | ||
|
|
b09872e795 | ||
|
|
c2825f701a | ||
|
|
8026273cb0 | ||
|
|
7dea8d4a24 | ||
|
|
0551e001e2 | ||
|
|
27e61127a8 | ||
|
|
6f6ae78cf2 | ||
|
|
c1ba7ab62b | ||
|
|
bbf852787e | ||
|
|
3002852bfa | ||
|
|
f2e425b75b | ||
|
|
9d59ba125d | ||
|
|
37531c018a | ||
|
|
7f8c183d99 | ||
|
|
22db94e352 | ||
|
|
cea2350d2e | ||
|
|
b54982965b | ||
|
|
1bce38bd9b | ||
|
|
c2da51ccf5 | ||
|
|
099becb353 | ||
|
|
e0a214da20 | ||
|
|
3194153b21 | ||
|
|
b247dac120 | ||
|
|
56ddd29f1a | ||
|
|
e7f31393bc | ||
|
|
dfa2ec8c6c | ||
|
|
37108870e1 | ||
|
|
36103d33d2 | ||
|
|
3f3a44fec5 | ||
|
|
924fb49bf5 | ||
|
|
b65291579f | ||
|
|
4d0bb9f1e2 | ||
|
|
9794bb2f2f | ||
|
|
acc1f04b67 | ||
|
|
1091319274 | ||
|
|
a2c16a3b5e | ||
|
|
701d6314d2 | ||
|
|
a73ac821ab | ||
|
|
6739ae9dfc | ||
|
|
c84870046e | ||
|
|
b563fae118 | ||
|
|
de675845af | ||
|
|
2f113a4ce3 | ||
|
|
1869ffd15f | ||
|
|
91127d51c0 | ||
|
|
5ad671ed4c | ||
|
|
c7ec07be70 | ||
|
|
f67e74935e | ||
|
|
66dd72555a | ||
|
|
ef04085ac5 | ||
|
|
67a4a57491 | ||
|
|
872b08f677 | ||
|
|
fdff6ea325 | ||
|
|
d0355cef1f | ||
|
|
049146ef9c | ||
|
|
3e9d1388af | ||
|
|
016d514d80 | ||
|
|
ea10c8c8a3 | ||
|
|
739d1cfd3f | ||
|
|
fe29d99d62 | ||
|
|
4d10759699 | ||
|
|
178f32ab41 | ||
|
|
847d9ec4f4 | ||
|
|
534e10c96a | ||
|
|
4ef4be2d70 | ||
|
|
3f45d008eb | ||
|
|
8aee4432a9 | ||
|
|
85245471c0 | ||
|
|
2c29652136 | ||
|
|
0581f1af52 | ||
|
|
2dc97fc680 | ||
|
|
4e0980aeb9 | ||
|
|
7f56961e26 | ||
|
|
87dc996a41 | ||
|
|
b3c3d6f88f | ||
|
|
7c76c7c25a | ||
|
|
a7834693e8 | ||
|
|
d8cdb2032c | ||
|
|
ede032c557 | ||
|
|
fabb37975d | ||
|
|
0b930a36b9 | ||
|
|
1aeb139157 | ||
|
|
d1b27ab056 | ||
|
|
8727295f8e | ||
|
|
d3d9f013f4 | ||
|
|
095997ca59 | ||
|
|
fedb9de6ef | ||
|
|
ced8376268 | ||
|
|
e42b5804a0 | ||
|
|
d92496a7f7 | ||
|
|
f95f37cb7b | ||
|
|
83ec092b46 | ||
|
|
cc0d28e59b | ||
|
|
0d9c031a2c | ||
|
|
847562f5d7 | ||
|
|
47613fefa0 | ||
|
|
52d8723d55 | ||
|
|
696a378120 | ||
|
|
9933494d53 | ||
|
|
b2cfe05881 | ||
|
|
146c8ddbc3 | ||
|
|
97f6ad4e53 | ||
|
|
a812224103 | ||
|
|
95430180f0 | ||
|
|
c647b6db4d | ||
|
|
d860bdcdc0 | ||
|
|
229208610e | ||
|
|
e7d02f6272 | ||
|
|
3ef6ee056f | ||
|
|
3c9f5694e7 | ||
|
|
03813cc46b | ||
|
|
afdc8cdf55 | ||
|
|
2242331f08 | ||
|
|
eabb504445 | ||
|
|
7b109bacf2 | ||
|
|
fd768fe5ac | ||
|
|
5d18ea7502 | ||
|
|
51df9771b3 | ||
|
|
85e3073f14 | ||
|
|
c285e231b7 | ||
|
|
9230688f54 | ||
|
|
e8274d3ddb | ||
|
|
e6b82898fb | ||
|
|
0126e49841 | ||
|
|
dff50072e9 | ||
|
|
55267b9ad3 | ||
|
|
825ba912c3 | ||
|
|
3770bfd641 | ||
|
|
d50e307243 | ||
|
|
c248adb18d | ||
|
|
96387ed824 | ||
|
|
acd7c37057 | ||
|
|
413233341e | ||
|
|
afa9467dad | ||
|
|
982c25b7da | ||
|
|
184da9e743 | ||
|
|
f11d42aab3 | ||
|
|
46ec1e6b95 | ||
|
|
6bd17c7ba4 | ||
|
|
e951a356fe | ||
|
|
f038b16734 | ||
|
|
eed968979f | ||
|
|
c49a2da261 | ||
|
|
2ec1e508d2 | ||
|
|
adffb85962 | ||
|
|
4c5f32ab16 | ||
|
|
f83c53c274 | ||
|
|
3671bfb743 | ||
|
|
29f31ae6ac | ||
|
|
b31c346ea7 | ||
|
|
1dec6e83c6 | ||
|
|
c446304751 | ||
|
|
bada390dde | ||
|
|
538d9ada25 | ||
|
|
e2801d35e4 | ||
|
|
64d9b8eefd | ||
|
|
4ab8ddec53 | ||
|
|
c22a9137dd | ||
|
|
7bbfa5d94b | ||
|
|
d16daf5ba4 | ||
|
|
2a26611cf5 | ||
|
|
a76eab367c | ||
|
|
d9d5d9d9e4 | ||
|
|
26b7ac3884 | ||
|
|
574a67b93d | ||
|
|
2b85c594b3 | ||
|
|
d66af65a92 | ||
|
|
b731a9e96c | ||
|
|
2eac57731c | ||
|
|
f13b75a6d2 | ||
|
|
2f5357be7a | ||
|
|
6f7e978f33 | ||
|
|
4cca4ea954 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -64,7 +64,6 @@ CMakeLists.txt.user
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
*.config
|
||||
*.creator
|
||||
*.creator.user
|
||||
*.files
|
||||
|
||||
12
.gitmodules
vendored
12
.gitmodules
vendored
@ -1,12 +1,15 @@
|
||||
[submodule "mavlink/include/mavlink/v1.0"]
|
||||
path = mavlink/include/mavlink/v1.0
|
||||
url = git://github.com/mavlink/c_library.git
|
||||
url = https://github.com/mavlink/c_library_v1.git
|
||||
[submodule "mavlink/include/mavlink/v2.0"]
|
||||
path = mavlink/include/mavlink/v2.0
|
||||
url = https://github.com/mavlink/c_library_v2.git
|
||||
[submodule "NuttX"]
|
||||
path = NuttX
|
||||
url = git://github.com/PX4/NuttX.git
|
||||
url = https://github.com/PX4/NuttX.git
|
||||
[submodule "src/modules/uavcan/libuavcan"]
|
||||
path = src/modules/uavcan/libuavcan
|
||||
url = git://github.com/UAVCAN/libuavcan.git
|
||||
url = https://github.com/UAVCAN/libuavcan.git
|
||||
[submodule "Tools/genmsg"]
|
||||
path = Tools/genmsg
|
||||
url = https://github.com/ros/genmsg.git
|
||||
@ -38,6 +41,3 @@
|
||||
[submodule "src/drivers/gps/devices"]
|
||||
path = src/drivers/gps/devices
|
||||
url = https://github.com/PX4/GpsDrivers.git
|
||||
[submodule "mavlink/include/mavlink/v2.0"]
|
||||
path = mavlink/include/mavlink/v2.0
|
||||
url = git://github.com/mavlink/c_library.git
|
||||
|
||||
173
.travis.yml
173
.travis.yml
@ -7,130 +7,117 @@ matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: GCC_VER=4.8
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: GCC_VER=4.9
|
||||
sudo: required
|
||||
env: GCC_VER=4.8 DOCKER_REPO="px4io/px4-dev-base:2016-07-14"
|
||||
services:
|
||||
- docker
|
||||
- os: osx
|
||||
osx_image: xcode7
|
||||
sudo: true
|
||||
osx_image: xcode7.3
|
||||
env: CCACHE_CPP2=1
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
pip: true
|
||||
directories:
|
||||
- $HOME/.ccache
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- kubuntu-backports
|
||||
- ubuntu-toolchain-r-test
|
||||
- george-edison55-precise-backports
|
||||
packages:
|
||||
- build-essential
|
||||
- ccache
|
||||
- clang-3.5
|
||||
- cmake
|
||||
- g++-4.9
|
||||
- gcc-4.9
|
||||
- genromfs
|
||||
- libc6-i386
|
||||
- libncurses5-dev
|
||||
- ninja-build
|
||||
- python-argparse
|
||||
- python-empy
|
||||
- s3cmd
|
||||
- texinfo
|
||||
- zlib1g-dev
|
||||
- $HOME/.pip/cache/
|
||||
- $HOME/Library/Caches/pip
|
||||
|
||||
before_install:
|
||||
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
pushd .
|
||||
&& cd ~ && mkdir gcc && cd gcc
|
||||
&& if [ "$GCC_VER" = "4.8" ]; then GCC_URL="https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2" ; fi
|
||||
&& if [ "$GCC_VER" = "4.9" ]; then GCC_URL="https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2" ; fi
|
||||
&& wget -O gcc.tar.bz2 ${GCC_URL}
|
||||
&& tar -jxf gcc.tar.bz2 --strip 1
|
||||
&& exportline="export PATH=$HOME/gcc/bin:\$PATH"
|
||||
&& if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
|
||||
&& . ~/.profile
|
||||
&& popd
|
||||
&& git clone git://github.com/PX4/CI-Tools.git
|
||||
&& ./CI-Tools/s3cmd-configure
|
||||
&& mkdir -p ~/bin
|
||||
&& wget -O ~/bin/astyle https://github.com/PX4/astyle/releases/download/2.05.1/astyle-linux && chmod +x ~/bin/astyle
|
||||
&& astyle --version
|
||||
&& if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
|
||||
cd ${TRAVIS_BUILD_DIR}
|
||||
&& git fetch --unshallow && git fetch --all --tags
|
||||
&& docker pull ${DOCKER_REPO}
|
||||
;
|
||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
brew tap PX4/homebrew-px4
|
||||
&& brew update; brew update
|
||||
&& brew install cmake ninja
|
||||
&& brew install genromfs
|
||||
&& sudo easy_install pip
|
||||
&& sudo pip install empy
|
||||
sudo -H easy_install pip
|
||||
&& sudo -H pip install empy
|
||||
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ccache
|
||||
&& sudo mv ccache /usr/local/bin
|
||||
&& chmod +x /usr/local/bin/ccache
|
||||
&& mkdir -p ~/bin
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/c++
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/cc
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang++
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/g++
|
||||
&& sudo ln -s /usr/local/bin/ccache ~/bin/gcc
|
||||
&& export PATH=~/bin:$PATH
|
||||
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ninja
|
||||
&& sudo mv ninja /usr/local/bin
|
||||
&& chmod +x /usr/local/bin/ninja
|
||||
;
|
||||
fi
|
||||
|
||||
before_script:
|
||||
# setup ccache
|
||||
- mkdir -p ~/bin
|
||||
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-g++
|
||||
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-gcc
|
||||
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-size
|
||||
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-objcopy
|
||||
- ln -s /usr/bin/ccache ~/bin/clang++
|
||||
- ln -s /usr/bin/ccache ~/bin/clang++-3.4
|
||||
- ln -s /usr/bin/ccache ~/bin/clang++-3.5
|
||||
- ln -s /usr/bin/ccache ~/bin/clang
|
||||
- ln -s /usr/bin/ccache ~/bin/clang-3.4
|
||||
- ln -s /usr/bin/ccache ~/bin/clang-3.5
|
||||
- export PATH=~/bin:$PATH
|
||||
|
||||
env:
|
||||
global:
|
||||
- NINJA_BUILD=1
|
||||
# AWS KEY: $PX4_AWS_KEY
|
||||
- secure: "XknnZHWBbpHbN4f3fuAVwUztdLIu8ej4keC3aQSDofo3uw8AFEzojfsQsN9u77ShWSIV4iYJWh9C9ALkCx7TocJ+xYjiboo10YhM9lH/8u+EXjYWG6GHS8ua0wkir+cViSxoLNaMtmcb/rPTicJecAGANxLsIHyBAgTL3fkbLSA="
|
||||
# AWS SECRET: $PX4_AWS_SECRET
|
||||
- secure: "h6oajlW68dWIr+wZhO58Dv6e68dZHrBLVA6lPXZmheFQBW6Xam1HuLGA0LOW6cL9TnrAsOZ8g4goB58eMQnMEijFZKi3mhRwZhd/Xjq/ZGJOWBUrLoQHZUw2dQk5ja5vmUlKEoQnFZjDuMjx8KfX5ZMNy8A3yssWZtJYHD8c+bk="
|
||||
- PX4_AWS_BUCKET=px4-travis
|
||||
- GIT_SUBMODULES_ARE_EVIL=1
|
||||
|
||||
script:
|
||||
- git submodule update --quiet --init --recursive
|
||||
- ccache -M 1GB; ccache -z
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
arm-none-eabi-gcc --version && make check VECTORCONTROL=1;
|
||||
docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e GIT_SUBMODULES_ARE_EVIL=1 -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "make check_qgc_firmware VECTORCONTROL=1";
|
||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
make check_posix_sitl_default;
|
||||
fi
|
||||
- ccache -s
|
||||
|
||||
after_success:
|
||||
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${GCC_VER}" = "4.8" ]]; then
|
||||
make package_firmware
|
||||
&& find . -name \*.px4 -exec cp "{}" . \;
|
||||
&& find . -maxdepth 1 -mindepth 1 -type f -name 'nuttx-*-default.px4' | sed 's/.\/nuttx-//' | sed 's/-default.px4//' | xargs -I{} mv nuttx-{}-default.px4 {}_default.px4
|
||||
&& ./CI-Tools/s3cmd-put `find . -maxdepth 1 -mindepth 1 -type f -name '*_default.px4'` build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
|
||||
&& ./CI-Tools/s3cmd-put Firmware.zip archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/
|
||||
&& ./CI-Tools/s3cmd-put CI-Tools/directory/index.html archives/Firmware/$TRAVIS_BRANCH/
|
||||
&& ./CI-Tools/s3cmd-put CI-Tools/index.html index.html
|
||||
&& ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html
|
||||
&& echo ""
|
||||
&& echo "Binaries have been posted to:" https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
|
||||
;
|
||||
- make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/
|
||||
# find all px4 firmware (*.px4) and rename
|
||||
- find . -type f -name 'nuttx-*-default.px4' -exec cp "{}" . \;
|
||||
- find . -maxdepth 1 -mindepth 1 -type f -name 'nuttx-*-default.px4' | sed 's/.\/nuttx-//' | sed 's/-default.px4//' | xargs -I{} mv nuttx-{}-default.px4 {}_default.px4
|
||||
- mkdir s3deploy-branch && mv *_default.px4 build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml s3deploy-branch/
|
||||
# only deploy GCC 4.8 builds on master/beta/stable
|
||||
- if [[ "$GCC_VER" == "4.8" && ( "$TRAVIS_BRANCH" == "master" || "$TRAVIS_BRANCH" == "beta" || "$TRAVIS_BRANCH" == "stable" ) ]]; then
|
||||
export PX4_S3_DEPLOY=1;
|
||||
fi
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
|
||||
file: "Firmware.zip"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
repo: PX4/Firmware
|
||||
condition: $GCC_VER = 4.8
|
||||
# deploy *.px4 to S3 px4-travis/Firmware/$TRAVIS_BRANCH
|
||||
- provider: s3
|
||||
access_key_id: $PX4_AWS_KEY
|
||||
secret_access_key:
|
||||
secure: $PX4_AWS_SECRET
|
||||
bucket: px4-travis
|
||||
local_dir: s3deploy-branch
|
||||
upload-dir: Firmware/$TRAVIS_BRANCH
|
||||
acl: public_read
|
||||
skip_cleanup: true
|
||||
on:
|
||||
all_branches: true
|
||||
condition: $PX4_S3_DEPLOY = 1
|
||||
|
||||
# deploy Firmware.zip to S3 px4-travis/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
|
||||
- provider: s3
|
||||
access_key_id: $PX4_AWS_KEY
|
||||
secret_access_key:
|
||||
secure: $PX4_AWS_SECRET
|
||||
bucket: px4-travis
|
||||
local_dir: s3deploy-archive
|
||||
upload-dir: archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
|
||||
acl: public_read
|
||||
skip_cleanup: true
|
||||
on:
|
||||
all_branches: true
|
||||
condition: $PX4_S3_DEPLOY = 1
|
||||
|
||||
# on tags deploy Firmware.zip to Github releases
|
||||
- provider: releases
|
||||
api_key:
|
||||
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
|
||||
file: "Firmware.zip"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
repo: PX4/Firmware
|
||||
condition: $GCC_VER = 4.8
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
|
||||
@ -132,7 +132,7 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
set(CMAKE_BUILD_TYPE "" CACHE STRING "build type")
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS ";Debug;Release;RelWithDebInfo;MinSizeRel")
|
||||
set(CONFIG "nuttx_px4fmu-v2_default" CACHE STRING "desired configuration")
|
||||
set(CONFIG "posix_sitl_default" CACHE STRING "desired configuration")
|
||||
file(GLOB_RECURSE configs RELATIVE cmake/configs "cmake/configs/*.cmake")
|
||||
set_property(CACHE CONFIG PROPERTY STRINGS ${configs})
|
||||
set(THREADS "4" CACHE STRING
|
||||
@ -152,6 +152,17 @@ set(target_name "${OS}-${BOARD}-${LABEL}")
|
||||
|
||||
message(STATUS "${target_name}")
|
||||
|
||||
# Define GNU standard installation directories
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Setup install paths
|
||||
if(NOT CMAKE_INSTALL_PREFIX)
|
||||
if (${OS} STREQUAL "posix")
|
||||
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# switch to ros CMake file if building ros
|
||||
if (${OS} STREQUAL "ros")
|
||||
include("cmake/ros-CMakeLists.txt")
|
||||
@ -202,7 +213,7 @@ if (NOT ${CMAKE_VERSION} VERSION_LESS 3.1.0)
|
||||
endif()
|
||||
|
||||
set(version_major 1)
|
||||
set(version_minor 0)
|
||||
set(version_minor 4)
|
||||
set(version_patch 1)
|
||||
set(version "${version_major}.${version_minor}.${version_patch}")
|
||||
set(package-contact "px4users@googlegroups.com")
|
||||
@ -235,7 +246,7 @@ endforeach()
|
||||
px4_add_git_submodule(TARGET git_genmsg PATH "Tools/genmsg")
|
||||
px4_add_git_submodule(TARGET git_gencpp PATH "Tools/gencpp")
|
||||
px4_add_git_submodule(TARGET git_mavlink PATH "mavlink/include/mavlink/v1.0")
|
||||
px4_add_git_submodule(TARGET git_gtest PATH "unittets/gtest")
|
||||
px4_add_git_submodule(TARGET git_gtest PATH "unittests/gtest")
|
||||
px4_add_git_submodule(TARGET git_uavcan PATH "src/modules/uavcan/libuavcan")
|
||||
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
|
||||
px4_add_git_submodule(TARGET git_driverframework PATH "src/lib/DriverFramework")
|
||||
@ -371,10 +382,27 @@ px4_create_git_hash_header(HEADER ${CMAKE_BINARY_DIR}/build_git_version.h)
|
||||
#
|
||||
# Important to having packaging at end of cmake file.
|
||||
#
|
||||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}-${CONFIG})
|
||||
set(CPACK_PACKAGE_VERSION ${version})
|
||||
set(CPACK_PACKAGE_CONTACT ${package_contact})
|
||||
set(CPACK_PACKAGE_CONTACT ${package-contact})
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(short-description "The px4 autopilot.")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${short-description})
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CONFIG}-${version}")
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${version}")
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
||||
if ("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
find_program(DPKG_PROGRAM dpkg)
|
||||
if (EXISTS ${DPKG_PROGRAM})
|
||||
list (APPEND CPACK_GENERATOR "DEB")
|
||||
endif()
|
||||
endif()
|
||||
if (${OS} STREQUAL "posix")
|
||||
set(CPACK_SET_DESTDIR "ON")
|
||||
endif()
|
||||
include(CPack)
|
||||
|
||||
endif() # ros alternative endif
|
||||
|
||||
@ -66,8 +66,8 @@ Linux or Eagle with a working IP interface (?? does this need further instructio
|
||||
> adb shell
|
||||
# bash
|
||||
root@linaro-developer:/# cd ???
|
||||
root@linaro-developer:/# ./mainapp
|
||||
App name: mainapp
|
||||
root@linaro-developer:/# ./px4
|
||||
App name: px4
|
||||
Enter a command and its args:
|
||||
uorb start
|
||||
muorb start
|
||||
|
||||
12
Images/tap-v1.prototype
Normal file
12
Images/tap-v1.prototype
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"board_id": 78,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the TAPv1 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "TAPv1",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
97
Makefile
97
Makefile
@ -50,11 +50,11 @@ ifneq ($(CMAKE_VER),0)
|
||||
$(warning sudo apt-get install cmake)
|
||||
$(warning )
|
||||
$(warning Official website:)
|
||||
$(warning wget https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.sh)
|
||||
$(warning chmod +x cmake-3.3.2-Linux-x86_64.sh)
|
||||
$(warning sudo mkdir /opt/cmake-3.3.2)
|
||||
$(warning sudo ./cmake-3.3.2-Linux-x86_64.sh --prefix=/opt/cmake-3.3.2 --exclude-subdir)
|
||||
$(warning export PATH=/opt/cmake-3.3.2/bin:$$PATH)
|
||||
$(warning wget https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.sh)
|
||||
$(warning chmod +x cmake-3.4.3-Linux-x86_64.sh)
|
||||
$(warning sudo mkdir /opt/cmake-3.4.3)
|
||||
$(warning sudo ./cmake-3.4.3-Linux-x86_64.sh --prefix=/opt/cmake-3.4.3 --exclude-subdir)
|
||||
$(warning export PATH=/opt/cmake-3.4.3/bin:$$PATH)
|
||||
$(warning )
|
||||
$(error Fatal)
|
||||
endif
|
||||
@ -77,7 +77,7 @@ endif
|
||||
# in that directory with the target upload.
|
||||
|
||||
# explicity set default build target
|
||||
all: px4fmu-v2_default
|
||||
all: posix_sitl_default
|
||||
|
||||
# Parsing
|
||||
# --------------------------------------------------------------------
|
||||
@ -104,20 +104,27 @@ endif
|
||||
PX4_MAKE_ARGS = -j$(j) --no-print-directory
|
||||
endif
|
||||
|
||||
# check if replay env variable is set & set build dir accordingly
|
||||
ifdef replay
|
||||
BUILD_DIR_SUFFIX := _replay
|
||||
else
|
||||
BUILD_DIR_SUFFIX :=
|
||||
endif
|
||||
|
||||
# Functions
|
||||
# --------------------------------------------------------------------
|
||||
# describe how to build a cmake config
|
||||
define cmake-build
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
|
||||
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(PWD)/build_$@); fi
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e ./build_$@$(BUILD_DIR_SUFFIX)/Makefile ]; then rm -rf ./build_$@$(BUILD_DIR_SUFFIX); fi
|
||||
+@if [ ! -e ./build_$@$(BUILD_DIR_SUFFIX)/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p ./build_$@$(BUILD_DIR_SUFFIX) && cd ./build_$@$(BUILD_DIR_SUFFIX) && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf ./build_$@$(BUILD_DIR_SUFFIX)); fi
|
||||
+@Tools/check_submodules.sh
|
||||
+@(echo "PX4 CONFIG: $@" && cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||
+@(echo "PX4 CONFIG: $@$(BUILD_DIR_SUFFIX)" && cd ./build_$@$(BUILD_DIR_SUFFIX) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||
endef
|
||||
|
||||
define cmake-build-other
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
|
||||
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake $(2) -G$(PX4_CMAKE_GENERATOR) || (cd .. && rm -rf $(PWD)/build_$@); fi
|
||||
+@(cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e ./build_$@/Makefile ]; then rm -rf ./build_$@; fi
|
||||
+@if [ ! -e ./build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p ./build_$@ && cd ./build_$@ && cmake $(2) -G$(PX4_CMAKE_GENERATOR) || (cd .. && rm -rf ./build_$@); fi
|
||||
+@(cd ./build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||
endef
|
||||
|
||||
# create empty targets to avoid msgs for targets passed to cmake
|
||||
@ -137,12 +144,15 @@ endef
|
||||
# --------------------------------------------------------------------
|
||||
# Do not put any spaces between function arguments.
|
||||
|
||||
tap-v1_default:
|
||||
$(call cmake-build,nuttx_tap-v1_default)
|
||||
|
||||
px4fmu-v1_default:
|
||||
$(call cmake-build,nuttx_px4fmu-v1_default)
|
||||
|
||||
px4fmu-v2_default:
|
||||
$(call cmake-build,nuttx_px4fmu-v2_default)
|
||||
|
||||
|
||||
px4fmu-v2_test:
|
||||
$(call cmake-build,nuttx_px4fmu-v2_test)
|
||||
|
||||
@ -161,7 +171,7 @@ mindpx-v2_default:
|
||||
posix_sitl_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_sitl_test:
|
||||
posix_sitl_lpe:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_sitl_replay:
|
||||
@ -186,10 +196,10 @@ eagle_default: posix_eagle_default qurt_eagle_default
|
||||
eagle_legacy_default: posix_eagle_legacy_driver_default qurt_eagle_legacy_driver_default
|
||||
|
||||
qurt_eagle_legacy_driver_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_eagle_legacy_driver_default:
|
||||
$(call cmake-build,$@)
|
||||
$(call cmake-build,$@)
|
||||
|
||||
qurt_excelsior_default:
|
||||
$(call cmake-build,$@)
|
||||
@ -199,10 +209,10 @@ posix_excelsior_default:
|
||||
|
||||
excelsior_default: posix_excelsior_default qurt_excelsior_default
|
||||
|
||||
posix_rpi2_default:
|
||||
posix_rpi_native:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_rpi2_release:
|
||||
posix_rpi_cross:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_bebop_default:
|
||||
@ -223,12 +233,12 @@ run_sitl_ros: sitl_deprecation
|
||||
# Other targets
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
.PHONY: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
|
||||
.NOTPARALLEL: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
|
||||
.PHONY: gazebo_build uavcan_firmware check check_format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
||||
.NOTPARALLEL: gazebo_build uavcan_firmware check check_format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
||||
|
||||
gazebo_build:
|
||||
@mkdir -p build_gazebo
|
||||
@if [ ! -e $(PWD)/build_gazebo/CMakeCache.txt ];then cd build_gazebo && cmake -Wno-dev -G$(PX4_CMAKE_GENERATOR) $(PWD)/Tools/sitl_gazebo; fi
|
||||
@if [ ! -e ./build_gazebo/CMakeCache.txt ];then cd build_gazebo && cmake -Wno-dev -G$(PX4_CMAKE_GENERATOR) ../Tools/sitl_gazebo; fi
|
||||
@cd build_gazebo && $(PX4_MAKE) $(PX4_MAKE_ARGS)
|
||||
@cd build_gazebo && $(PX4_MAKE) $(PX4_MAKE_ARGS) sdf
|
||||
|
||||
@ -243,6 +253,7 @@ checks_defaults: \
|
||||
check_px4fmu-v2_default \
|
||||
check_mindpx-v2_default \
|
||||
check_px4-stm32f4discovery_default \
|
||||
check_tap-v1_default \
|
||||
|
||||
checks_bootloaders: \
|
||||
|
||||
@ -257,14 +268,14 @@ checks_uavcan: \
|
||||
check_px4fmu-v4_default_and_uavcan
|
||||
|
||||
checks_sitls: \
|
||||
check_posix_sitl_default \
|
||||
check_posix_sitl_test \
|
||||
check_posix_sitl_default
|
||||
|
||||
checks_last: \
|
||||
check_unittest \
|
||||
check_tests \
|
||||
check_format \
|
||||
|
||||
check: checks_defaults checks_tests checks_alts checks_uavcan checks_bootloaders checks_sitls checks_last
|
||||
check: checks_defaults checks_tests checks_alts checks_uavcan checks_bootloaders checks_last
|
||||
quick_check: check_px4fmu-v2_default check_px4fmu-v4_default check_tests check_format
|
||||
|
||||
check_format:
|
||||
$(call colorecho,"Checking formatting with astyle")
|
||||
@ -286,15 +297,31 @@ ifeq ($(VECTORCONTROL),1)
|
||||
@rm -rf ROMFS/px4fmu_common/uavcan
|
||||
endif
|
||||
|
||||
unittest: posix_sitl_test
|
||||
@export CC=clang
|
||||
@export CXX=clang++
|
||||
@export ASAN_OPTIONS=symbolize=1
|
||||
unittest: posix_sitl_default
|
||||
$(call cmake-build-other,unittest, ../unittests)
|
||||
@(cd build_unittest && ctest -j2 --output-on-failure)
|
||||
|
||||
test_onboard_sitl:
|
||||
@HEADLESS=1 make posix_sitl_test gazebo_iris
|
||||
|
||||
run_tests_posix: posix_sitl_default
|
||||
@mkdir -p build_posix_sitl_default/src/firmware/posix/rootfs/fs/microsd
|
||||
@mkdir -p build_posix_sitl_default/src/firmware/posix/rootfs/eeprom
|
||||
@touch build_posix_sitl_default/src/firmware/posix/rootfs/eeprom/parameters
|
||||
@(cd build_posix_sitl_default/src/firmware/posix && ./px4 -d ../../../../posix-configs/SITL/init/rcS_tests | tee test_output)
|
||||
@(cd build_posix_sitl_default/src/firmware/posix && grep --color=always "All tests passed" test_output)
|
||||
|
||||
tests: check_unittest run_tests_posix
|
||||
|
||||
# QGroundControl flashable firmware
|
||||
qgc_firmware: \
|
||||
check_px4fmu-v1_default \
|
||||
check_px4fmu-v2_default \
|
||||
check_mindpx-v2_default \
|
||||
check_px4fmu-v4_default_and_uavcan \
|
||||
check_format
|
||||
|
||||
extra_firmware: \
|
||||
check_px4-stm32f4discovery_default \
|
||||
check_px4fmu-v2_test \
|
||||
check_px4fmu-v2_ekf2
|
||||
|
||||
package_firmware:
|
||||
@zip --junk-paths Firmware.zip `find . -name \*.px4`
|
||||
@ -312,10 +339,10 @@ distclean: submodulesclean
|
||||
@git clean -ff -x -d -e ".project" -e ".cproject"
|
||||
|
||||
# targets handled by cmake
|
||||
cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak \
|
||||
cmake_targets = install test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak \
|
||||
run_cmake_config config gazebo gazebo_gdb gazebo_lldb jmavsim replay \
|
||||
jmavsim_gdb jmavsim_lldb gazebo_gdb_iris gazebo_lldb_tailsitter gazebo_iris gazebo_iris_opt_flow gazebo_tailsitter \
|
||||
gazebo_gdb_standard_vtol gazebo_lldb_standard_vtol gazebo_standard_vtol gazebo_plane gazebo_solo
|
||||
gazebo_gdb_standard_vtol gazebo_lldb_standard_vtol gazebo_standard_vtol gazebo_plane gazebo_solo gazebo_typhoon_h480
|
||||
$(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
2
NuttX
2
NuttX
@ -1 +1 @@
|
||||
Subproject commit f0f4bdc872d324f64e9d93d6f8989d3c1dfa2633
|
||||
Subproject commit 55e8d557ecba65c82f7ce8fd326575470f0e5acc
|
||||
@ -1,6 +1,6 @@
|
||||
## PX4 Pro Drone Autopilot ##
|
||||
|
||||
[](https://travis-ci.org/PX4/Firmware) [](https://scan.coverity.com/projects/3966?tab=overview)
|
||||
[](https://github.com/PX4/Firmware/releases) [](https://zenodo.org/badge/latestdoi/22634/PX4/Firmware) [](https://travis-ci.org/PX4/Firmware) [](https://scan.coverity.com/projects/3966?tab=overview)
|
||||
|
||||
[](https://gitter.im/PX4/Firmware?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
@ -21,10 +21,3 @@ then
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_YAW_P 4
|
||||
fi
|
||||
|
||||
set MIXER quad_x
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
set PWM_MIN 1100
|
||||
set PWM_MAX 1950
|
||||
|
||||
@ -15,22 +15,28 @@ then
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_TRANS_THR 0.75
|
||||
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.15
|
||||
param set MC_ROLLRATE_I 0.002
|
||||
param set MC_ROLLRATE_I 0.01
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_FF 0.0
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.12
|
||||
param set MC_PITCHRATE_I 0.002
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.15
|
||||
param set MC_PITCHRATE_I 0.01
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_FF 0.0
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAW_P 3.5
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MC_YAWRATE_P 0.22
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
param set MC_YAWRATE_MAX 20
|
||||
param set MC_YAWRAUTO_MAX 20
|
||||
|
||||
param set MPC_XY_P 0.8
|
||||
param set MPC_XY_VEL_P 0.1
|
||||
param set MPC_ACC_HOR_MAX 2.0
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
|
||||
36
ROMFS/px4fmu_common/init.d/13010_claire
Normal file
36
ROMFS/px4fmu_common/init.d/13010_claire
Normal file
@ -0,0 +1,36 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name CruiseAder Claire
|
||||
#
|
||||
# @type VTOL Tiltrotor
|
||||
#
|
||||
# @maintainer Samay Siga <samay_s@icloud.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set VT_TYPE 1
|
||||
param set VT_TILT_MC 0.08
|
||||
param set VT_TILT_TRANS 0.5
|
||||
param set VT_TILT_FW 0.9
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
fi
|
||||
|
||||
set MIXER claire
|
||||
set PWM_OUT 1234
|
||||
set PWM_RATE 400
|
||||
set PWM_MAX 2000
|
||||
|
||||
set MIXER_AUX claire
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_RATE 123
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
set PWM_AUX_DISARMED 1000
|
||||
|
||||
set MAV_TYPE 21
|
||||
@ -11,31 +11,44 @@ sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MAX 20
|
||||
param set FW_AIRSPD_MIN 12
|
||||
param set FW_AIRSPD_TRIM 16
|
||||
param set FW_R_TC 0.3
|
||||
param set FW_P_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_AIRSPD_MAX 25
|
||||
param set FW_AIRSPD_MIN 12.5
|
||||
param set FW_AIRSPD_TRIM 16.5
|
||||
param set LNDFW_AIRSPD_MAX 6
|
||||
param set LNDFW_VELI_MAX 4
|
||||
param set LNDFW_VEL_XY_MAX 3
|
||||
param set LNDFW_VEL_Z_MAX 5
|
||||
param set FW_R_TC 0.4
|
||||
param set FW_P_TC 0.4
|
||||
param set FW_THR_CRUISE 0.55
|
||||
param set FW_L1_DAMPING 0.75
|
||||
param set FW_L1_PERIOD 15
|
||||
param set FW_LND_ANG 15
|
||||
param set FW_LND_FLALT 5
|
||||
param set FW_LND_FLALT 8
|
||||
param set FW_LND_HHDIST 15
|
||||
param set FW_LND_HVIRT 13
|
||||
param set FW_LND_TLALT 5
|
||||
param set FW_LND_TLALT 10
|
||||
param set FW_THR_LND_MAX 0
|
||||
param set FW_PR_FF 0.35
|
||||
param set FW_P_LIM_MAX 20
|
||||
param set FW_P_LIM_MIN -30
|
||||
param set FW_R_LIM 45
|
||||
param set FW_PR_FF 0.45
|
||||
param set FW_PR_IMAX 0.4
|
||||
param set FW_PR_P 0.08
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_PR_P 0.005
|
||||
param set FW_RR_FF 0.45
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.04
|
||||
param set FW_RR_P 0.013
|
||||
param set FW_P_RMAX_NEG 70
|
||||
param set FW_P_RMAX_POS 70
|
||||
param set FW_R_RMAX 70
|
||||
param set SYS_COMPANION 157600
|
||||
param set PWM_MAIN_REV0 1
|
||||
param set PWM_MAIN_REV1 1
|
||||
param set PWM_MAIN_REV2 1
|
||||
param set PWM_DISARMED 0
|
||||
param set PWM_MIN 900
|
||||
param set PWM_MAX 2100
|
||||
param set MIS_TAKEOFF_ALT 50
|
||||
param set NAV_LOITER_RAD 30
|
||||
fi
|
||||
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
|
||||
34
ROMFS/px4fmu_common/init.d/4002_qavr5
Normal file
34
ROMFS/px4fmu_common/init.d/4002_qavr5
Normal file
@ -0,0 +1,34 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Lumenier QAV-R (raceblade) 5" arms
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer James Goppert <james.goppert@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 8.0
|
||||
param set MC_ROLLRATE_P 0.08
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_PITCH_P 8.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.15
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
param set PWM_MIN 1075
|
||||
param set MPC_THR_MIN 0.06
|
||||
param set MPC_MANTHR_MIN 0.06
|
||||
fi
|
||||
@ -29,7 +29,7 @@ then
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.8
|
||||
|
||||
param set BAT_V_SCALING 0.00838095238
|
||||
param set BAT_V_DIV 34.32838
|
||||
fi
|
||||
|
||||
set OUTPUT_MODE ardrone
|
||||
|
||||
@ -79,7 +79,7 @@ then
|
||||
param set RC5_TRIM 1500
|
||||
fi
|
||||
|
||||
set MIXER solo
|
||||
set MIXER quad_x
|
||||
|
||||
set PWM_OUT 1234
|
||||
set MIXER_AUX none
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#
|
||||
# Start the attitude and position estimator
|
||||
#
|
||||
ekf_att_pos_estimator start
|
||||
ekf2 start
|
||||
|
||||
#
|
||||
# Start attitude controller
|
||||
|
||||
@ -11,7 +11,12 @@ then
|
||||
param set RTL_DESCEND_ALT 100
|
||||
param set RTL_LAND_DELAY -1
|
||||
|
||||
param set NAV_ACC_RAD 50
|
||||
# FW uses L1 distance for acceptance radius
|
||||
# set a smaller NAV_ACC_RAD for vertical acceptance distance
|
||||
param set NAV_ACC_RAD 10
|
||||
|
||||
param set MIS_LTRMIN_ALT 25
|
||||
param set MIS_TAKEOFF_ALT 25
|
||||
|
||||
param set PE_VELNE_NOISE 0.3
|
||||
param set PE_VELD_NOISE 0.35
|
||||
|
||||
@ -29,19 +29,9 @@ then
|
||||
fi
|
||||
#---------------------------------------
|
||||
|
||||
if mc_att_control start
|
||||
then
|
||||
else
|
||||
# try the multiplatform version
|
||||
mc_att_control_m start
|
||||
fi
|
||||
mc_att_control start
|
||||
|
||||
if mc_pos_control start
|
||||
then
|
||||
else
|
||||
# try the multiplatform version
|
||||
mc_pos_control_m start
|
||||
fi
|
||||
mc_pos_control start
|
||||
|
||||
#
|
||||
# Start Land Detector
|
||||
|
||||
@ -14,6 +14,17 @@ else
|
||||
fmu i2c 1 100000
|
||||
fmu i2c 2 100000
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
# We know there are sketchy boards out there
|
||||
# as chinese companies produce Pixracers without
|
||||
# fully understanding the critical parts of the
|
||||
# schematic and BOM, leading to sensor brownouts
|
||||
# on boot. Original Pixracers following the
|
||||
# open hardware design do not require this.
|
||||
fmu sensor_reset 20
|
||||
fi
|
||||
|
||||
if ms5611 -s start
|
||||
then
|
||||
fi
|
||||
@ -190,7 +201,7 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if sf10a start
|
||||
if sf1xx start
|
||||
then
|
||||
fi
|
||||
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# UAVCAN initialization script.
|
||||
#
|
||||
|
||||
#
|
||||
# Starting stuff according to UAVCAN_ENABLE value
|
||||
#
|
||||
if param greater UAVCAN_ENABLE 0
|
||||
then
|
||||
if uavcan start
|
||||
then
|
||||
echo "[i] UAVCAN started"
|
||||
else
|
||||
echo "[i] ERROR: Could not start UAVCAN"
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
if param greater UAVCAN_ENABLE 1
|
||||
then
|
||||
if uavcan start fw
|
||||
then
|
||||
echo "[i] UAVCAN servers started"
|
||||
else
|
||||
echo "[i] ERROR: Could not start UAVCAN servers"
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@ -1,9 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# USB MAVLink start
|
||||
#
|
||||
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
|
||||
# Exit shell to make it available to MAVLink
|
||||
exit
|
||||
@ -109,6 +109,16 @@ then
|
||||
set AUTOCNF yes
|
||||
else
|
||||
set AUTOCNF no
|
||||
|
||||
#
|
||||
# Release 1.4.0 transitional support:
|
||||
# set to old default if unconfigured.
|
||||
# this preserves the previous behaviour
|
||||
#
|
||||
if param compare BAT_N_CELLS 0
|
||||
then
|
||||
param set BAT_N_CELLS 3
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
@ -530,13 +540,13 @@ then
|
||||
# clear pins 5 and 6
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
then
|
||||
set FMU_MODE pwm4
|
||||
set AUX_MODE pwm4
|
||||
fi
|
||||
if param greater TRIG_MODE 0
|
||||
then
|
||||
# Get FMU driver out of the way
|
||||
set MIXER_AUX none
|
||||
set AUX_MODE none
|
||||
set FMU_MODE pwm4
|
||||
set AUX_MODE pwm4
|
||||
camera_trigger start
|
||||
fi
|
||||
fi
|
||||
@ -583,6 +593,12 @@ then
|
||||
sf0x start
|
||||
fi
|
||||
|
||||
# mb12xx sonar sensor
|
||||
if param compare SENS_EN_MB12XX 1
|
||||
then
|
||||
mb12xx start
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
frsky_telemetry start -d /dev/ttyS6
|
||||
@ -638,7 +654,7 @@ then
|
||||
then
|
||||
fi
|
||||
else
|
||||
if logger start -b 12
|
||||
if logger start -b 12 -t
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
Binary file not shown.
38
ROMFS/px4fmu_common/mixers/claire.aux.mix
Normal file
38
ROMFS/px4fmu_common/mixers/claire.aux.mix
Normal file
@ -0,0 +1,38 @@
|
||||
# mixer for the CruiseAder Claire tilt mechansim servo, aileron and elevator
|
||||
|
||||
=======================================================================
|
||||
|
||||
|
||||
Tilt mechanism servo mixer
|
||||
|
||||
---------------------------
|
||||
|
||||
M: 1
|
||||
|
||||
O: 10000 10000 0 -10000 10000
|
||||
|
||||
S: 1 4 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
|
||||
Aileron mixers
|
||||
|
||||
-------------
|
||||
|
||||
M: 1
|
||||
|
||||
O: 10000 10000 0 -10000 10000
|
||||
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
|
||||
Elevator mixers
|
||||
|
||||
-------------
|
||||
|
||||
M: 1
|
||||
|
||||
O: 10000 10000 0 -10000 10000
|
||||
|
||||
S: 1 1 -10000 -10000 0 -10000 10000
|
||||
7
ROMFS/px4fmu_common/mixers/claire.main.mix
Normal file
7
ROMFS/px4fmu_common/mixers/claire.main.mix
Normal file
@ -0,0 +1,7 @@
|
||||
# CruiseAder Claire Main Multirotor mixer for PX4FMU
|
||||
|
||||
#
|
||||
|
||||
#===========================
|
||||
|
||||
R: 4x 10000 10000 10000 0
|
||||
@ -1,26 +0,0 @@
|
||||
Mixer for SITL plane, using the VTOL airframe for now
|
||||
=========================================================
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
# mixer for the elevons
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 5000 5000 0 -10000 10000
|
||||
S: 0 1 -5000 -5000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 5000 5000 0 -10000 10000
|
||||
S: 0 1 5000 5000 0 -10000 10000
|
||||
|
||||
# mixer for the pusher/puller throttle
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
@ -1,18 +0,0 @@
|
||||
Multirotor mixer for PX4FMU
|
||||
===========================
|
||||
|
||||
This file defines a single mixer for a quadrotor in the V configuration. All controls
|
||||
are mixed 100%.
|
||||
|
||||
R: 4v 10000 10000 10000 0
|
||||
|
||||
Gimbal / payload mixer for last two channels
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
@ -6,13 +6,21 @@ are mixed 100%.
|
||||
|
||||
R: 4x 10000 10000 10000 0
|
||||
|
||||
#mixer for the elevons
|
||||
Z:
|
||||
|
||||
# left elevon
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 5000 5000 0 -10000 10000
|
||||
S: 1 1 5000 5000 0 -10000 10000
|
||||
|
||||
# right elevon
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 5000 5000 0 -10000 10000
|
||||
S: 1 1 -5000 -5000 0 -10000 10000
|
||||
|
||||
# mixer for the virtual elevator
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 1 10000 10000 0 -10000 10000
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
Multirotor mixer for PX4FMU
|
||||
===========================
|
||||
|
||||
This file defines a single mixer for a quadrotor in the X configuration. All controls
|
||||
are mixed 100%.
|
||||
|
||||
R: 4x 10000 10000 10000 0
|
||||
@ -19,13 +19,13 @@ input is inverted between the two servos.
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 -6000 -6000 0 -10000 10000
|
||||
S: 1 1 6500 6500 0 -10000 10000
|
||||
S: 1 0 -8000 -8000 0 -10000 10000
|
||||
S: 1 1 8000 8000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 -6000 -6000 0 -10000 10000
|
||||
S: 1 1 -6500 -6500 0 -10000 10000
|
||||
S: 1 0 -8000 -8000 0 -10000 10000
|
||||
S: 1 1 -8000 -8000 0 -10000 10000
|
||||
|
||||
Motor speed mixer
|
||||
-----------------
|
||||
|
||||
@ -190,7 +190,7 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if sf10a start
|
||||
if sf1xx start
|
||||
then
|
||||
fi
|
||||
|
||||
|
||||
@ -111,87 +111,22 @@ fi
|
||||
|
||||
sh /etc/init.d/rc.sensors
|
||||
|
||||
# Check for flow sensor
|
||||
if px4flow start
|
||||
then
|
||||
fi
|
||||
|
||||
if ll40ls start
|
||||
then
|
||||
fi
|
||||
ver all
|
||||
|
||||
#
|
||||
# Run unit tests at board boot, reporting failure as needed.
|
||||
# Add new unit tests using the same pattern as below.
|
||||
#
|
||||
|
||||
echo
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "[mavlink_tests] STARTING TEST"
|
||||
if mavlink_tests
|
||||
then
|
||||
echo "[mavlink_tests] PASS"
|
||||
else
|
||||
set unit_test_failure 1
|
||||
set unit_test_failure_list "${unit_test_failure_list} mavlink_tests"
|
||||
echo "[mavlink_tests] FAILED"
|
||||
fi
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "[commander_tests] STARTING TEST"
|
||||
if commander_tests
|
||||
then
|
||||
echo "[commander_tests] PASS"
|
||||
else
|
||||
set unit_test_failure 1
|
||||
set unit_test_failure_list "${unit_test_failure_list} commander_tests"
|
||||
echo "[commander_tests] FAILED"
|
||||
fi
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "[controllib_test] STARTING TEST"
|
||||
if controllib_test
|
||||
then
|
||||
echo "[controllib_test] PASS"
|
||||
else
|
||||
set unit_test_failure 1
|
||||
set unit_test_failure_list "${unit_test_failure_list} controllib_tests"
|
||||
echo "[controllib_test] FAILED"
|
||||
fi
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "[uorb_tests] STARTING TEST"
|
||||
if uorb_tests
|
||||
then
|
||||
echo "[uorb_tests] PASS"
|
||||
else
|
||||
set unit_test_failure 1
|
||||
set unit_test_failure_list "${unit_test_failure_list} uorb_tests"
|
||||
echo "[uorb_tests] FAILED"
|
||||
fi
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
|
||||
if tests all
|
||||
then
|
||||
else
|
||||
set unit_test_failure 1
|
||||
set unit_test_failure_list "${unit_test_failure_list} system_tests"
|
||||
fi
|
||||
|
||||
if [ $unit_test_failure == 0 ]
|
||||
then
|
||||
echo
|
||||
echo "All Unit Tests PASSED"
|
||||
rgbled rgb 20 255 20
|
||||
else
|
||||
echo
|
||||
echo "Some Unit Tests FAILED:${unit_test_failure_list}"
|
||||
echo "Some Unit Tests FAILED"
|
||||
rgbled rgb 255 20 20
|
||||
fi
|
||||
|
||||
ver all
|
||||
|
||||
free
|
||||
|
||||
36
ROMFS/sitl/mixers/plane_sitl.main.mix
Normal file
36
ROMFS/sitl/mixers/plane_sitl.main.mix
Normal file
@ -0,0 +1,36 @@
|
||||
Mixer for SITL plane
|
||||
=========================================================
|
||||
|
||||
Z:
|
||||
|
||||
Z:
|
||||
|
||||
# mixer for the rudder
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for the flaps
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for the pusher/puller throttle
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
# mixer for the left aileron
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 -10000 -10000 0 -10000 10000
|
||||
|
||||
# mixer for the right aileron
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for the elevator
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 1 10000 10000 0 -10000 10000
|
||||
@ -1,24 +1,26 @@
|
||||
Mixer for standard vtol plane (SITL) with motor x configuration
|
||||
=========================================================
|
||||
|
||||
This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration.
|
||||
The plane has two ailerons and one elevator. The ailerons and elevator are treated as elevons
|
||||
in order to make the standard vtol simulation compatible with the tailsitter simulation.
|
||||
This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration. The plane has two ailerons and one elevator.
|
||||
|
||||
R: 4x 10000 10000 10000 0
|
||||
|
||||
# mixer for the elevons
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 5000 5000 0 -10000 10000
|
||||
S: 1 1 -5000 -5000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 5000 5000 0 -10000 10000
|
||||
S: 1 1 5000 5000 0 -10000 10000
|
||||
|
||||
# mixer for the pusher/puller throttle
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 3 0 20000 -10000 -10000 10000
|
||||
|
||||
# mixer for the left aileron
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for the right aileron
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 -10000 -10000 0 -10000 10000
|
||||
|
||||
# mixer for the elevator
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 1 10000 10000 0 -10000 10000
|
||||
18
ROMFS/tap_common/init.d/4001_quad_x
Normal file
18
ROMFS/tap_common/init.d/4001_quad_x
Normal file
@ -0,0 +1,18 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic Quadrotor X config
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER quad_x
|
||||
|
||||
set PWM_OUT 1234
|
||||
19
ROMFS/tap_common/init.d/6001_hexa_x
Normal file
19
ROMFS/tap_common/init.d/6001_hexa_x
Normal file
@ -0,0 +1,19 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic Hexarotor x geometry
|
||||
#
|
||||
# @type Hexarotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER hexa_x
|
||||
|
||||
# Need to set all 8 channels
|
||||
set PWM_OUT 12345678
|
||||
20
ROMFS/tap_common/init.d/rc.fw_apps
Normal file
20
ROMFS/tap_common/init.d/rc.fw_apps
Normal file
@ -0,0 +1,20 @@
|
||||
#!nsh
|
||||
#
|
||||
# Standard apps for fixed wing
|
||||
#
|
||||
|
||||
#
|
||||
# Start the attitude and position estimator
|
||||
#
|
||||
ekf2 start
|
||||
|
||||
#
|
||||
# Start attitude controller
|
||||
#
|
||||
fw_att_control start
|
||||
fw_pos_control_l1 start
|
||||
|
||||
#
|
||||
# Start Land Detector
|
||||
#
|
||||
land_detector start fixedwing
|
||||
28
ROMFS/tap_common/init.d/rc.fw_defaults
Normal file
28
ROMFS/tap_common/init.d/rc.fw_defaults
Normal file
@ -0,0 +1,28 @@
|
||||
#!nsh
|
||||
|
||||
set VEHICLE_TYPE fw
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
#
|
||||
# Default parameters for FW
|
||||
#
|
||||
param set RTL_RETURN_ALT 100
|
||||
param set RTL_DESCEND_ALT 100
|
||||
param set RTL_LAND_DELAY -1
|
||||
|
||||
param set NAV_ACC_RAD 50
|
||||
|
||||
param set PE_VELNE_NOISE 0.3
|
||||
param set PE_VELD_NOISE 0.35
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.0
|
||||
fi
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
set MIXER_AUX pass
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1500
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
83
ROMFS/tap_common/init.d/rc.interface
Normal file
83
ROMFS/tap_common/init.d/rc.interface
Normal file
@ -0,0 +1,83 @@
|
||||
#!nsh
|
||||
#
|
||||
# Script to configure control interface
|
||||
#
|
||||
|
||||
set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
|
||||
|
||||
if [ $MIXER != none -a $MIXER != skip ]
|
||||
then
|
||||
#
|
||||
# Load main mixer
|
||||
#
|
||||
|
||||
# Use the mixer file
|
||||
set MIXER_FILE /etc/mixers/$MIXER.main.mix
|
||||
|
||||
set OUTPUT_DEV /dev/pwm_output0
|
||||
|
||||
if [ $OUTPUT_MODE == uavcan_esc ]
|
||||
then
|
||||
set OUTPUT_DEV /dev/uavcan/esc
|
||||
fi
|
||||
|
||||
if mixer load $OUTPUT_DEV $MIXER_FILE
|
||||
then
|
||||
echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
|
||||
else
|
||||
echo "ERROR [init] Error loading mixer: $MIXER_FILE"
|
||||
echo "ERROR:[init] Could not load mixer: $MIXER_FILE" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
|
||||
unset MIXER_FILE
|
||||
else
|
||||
if [ $MIXER != skip ]
|
||||
then
|
||||
echo "ERROR [init] Mixer not defined"
|
||||
echo "ERROR [init] Mixer not defined" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == io ]
|
||||
then
|
||||
if [ $PWM_OUT != none ]
|
||||
then
|
||||
#
|
||||
# Set PWM output frequency
|
||||
#
|
||||
if [ $PWM_RATE != none ]
|
||||
then
|
||||
pwm rate -c $PWM_OUT -r $PWM_RATE
|
||||
fi
|
||||
|
||||
#
|
||||
# Set disarmed, min and max PWM values
|
||||
#
|
||||
if [ $PWM_DISARMED != none ]
|
||||
then
|
||||
pwm disarmed -c $PWM_OUT -p $PWM_DISARMED
|
||||
fi
|
||||
if [ $PWM_MIN != none ]
|
||||
then
|
||||
pwm min -c $PWM_OUT -p $PWM_MIN
|
||||
fi
|
||||
if [ $PWM_MAX != none ]
|
||||
then
|
||||
pwm max -c $PWM_OUT -p $PWM_MAX
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $FAILSAFE != none ]
|
||||
then
|
||||
pwm failsafe -d $OUTPUT_DEV $FAILSAFE
|
||||
fi
|
||||
fi
|
||||
|
||||
unset PWM_OUT
|
||||
unset PWM_RATE
|
||||
unset PWM_MIN
|
||||
unset PWM_MAX
|
||||
unset FAILSAFE
|
||||
unset OUTPUT_DEV
|
||||
17
ROMFS/tap_common/init.d/rc.mc_apps
Normal file
17
ROMFS/tap_common/init.d/rc.mc_apps
Normal file
@ -0,0 +1,17 @@
|
||||
#!nsh
|
||||
#
|
||||
# Standard apps for multirotors:
|
||||
# att & pos estimator, att & pos control.
|
||||
#
|
||||
|
||||
|
||||
ekf2 start
|
||||
|
||||
mc_att_control start
|
||||
|
||||
mc_pos_control start
|
||||
|
||||
#
|
||||
# Start Land Detector
|
||||
#
|
||||
land_detector start multicopter
|
||||
49
ROMFS/tap_common/init.d/rc.mc_defaults
Normal file
49
ROMFS/tap_common/init.d/rc.mc_defaults
Normal file
@ -0,0 +1,49 @@
|
||||
#!nsh
|
||||
|
||||
set VEHICLE_TYPE mc
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set PE_VELNE_NOISE 0.5
|
||||
param set PE_VELD_NOISE 0.35
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.25
|
||||
|
||||
param set NAV_ACC_RAD 2.0
|
||||
param set RTL_RETURN_ALT 30.0
|
||||
param set RTL_DESCEND_ALT 10.0
|
||||
param set PWM_DISARMED 900
|
||||
param set PWM_MIN 1075
|
||||
param set PWM_MAX 1950
|
||||
|
||||
param set RTL_LAND_DELAY 0
|
||||
fi
|
||||
|
||||
# set environment variables (!= parameters)
|
||||
set PWM_RATE 400
|
||||
# tell the mixer to use parameters for these instead
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
set MIXER_AUX pass
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1500
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1000
|
||||
then
|
||||
param set PWM_MIN 1075
|
||||
fi
|
||||
if param compare PWM_MAX 2000
|
||||
then
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
if param compare PWM_DISARMED 0
|
||||
then
|
||||
param set PWM_DISARMED 900
|
||||
fi
|
||||
46
ROMFS/tap_common/init.d/rc.sensors
Normal file
46
ROMFS/tap_common/init.d/rc.sensors
Normal file
@ -0,0 +1,46 @@
|
||||
#!nsh
|
||||
#
|
||||
# Standard startup script for TAP v1 onboard sensor drivers.
|
||||
#
|
||||
|
||||
if adc start
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lis3mdl -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus is rotated 90 deg yaw
|
||||
if hmc5883 -C -T -S -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
|
||||
if mpu6000 -R 2 -T 20608 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||
if mpu9250 -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
if meas_airspeed start
|
||||
then
|
||||
fi
|
||||
|
||||
if sf1xx start
|
||||
then
|
||||
fi
|
||||
|
||||
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
|
||||
usleep 20000
|
||||
if sensors start
|
||||
then
|
||||
fi
|
||||
24
ROMFS/tap_common/init.d/rc.vtol_apps
Normal file
24
ROMFS/tap_common/init.d/rc.vtol_apps
Normal file
@ -0,0 +1,24 @@
|
||||
#!nsh
|
||||
#
|
||||
# Standard apps for vtol:
|
||||
# att & pos estimator, att & pos control.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
# Estimator group selction
|
||||
#
|
||||
ekf2 start
|
||||
|
||||
vtol_att_control start
|
||||
mc_att_control start
|
||||
mc_pos_control start
|
||||
fw_att_control start
|
||||
fw_pos_control_l1 start
|
||||
|
||||
#
|
||||
# Start Land Detector
|
||||
# Multicopter for now until we have something for VTOL
|
||||
#
|
||||
land_detector start vtol
|
||||
49
ROMFS/tap_common/init.d/rc.vtol_defaults
Normal file
49
ROMFS/tap_common/init.d/rc.vtol_defaults
Normal file
@ -0,0 +1,49 @@
|
||||
#!nsh
|
||||
|
||||
set VEHICLE_TYPE vtol
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_YAW_P 4
|
||||
|
||||
param set PE_VELNE_NOISE 0.5
|
||||
param set PE_VELD_NOISE 0.3
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.25
|
||||
param set PE_ABIAS_PNOISE 0.0001
|
||||
|
||||
#
|
||||
# Default parameters for mission and position handling
|
||||
#
|
||||
param set NAV_ACC_RAD 3
|
||||
param set MPC_TKO_SPEED 1.0
|
||||
param set MPC_LAND_SPEED 0.7
|
||||
param set MPC_Z_VEL_MAX 1.5
|
||||
param set MPC_XY_VEL_MAX 4.0
|
||||
param set MIS_YAW_TMT 10
|
||||
param set MPC_ACC_HOR_MAX 2.0
|
||||
param set RTL_LAND_DELAY 0
|
||||
fi
|
||||
|
||||
# set environment variables (!= parameters)
|
||||
set PWM_RATE 400
|
||||
# tell the mixer to use parameters for these instead
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1000
|
||||
then
|
||||
param set PWM_MIN 1075
|
||||
fi
|
||||
if param compare PWM_MAX 2000
|
||||
then
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
if param compare PWM_DISARMED 0
|
||||
then
|
||||
param set PWM_DISARMED 900
|
||||
fi
|
||||
486
ROMFS/tap_common/init.d/rcS
Normal file
486
ROMFS/tap_common/init.d/rcS
Normal file
@ -0,0 +1,486 @@
|
||||
#!nsh
|
||||
#
|
||||
# PX4FMU startup script.
|
||||
#
|
||||
# NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS.
|
||||
#
|
||||
|
||||
#
|
||||
# Start CDC/ACM serial driver
|
||||
#
|
||||
sercon
|
||||
|
||||
#
|
||||
# Default to auto-start mode.
|
||||
#
|
||||
set MODE autostart
|
||||
|
||||
set TUNE_ERR ML<<CP4CP4CP4CP4CP4
|
||||
set LOG_FILE /fs/microsd/bootlog.txt
|
||||
|
||||
#
|
||||
# Try to mount the microSD card.
|
||||
#
|
||||
# REBOOTWORK this needs to start after the flight control loop
|
||||
if mount -t vfat /dev/mmcsd0 /fs/microsd
|
||||
then
|
||||
# Start playing the startup tune
|
||||
tone_alarm start
|
||||
else
|
||||
tone_alarm MBAGP
|
||||
if mkfatfs /dev/mmcsd0
|
||||
then
|
||||
if mount -t vfat /dev/mmcsd0 /fs/microsd
|
||||
then
|
||||
echo "INFO [init] MicroSD card formatted"
|
||||
else
|
||||
echo "ERROR [init] Format failed"
|
||||
tone_alarm MNBG
|
||||
set LOG_FILE /dev/null
|
||||
fi
|
||||
else
|
||||
set LOG_FILE /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Look for an init script on the microSD card.
|
||||
# Disable autostart if the script found.
|
||||
#
|
||||
set FRC /fs/microsd/etc/rc.txt
|
||||
if [ -f $FRC ]
|
||||
then
|
||||
echo "INFO [init] Executing script: $FRC"
|
||||
sh $FRC
|
||||
set MODE custom
|
||||
fi
|
||||
unset FRC
|
||||
|
||||
if [ $MODE == autostart ]
|
||||
then
|
||||
|
||||
#
|
||||
# Start the ORB (first app to start)
|
||||
#
|
||||
uorb start
|
||||
|
||||
#
|
||||
# Load parameters
|
||||
#
|
||||
set PARAM_FILE /fs/microsd/params
|
||||
if mtd start
|
||||
then
|
||||
set PARAM_FILE /fs/mtd_params
|
||||
fi
|
||||
|
||||
param select $PARAM_FILE
|
||||
if param load
|
||||
then
|
||||
else
|
||||
if param reset
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Start system state indicator
|
||||
#
|
||||
if rgbled start
|
||||
then
|
||||
fi
|
||||
|
||||
#
|
||||
# Set AUTOCNF flag to use it in AUTOSTART scripts
|
||||
#
|
||||
if param compare SYS_AUTOCONFIG 1
|
||||
then
|
||||
# Wipe out params except RC*
|
||||
param reset_nostart RC*
|
||||
set AUTOCNF yes
|
||||
else
|
||||
set AUTOCNF no
|
||||
fi
|
||||
|
||||
#
|
||||
# Set default values
|
||||
#
|
||||
set VEHICLE_TYPE none
|
||||
set MIXER none
|
||||
set OUTPUT_MODE none
|
||||
set PWM_OUT none
|
||||
set PWM_RATE none
|
||||
set PWM_DISARMED none
|
||||
set PWM_MIN none
|
||||
set PWM_MAX none
|
||||
set FMU_MODE pwm
|
||||
set MAVLINK_F default
|
||||
set EXIT_ON_END no
|
||||
set MAV_TYPE none
|
||||
set FAILSAFE none
|
||||
set USE_IO no
|
||||
|
||||
|
||||
#
|
||||
# Set parameters and env variables for selected AUTOSTART
|
||||
#
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
echo "INFO [init] No autostart"
|
||||
else
|
||||
sh /etc/init.d/rc.autostart
|
||||
fi
|
||||
unset MODE
|
||||
|
||||
#
|
||||
# If autoconfig parameter was set, reset it and save parameters
|
||||
#
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set SYS_AUTOCONFIG 0
|
||||
param save
|
||||
fi
|
||||
unset AUTOCNF
|
||||
|
||||
#
|
||||
# Set default output if not set
|
||||
#
|
||||
if [ $OUTPUT_MODE == none ]
|
||||
then
|
||||
if [ $USE_IO == yes ]
|
||||
then
|
||||
set OUTPUT_MODE io
|
||||
else
|
||||
set OUTPUT_MODE fmu
|
||||
fi
|
||||
fi
|
||||
|
||||
gps start -d /dev/ttyS0
|
||||
|
||||
# waypoint storage
|
||||
# REBOOTWORK this needs to start in parallel
|
||||
if dataman start
|
||||
then
|
||||
fi
|
||||
|
||||
#
|
||||
# Sensors System (start before Commander so Preflight checks are properly run)
|
||||
#
|
||||
sh /etc/init.d/rc.sensors
|
||||
|
||||
commander start
|
||||
|
||||
#
|
||||
# Start CPU load monitor
|
||||
#
|
||||
load_mon start
|
||||
|
||||
#
|
||||
# Start primary output
|
||||
#
|
||||
set TTYS1_BUSY no
|
||||
|
||||
#
|
||||
# Check if UAVCAN is enabled, default to it for ESCs
|
||||
#
|
||||
if param greater UAVCAN_ENABLE 2
|
||||
then
|
||||
set OUTPUT_MODE uavcan_esc
|
||||
fi
|
||||
|
||||
# If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output
|
||||
if [ $OUTPUT_MODE != none ]
|
||||
then
|
||||
if [ $OUTPUT_MODE == uavcan_esc ]
|
||||
then
|
||||
if param compare UAVCAN_ENABLE 0
|
||||
then
|
||||
echo "INFO [init] OVERRIDING UAVCAN_ENABLE = 1" >> $LOG_FILE
|
||||
param set UAVCAN_ENABLE 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $OUTPUT_MODE == fmu ]
|
||||
then
|
||||
if fmu mode_$FMU_MODE
|
||||
then
|
||||
else
|
||||
echo "ERR [init] FMU start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
if fmu mode_pwm4
|
||||
then
|
||||
else
|
||||
echo "ERROR [init] FMU mode_$FMU_MODE start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
mavlink start -r 1200 -d /dev/ttyS1
|
||||
|
||||
#
|
||||
# Starting stuff according to UAVCAN_ENABLE value
|
||||
#
|
||||
if param greater UAVCAN_ENABLE 0
|
||||
then
|
||||
if uavcan start
|
||||
then
|
||||
else
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
if param greater UAVCAN_ENABLE 1
|
||||
then
|
||||
if uavcan start fw
|
||||
then
|
||||
else
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Optional drivers
|
||||
#
|
||||
|
||||
# Sensors on the PWM interface bank
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
then
|
||||
if pwm_input start
|
||||
then
|
||||
if ll40ls start pwm
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# sf0x lidar sensor
|
||||
if param compare SENS_EN_SF0X 1
|
||||
then
|
||||
sf0x start
|
||||
fi
|
||||
|
||||
# Start USB shell if no microSD present, MAVLink else
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# Try to get an USB console
|
||||
nshterm /dev/ttyACM0 &
|
||||
else
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
fi
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
if param compare SYS_LOGGER 0
|
||||
then
|
||||
if sdlog2 start -r 100 -a -b 9 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
if logger start -b 12 -t
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Fixed wing setup
|
||||
#
|
||||
if [ $VEHICLE_TYPE == fw ]
|
||||
then
|
||||
echo "INFO [init] Fixedwing"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
# Set default mixer for fixed wing if not defined
|
||||
set MIXER AERT
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
# Use MAV_TYPE = 1 (fixed wing) if not defined
|
||||
set MAV_TYPE 1
|
||||
fi
|
||||
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
|
||||
# Load mixer and configure outputs
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard fixedwing apps
|
||||
sh /etc/init.d/rc.fw_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# Multicopters setup
|
||||
#
|
||||
if [ $VEHICLE_TYPE == mc ]
|
||||
then
|
||||
echo "INFO [init] Multicopter"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
echo "INFO [init] Mixer undefined"
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
# Use mixer to detect vehicle type
|
||||
if [ $MIXER == quad_x -o $MIXER == quad_+ ]
|
||||
then
|
||||
set MAV_TYPE 2
|
||||
fi
|
||||
if [ $MIXER == quad_w ]
|
||||
then
|
||||
set MAV_TYPE 2
|
||||
fi
|
||||
if [ $MIXER == quad_h ]
|
||||
then
|
||||
set MAV_TYPE 2
|
||||
fi
|
||||
if [ $MIXER == tri_y_yaw- -o $MIXER == tri_y_yaw+ ]
|
||||
then
|
||||
set MAV_TYPE 15
|
||||
fi
|
||||
if [ $MIXER == hexa_x -o $MIXER == hexa_+ ]
|
||||
then
|
||||
set MAV_TYPE 13
|
||||
fi
|
||||
if [ $MIXER == hexa_cox ]
|
||||
then
|
||||
set MAV_TYPE 13
|
||||
fi
|
||||
if [ $MIXER == octo_x -o $MIXER == octo_+ ]
|
||||
then
|
||||
set MAV_TYPE 14
|
||||
fi
|
||||
fi
|
||||
|
||||
# Still no MAV_TYPE found
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
echo "WARN [init] Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 2
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
fi
|
||||
|
||||
# Load mixer and configure outputs
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard multicopter apps
|
||||
sh /etc/init.d/rc.mc_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# VTOL setup
|
||||
#
|
||||
if [ $VEHICLE_TYPE == vtol ]
|
||||
then
|
||||
echo "INFO [init] VTOL"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
echo "WARN [init] VTOL mixer undefined"
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
# Use mixer to detect vehicle type
|
||||
if [ $MIXER == caipirinha_vtol ]
|
||||
then
|
||||
set MAV_TYPE 19
|
||||
fi
|
||||
if [ $MIXER == firefly6 ]
|
||||
then
|
||||
set MAV_TYPE 21
|
||||
fi
|
||||
if [ $MIXER == quad_x_pusher_vtol ]
|
||||
then
|
||||
set MAV_TYPE 22
|
||||
fi
|
||||
fi
|
||||
|
||||
# Still no MAV_TYPE found
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
echo "WARN [init] Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 19
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
fi
|
||||
|
||||
# Load mixer and configure outputs
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard vtol apps
|
||||
sh /etc/init.d/rc.vtol_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# Rover setup
|
||||
#
|
||||
if [ $VEHICLE_TYPE == rover ]
|
||||
then
|
||||
# 10 is MAV_TYPE_GROUND_ROVER
|
||||
set MAV_TYPE 10
|
||||
|
||||
# Load mixer and configure outputs
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Start standard rover apps
|
||||
sh /etc/init.d/rc.axialracing_ax10_apps
|
||||
|
||||
param set MAV_TYPE 10
|
||||
fi
|
||||
|
||||
unset MIXER
|
||||
unset MAV_TYPE
|
||||
unset OUTPUT_MODE
|
||||
|
||||
#
|
||||
# Start the navigator
|
||||
#
|
||||
navigator start
|
||||
|
||||
#
|
||||
# Generic setup (autostart ID not found)
|
||||
#
|
||||
if [ $VEHICLE_TYPE == none ]
|
||||
then
|
||||
echo "WARN [init] No autostart ID found"
|
||||
fi
|
||||
|
||||
# Start any custom addons
|
||||
set FEXTRAS /fs/microsd/etc/extras.txt
|
||||
if [ -f $FEXTRAS ]
|
||||
then
|
||||
echo "INFO [init] Addons script: $FEXTRAS"
|
||||
sh $FEXTRAS
|
||||
fi
|
||||
unset FEXTRAS
|
||||
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
fi
|
||||
|
||||
# End of autostart
|
||||
fi
|
||||
|
||||
# There is no further script processing, so we can free some RAM
|
||||
# XXX potentially unset all script variables.
|
||||
unset TUNE_ERR
|
||||
|
||||
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running
|
||||
mavlink boot_complete
|
||||
|
||||
if [ $EXIT_ON_END == yes ]
|
||||
then
|
||||
echo "INFO [init] NSH exit"
|
||||
exit
|
||||
fi
|
||||
unset EXIT_ON_END
|
||||
105
ROMFS/tap_common/mixers/README.md
Normal file
105
ROMFS/tap_common/mixers/README.md
Normal file
@ -0,0 +1,105 @@
|
||||
## PX4 mixer definitions ##
|
||||
|
||||
Files in this directory implement example mixers that can be used as a basis
|
||||
for customisation, or for general testing purposes.
|
||||
|
||||
For a detailed description of the mixing architecture and examples see:
|
||||
http://px4.io/dev/mixing
|
||||
|
||||
### Syntax ###
|
||||
|
||||
Mixer definitions are text files; lines beginning with a single capital letter
|
||||
followed by a colon are significant. All other lines are ignored, meaning that
|
||||
explanatory text can be freely mixed with the definitions.
|
||||
|
||||
Each file may define more than one mixer; the allocation of mixers to actuators
|
||||
is specific to the device reading the mixer definition, and the number of
|
||||
actuator outputs generated by a mixer is specific to the mixer.
|
||||
|
||||
For example: each simple or null mixer is assigned to outputs 1 to x
|
||||
in the order they appear in the mixer file.
|
||||
|
||||
A mixer begins with a line of the form
|
||||
|
||||
<tag>: <mixer arguments>
|
||||
|
||||
The tag selects the mixer type; 'M' for a simple summing mixer, 'R' for a
|
||||
multirotor mixer, etc.
|
||||
|
||||
#### Null Mixer ####
|
||||
|
||||
A null mixer consumes no controls and generates a single actuator output whose
|
||||
value is always zero. Typically a null mixer is used as a placeholder in a
|
||||
collection of mixers in order to achieve a specific pattern of actuator outputs.
|
||||
|
||||
The null mixer definition has the form:
|
||||
|
||||
Z:
|
||||
|
||||
#### Simple Mixer ####
|
||||
|
||||
A simple mixer combines zero or more control inputs into a single actuator
|
||||
output. Inputs are scaled, and the mixing function sums the result before
|
||||
applying an output scaler.
|
||||
|
||||
A simple mixer definition begins with:
|
||||
|
||||
M: <control count>
|
||||
O: <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
|
||||
|
||||
If <control count> is zero, the sum is effectively zero and the mixer will
|
||||
output a fixed value that is <offset> constrained by <lower limit> and <upper
|
||||
limit>.
|
||||
|
||||
The second line defines the output scaler with scaler parameters as discussed
|
||||
above. Whilst the calculations are performed as floating-point operations, the
|
||||
values stored in the definition file are scaled by a factor of 10000; i.e. an
|
||||
offset of -0.5 is encoded as -5000.
|
||||
|
||||
The definition continues with <control count> entries describing the control
|
||||
inputs and their scaling, in the form:
|
||||
|
||||
S: <group> <index> <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
|
||||
|
||||
The <group> value identifies the control group from which the scaler will read,
|
||||
and the <index> value an offset within that group. These values are specific to
|
||||
the device reading the mixer definition.
|
||||
|
||||
When used to mix vehicle controls, mixer group zero is the vehicle attitude
|
||||
control group, and index values zero through three are normally roll, pitch,
|
||||
yaw and thrust respectively.
|
||||
|
||||
The remaining fields on the line configure the control scaler with parameters as
|
||||
discussed above. Whilst the calculations are performed as floating-point
|
||||
operations, the values stored in the definition file are scaled by a factor of
|
||||
10000; i.e. an offset of -0.5 is encoded as -5000.
|
||||
|
||||
#### Multirotor Mixer ####
|
||||
|
||||
The multirotor mixer combines four control inputs (roll, pitch, yaw, thrust)
|
||||
into a set of actuator outputs intended to drive motor speed controllers.
|
||||
|
||||
The mixer definition is a single line of the form:
|
||||
|
||||
R: <geometry> <roll scale> <pitch scale> <yaw scale> <deadband>
|
||||
|
||||
The supported geometries include:
|
||||
|
||||
* 4x - quadrotor in X configuration
|
||||
* 4+ - quadrotor in + configuration
|
||||
* 6x - hexcopter in X configuration
|
||||
* 6+ - hexcopter in + configuration
|
||||
* 8x - octocopter in X configuration
|
||||
* 8+ - octocopter in + configuration
|
||||
|
||||
Each of the roll, pitch and yaw scale values determine scaling of the roll,
|
||||
pitch and yaw controls relative to the thrust control. Whilst the calculations
|
||||
are performed as floating-point operations, the values stored in the definition
|
||||
file are scaled by a factor of 10000; i.e. an factor of 0.5 is encoded as 5000.
|
||||
|
||||
Roll, pitch and yaw inputs are expected to range from -1.0 to 1.0, whilst the
|
||||
thrust input ranges from 0.0 to 1.0. Output for each actuator is in the
|
||||
range -1.0 to 1.0.
|
||||
|
||||
In the case where an actuator saturates, all actuator values are rescaled so that
|
||||
the saturating actuator is limited to 1.0.
|
||||
3
ROMFS/tap_common/mixers/hexa_x.main.mix
Normal file
3
ROMFS/tap_common/mixers/hexa_x.main.mix
Normal file
@ -0,0 +1,3 @@
|
||||
# Hexa X
|
||||
|
||||
R: 6x 10000 10000 10000 0
|
||||
7
ROMFS/tap_common/mixers/quad_x.main.mix
Normal file
7
ROMFS/tap_common/mixers/quad_x.main.mix
Normal file
@ -0,0 +1,7 @@
|
||||
R: 4x 10000 10000 10000 0
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 6 10000 10000 0 -10000 10000
|
||||
@ -1,9 +0,0 @@
|
||||
QGC WPL 110
|
||||
0 1 0 16 0 0 0 0 47.3979949951 8.54559612274 25.0 1
|
||||
1 0 2 3000 4.0 0.0 0.0 0.0 47.3980331421 8.54578971863 25.0 1
|
||||
2 0 3 16 0.0 0.0 -0.0 0.0 47.399269104 8.54557228088 25.0 1
|
||||
3 0 3 16 0.0 0.0 -0.0 0.0 47.3992652893 8.54230213165 25.0 1
|
||||
4 0 3 16 0.0 0.0 -0.0 0.0 47.3974761963 8.54239082336 25.0 1
|
||||
5 0 3 16 0.0 0.0 -0.0 0.0 47.3976669312 8.54509449005 25.0 1
|
||||
6 0 2 3000 3.0 0.0 0.0 0.0 47.3977851868 8.54526233673 25.0 1
|
||||
7 0 3 21 25.0 0.0 -0.0 0.0 47.3979797363 8.54460906982 25.0 1
|
||||
@ -1,6 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
ip=192.168.42.1
|
||||
if [ -z ${BEBOP_IP+x} ]; then
|
||||
ip=192.168.42.1
|
||||
echo "\$BEBOP_IP is not set (use default: $ip)"
|
||||
else
|
||||
ip=$BEBOP_IP
|
||||
echo "\$BEBOP_IP is set to $ip"
|
||||
fi
|
||||
port=9050
|
||||
|
||||
echo "Connecting to bebop: $ip:$port"
|
||||
@ -25,6 +31,7 @@ echo "Connection successfully established"
|
||||
sleep 1
|
||||
|
||||
adb shell mount -o remount,rw /
|
||||
adb shell touch /home/root/parameters
|
||||
|
||||
../Tools/adb_upload.sh $@
|
||||
|
||||
|
||||
@ -9,6 +9,13 @@ then
|
||||
${DIR}/fix_code_style.sh --dry-run $file | grep --quiet Formatted
|
||||
if [[ $? -eq 0 ]]
|
||||
then
|
||||
${DIR}/fix_code_style.sh --quiet < $file > $file.pretty
|
||||
|
||||
echo
|
||||
git --no-pager diff --no-index --minimal --histogram --color=always $file $file.pretty
|
||||
echo
|
||||
|
||||
rm -f $file.pretty
|
||||
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -23,6 +23,7 @@ find \
|
||||
src/modules/controllib_test \
|
||||
src/modules/dataman \
|
||||
src/modules/fw_att_control \
|
||||
src/modules/fw_pos_control_l1 \
|
||||
src/modules/gpio_led \
|
||||
src/modules/land_detector \
|
||||
src/modules/local_position_estimator \
|
||||
@ -31,6 +32,7 @@ find \
|
||||
src/modules/muorb \
|
||||
src/modules/param \
|
||||
src/modules/px4iofirmware \
|
||||
src/modules/replay \
|
||||
src/modules/segway \
|
||||
src/modules/sensors \
|
||||
src/modules/simulator \
|
||||
|
||||
@ -43,10 +43,10 @@ import subprocess
|
||||
# If the following lines were pasted into the shell after running decode_backtrace.py
|
||||
#
|
||||
# INFO Backtrace: 10
|
||||
# INFO ./mainapp(px4_backtrace+0x27) [0x42b212]
|
||||
# INFO ./mainapp() [0x42d608]
|
||||
# INFO ./mainapp() [0x42d57e]
|
||||
# INFO ./mainapp() [0x4ba48d]
|
||||
# INFO ./px4(px4_backtrace+0x27) [0x42b212]
|
||||
# INFO ./px4() [0x42d608]
|
||||
# INFO ./px4() [0x42d57e]
|
||||
# INFO ./px4() [0x4ba48d]
|
||||
#
|
||||
# The output would be:
|
||||
#
|
||||
@ -63,7 +63,7 @@ def usage():
|
||||
msg = """
|
||||
Usage: Tools/decode_backtrace.py <builddir>
|
||||
|
||||
This will load the symbols for <builddir>/src/firmware/posix/mainapp
|
||||
This will load the symbols for <builddir>/src/firmware/posix/px4
|
||||
The user just needs to copy and paste the backtrace into the terminal
|
||||
where decode_backtrace.py is running.
|
||||
|
||||
@ -75,7 +75,7 @@ func = []
|
||||
|
||||
# Load the symbols from the binary
|
||||
def load_symbol_map():
|
||||
output = subprocess.check_output(["nm", "-p", "-C", os.sys.argv[1]+"/src/firmware/posix/mainapp"])
|
||||
output = subprocess.check_output(["nm", "-p", "-C", os.sys.argv[1]+"/src/firmware/posix/px4"])
|
||||
data = output.split("\n")
|
||||
data.sort()
|
||||
|
||||
|
||||
@ -115,7 +115,6 @@ print("""
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifndef PRIu64
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 39cee41574520c4151e318925c6982f3269b790e
|
||||
Subproject commit a5b0f1f0896c9372c62222e88117c6ced2c6282b
|
||||
206
Tools/mavlink_shell.py
Executable file
206
Tools/mavlink_shell.py
Executable file
@ -0,0 +1,206 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Open a shell over MAVLink.
|
||||
|
||||
@author: Beat Kueng (beat-kueng@gmx.net)
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
import sys, select
|
||||
import termios
|
||||
|
||||
try:
|
||||
from pymavlink import mavutil
|
||||
import serial
|
||||
except:
|
||||
print("Failed to import pymavlink.")
|
||||
print("You may need to install it with 'pip install pymavlink pyserial'")
|
||||
exit(-1)
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
||||
class MavlinkSerialPort():
|
||||
'''an object that looks like a serial port, but
|
||||
transmits using mavlink SERIAL_CONTROL packets'''
|
||||
def __init__(self, portname, baudrate, devnum=0, debug=0):
|
||||
self.baudrate = 0
|
||||
self._debug = debug
|
||||
self.buf = ''
|
||||
self.port = devnum
|
||||
self.debug("Connecting with MAVLink to %s ..." % portname)
|
||||
self.mav = mavutil.mavlink_connection(portname, autoreconnect=True, baud=baudrate)
|
||||
self.mav.wait_heartbeat()
|
||||
self.debug("HEARTBEAT OK\n")
|
||||
self.debug("Locked serial device\n")
|
||||
|
||||
def debug(self, s, level=1):
|
||||
'''write some debug text'''
|
||||
if self._debug >= level:
|
||||
print(s)
|
||||
|
||||
def write(self, b):
|
||||
'''write some bytes'''
|
||||
self.debug("sending '%s' (0x%02x) of len %u\n" % (b, ord(b[0]), len(b)), 2)
|
||||
while len(b) > 0:
|
||||
n = len(b)
|
||||
if n > 70:
|
||||
n = 70
|
||||
buf = [ord(x) for x in b[:n]]
|
||||
buf.extend([0]*(70-len(buf)))
|
||||
self.mav.mav.serial_control_send(self.port,
|
||||
mavutil.mavlink.SERIAL_CONTROL_FLAG_EXCLUSIVE |
|
||||
mavutil.mavlink.SERIAL_CONTROL_FLAG_RESPOND,
|
||||
0,
|
||||
0,
|
||||
n,
|
||||
buf)
|
||||
b = b[n:]
|
||||
|
||||
def close(self):
|
||||
self.mav.mav.serial_control_send(self.port, 0, 0, 0, 0, [0]*70)
|
||||
|
||||
def _recv(self):
|
||||
'''read some bytes into self.buf'''
|
||||
m = self.mav.recv_match(condition='SERIAL_CONTROL.count!=0',
|
||||
type='SERIAL_CONTROL', blocking=True,
|
||||
timeout=0.03)
|
||||
if m is not None:
|
||||
if self._debug > 2:
|
||||
print(m)
|
||||
data = m.data[:m.count]
|
||||
self.buf += ''.join(str(chr(x)) for x in data)
|
||||
|
||||
def read(self, n):
|
||||
'''read some bytes'''
|
||||
if len(self.buf) == 0:
|
||||
self._recv()
|
||||
if len(self.buf) > 0:
|
||||
if n > len(self.buf):
|
||||
n = len(self.buf)
|
||||
ret = self.buf[:n]
|
||||
self.buf = self.buf[n:]
|
||||
if self._debug >= 2:
|
||||
for b in ret:
|
||||
self.debug("read 0x%x" % ord(b), 2)
|
||||
return ret
|
||||
return ''
|
||||
|
||||
|
||||
def main():
|
||||
parser = ArgumentParser(description=__doc__)
|
||||
parser.add_argument('port', metavar='PORT', nargs='?', default = None,
|
||||
help='Mavlink port name: serial: DEVICE[,BAUD], udp: IP:PORT, tcp: tcp:IP:PORT. Eg: \
|
||||
/dev/ttyUSB0 or 0.0.0.0:14550. Auto-detect serial if not given.')
|
||||
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int,
|
||||
help="Mavlink port baud rate (default=115200)", default=115200)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
if args.port == None:
|
||||
serial_list = mavutil.auto_detect_serial(preferred_list=['*FTDI*',
|
||||
"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])
|
||||
|
||||
if len(serial_list) == 0:
|
||||
print("Error: no serial connection found")
|
||||
return
|
||||
|
||||
if len(serial_list) > 1:
|
||||
print('Auto-detected serial ports are:')
|
||||
for port in serial_list:
|
||||
print(" {:}".format(port))
|
||||
print('Using port {:}'.format(serial_list[0]))
|
||||
args.port = serial_list[0].device
|
||||
|
||||
|
||||
print("Connecting to MAVLINK...")
|
||||
mav_serialport = MavlinkSerialPort(args.port, args.baudrate, devnum=10)
|
||||
|
||||
mav_serialport.write('\n') # make sure the shell is started
|
||||
|
||||
# setup the console, so we can read one char at a time
|
||||
fd_in = sys.stdin.fileno()
|
||||
old_attr = termios.tcgetattr(fd_in)
|
||||
new_attr = termios.tcgetattr(fd_in)
|
||||
new_attr[3] = new_attr[3] & ~termios.ECHO # lflags
|
||||
new_attr[3] = new_attr[3] & ~termios.ICANON
|
||||
|
||||
try:
|
||||
termios.tcsetattr(fd_in, termios.TCSANOW, new_attr)
|
||||
cur_line = ''
|
||||
command_history = []
|
||||
cur_history_index = 0
|
||||
|
||||
def erase_last_n_chars(N):
|
||||
if N == 0: return
|
||||
CURSOR_BACK_N = '\x1b['+str(N)+'D'
|
||||
ERASE_END_LINE = '\x1b[K'
|
||||
sys.stdout.write(CURSOR_BACK_N + ERASE_END_LINE)
|
||||
|
||||
while True:
|
||||
while True:
|
||||
i, o, e = select.select([sys.stdin], [], [], 0)
|
||||
if not i: break
|
||||
ch = sys.stdin.read(1)
|
||||
|
||||
# provide a simple shell with command history
|
||||
if ch == '\n':
|
||||
if len(cur_line) > 0:
|
||||
# erase current text (mavlink shell will echo it as well)
|
||||
erase_last_n_chars(len(cur_line))
|
||||
|
||||
# add to history
|
||||
if len(command_history) == 0 or command_history[-1] != cur_line:
|
||||
command_history.append(cur_line)
|
||||
if len(command_history) > 50:
|
||||
del command_history[0]
|
||||
cur_history_index = len(command_history)
|
||||
mav_serialport.write(cur_line+'\n')
|
||||
cur_line = ''
|
||||
elif ord(ch) == 127: # backslash
|
||||
if len(cur_line) > 0:
|
||||
erase_last_n_chars(1)
|
||||
cur_line = cur_line[:-1]
|
||||
sys.stdout.write(ch)
|
||||
elif ord(ch) == 033:
|
||||
ch = sys.stdin.read(1) # skip one
|
||||
ch = sys.stdin.read(1)
|
||||
if ch == 'A': # arrow up
|
||||
if cur_history_index > 0:
|
||||
cur_history_index -= 1
|
||||
elif ch == 'B': # arrow down
|
||||
if cur_history_index < len(command_history):
|
||||
cur_history_index += 1
|
||||
# TODO: else: support line editing
|
||||
|
||||
erase_last_n_chars(len(cur_line))
|
||||
if cur_history_index == len(command_history):
|
||||
cur_line = ''
|
||||
else:
|
||||
cur_line = command_history[cur_history_index]
|
||||
sys.stdout.write(cur_line)
|
||||
|
||||
elif ord(ch) > 3:
|
||||
cur_line += ch
|
||||
sys.stdout.write(ch)
|
||||
sys.stdout.flush()
|
||||
|
||||
data = mav_serialport.read(4096)
|
||||
if data and len(data) > 0:
|
||||
sys.stdout.write(data)
|
||||
sys.stdout.flush()
|
||||
|
||||
except serial.serialutil.SerialException as e:
|
||||
print(e)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
mav_serialport.close()
|
||||
|
||||
finally:
|
||||
termios.tcsetattr(fd_in, termios.TCSADRAIN, old_attr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@ -69,6 +69,8 @@ class XMLOutput():
|
||||
xml_group.attrib["image"] = "VTOLTiltRotor"
|
||||
elif (group.GetName() == "Coaxial Helicopter"):
|
||||
xml_group.attrib["image"] = "HelicopterCoaxial"
|
||||
elif (group.GetName() == "Helicopter"):
|
||||
xml_group.attrib["image"] = "Helicopter"
|
||||
elif (group.GetName() == "Hexarotor Coaxial"):
|
||||
xml_group.attrib["image"] = "Y6A"
|
||||
elif (group.GetName() == "Y6B"):
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import sys
|
||||
import re
|
||||
import math
|
||||
|
||||
global default_var
|
||||
default_var = {}
|
||||
|
||||
@ -39,7 +41,7 @@ class Parameter(object):
|
||||
|
||||
# Define sorting order of the fields
|
||||
priority = {
|
||||
"board": 9,
|
||||
"board": 9,
|
||||
"short_desc": 8,
|
||||
"long_desc": 7,
|
||||
"min": 5,
|
||||
@ -52,6 +54,7 @@ class Parameter(object):
|
||||
def __init__(self, name, type, default = ""):
|
||||
self.fields = {}
|
||||
self.values = {}
|
||||
self.bitmask = {}
|
||||
self.name = name
|
||||
self.type = type
|
||||
self.default = default
|
||||
@ -77,6 +80,12 @@ class Parameter(object):
|
||||
"""
|
||||
self.values[code] = value
|
||||
|
||||
def SetBitmaskBit(self, index, bit):
|
||||
"""
|
||||
Set named enum value
|
||||
"""
|
||||
self.bitmask[index] = bit
|
||||
|
||||
def GetFieldCodes(self):
|
||||
"""
|
||||
Return list of existing field codes in convenient order
|
||||
@ -115,6 +124,24 @@ class Parameter(object):
|
||||
return ""
|
||||
return fv
|
||||
|
||||
def GetBitmaskList(self):
|
||||
"""
|
||||
Return list of existing bitmask codes in convenient order
|
||||
"""
|
||||
keys = self.bitmask.keys()
|
||||
keys.sort(key=float)
|
||||
return keys
|
||||
|
||||
def GetBitmaskBit(self, index):
|
||||
"""
|
||||
Return value of the given bitmask code or None if not found.
|
||||
"""
|
||||
fv = self.bitmask.get(index)
|
||||
if not fv:
|
||||
# required because python 3 sorted does not accept None
|
||||
return ""
|
||||
return fv
|
||||
|
||||
class SourceParser(object):
|
||||
"""
|
||||
Parses provided data and stores all found parameters internally.
|
||||
@ -133,7 +160,7 @@ class SourceParser(object):
|
||||
re_remove_dots = re.compile(r'\.+$')
|
||||
re_remove_carriage_return = re.compile('\n+')
|
||||
|
||||
valid_tags = set(["group", "board", "min", "max", "unit", "decimal", "increment", "reboot_required", "value", "boolean"])
|
||||
valid_tags = set(["group", "board", "min", "max", "unit", "decimal", "increment", "reboot_required", "value", "boolean", "bit"])
|
||||
|
||||
# Order of parameter groups
|
||||
priority = {
|
||||
@ -164,6 +191,7 @@ class SourceParser(object):
|
||||
long_desc = None
|
||||
tags = {}
|
||||
def_values = {}
|
||||
def_bitmask = {}
|
||||
elif state is not None and state != "comment-processed":
|
||||
m = self.re_comment_end.search(line)
|
||||
if m:
|
||||
@ -187,6 +215,10 @@ class SourceParser(object):
|
||||
# Take the meta info string and split the code and description
|
||||
metainfo = desc.split(" ", 1)
|
||||
def_values[metainfo[0]] = metainfo[1]
|
||||
elif (tag == "bit"):
|
||||
# Take the meta info string and split the code and description
|
||||
metainfo = desc.split(" ", 1)
|
||||
def_bitmask[metainfo[0]] = metainfo[1]
|
||||
else:
|
||||
tags[tag] = desc
|
||||
current_tag = tag
|
||||
@ -262,6 +294,8 @@ class SourceParser(object):
|
||||
param.SetField(tag, tags[tag])
|
||||
for def_value in def_values:
|
||||
param.SetEnumValue(def_value, def_values[def_value])
|
||||
for def_bit in def_bitmask:
|
||||
param.SetBitmaskBit(def_bit, def_bitmask[def_bit])
|
||||
# Store the parameter
|
||||
if group not in self.param_groups:
|
||||
self.param_groups[group] = ParameterGroup(group)
|
||||
@ -324,6 +358,16 @@ class SourceParser(object):
|
||||
if param.GetEnumValue(code) == "":
|
||||
sys.stderr.write("Description for enum value is empty: {0} {1}\n".format(name, code))
|
||||
return False
|
||||
for index in param.GetBitmaskList():
|
||||
if not self.IsNumber(index):
|
||||
sys.stderr.write("bit value not number: {0} {1}\n".format(name, index))
|
||||
return False
|
||||
if not int(min) <= math.pow(2, int(index)) <= int(max):
|
||||
sys.stderr.write("Bitmask bit must be between {0} and {1}: {2} {3}\n".format(min, max, name, math.pow(2, int(index))))
|
||||
return False
|
||||
if param.GetBitmaskBit(index) == "":
|
||||
sys.stderr.write("Description for bitmask bit is empty: {0} {1}\n".format(name, index))
|
||||
return False
|
||||
return True
|
||||
|
||||
def GetParamGroups(self):
|
||||
|
||||
@ -63,6 +63,14 @@ class XMLOutput():
|
||||
xml_value = ET.SubElement(xml_values, "value")
|
||||
xml_value.attrib["code"] = code;
|
||||
xml_value.text = param.GetEnumValue(code)
|
||||
|
||||
if len(param.GetBitmaskList()) > 0:
|
||||
xml_values = ET.SubElement(xml_param, "bitmask")
|
||||
for index in param.GetBitmaskList():
|
||||
xml_value = ET.SubElement(xml_values, "bit")
|
||||
xml_value.attrib["index"] = index;
|
||||
xml_value.text = param.GetBitmaskBit(index)
|
||||
|
||||
indent(xml_parameters)
|
||||
self.xml_document = ET.ElementTree(xml_parameters)
|
||||
|
||||
|
||||
@ -68,6 +68,11 @@ def main():
|
||||
os.remove(file_path)
|
||||
continue
|
||||
|
||||
# delete documentation
|
||||
if file.startswith("README"):
|
||||
os.remove(file_path)
|
||||
continue
|
||||
|
||||
# only prune text files
|
||||
if ".zip" in file or ".bin" in file or ".swp" in file \
|
||||
or ".data" in file or ".DS_Store" in file:
|
||||
|
||||
@ -5,6 +5,14 @@ if [[ "$#" < 2 ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -z ${AUTOPILOT_HOST+x} ]; then
|
||||
host=px4autopilot
|
||||
echo "\$AUTOPILOT_HOST is not set (use default: $host)"
|
||||
else
|
||||
host=$AUTOPILOT_HOST
|
||||
echo "\$AUTOPILOT_HOST is set to $host"
|
||||
fi
|
||||
|
||||
echo "Uploading..."
|
||||
|
||||
# Get last argument
|
||||
@ -19,6 +27,6 @@ do
|
||||
fi
|
||||
# echo "Pushing $arg to $last"
|
||||
#adb push $arg $last
|
||||
scp $arg pi@px4autopilot:$last
|
||||
scp $arg pi@$host:$last
|
||||
((i+=1))
|
||||
done
|
||||
|
||||
@ -8,6 +8,14 @@ logconv.m: This is a MATLAB script which will automatically convert and display
|
||||
|
||||
sdlog2_dump.py: This is a Python script (compatible with v2 and v3) which converts the self-describing binary log format to a CSV file. To export a CSV file from within a shell (Windows CMD or BASH on Linux / Mac OS), run:
|
||||
|
||||
python sdlog2_dump.py log001.bin -f "export.csv" -t "TIME" -d "," -n ""
|
||||
python sdlog2_dump.py log001.bin -f "export.csv" -t "TIME" -d "," -n ""
|
||||
|
||||
Python can be downloaded from http://python.org, but is available as default on Mac OS and Linux.
|
||||
geo_tag_images.py: Use this script to geotag a set of images. It uses GPS time and file creation date to synchronize the images, so it needs that the images have a valid creation date.
|
||||
|
||||
python geo_tag_images.py --logfile=mylog.bin --input=images/ --output=tagged/
|
||||
|
||||
geotagging.py: Use this script to geotag a set of images. It uses the CAM trigger data from the log file for image association.
|
||||
|
||||
python geotagging.py --logfile=mylog.bin --input=images/ --output=tagged/
|
||||
|
||||
Python can be downloaded from http://python.org, but is available as default on Mac OS and Linux.
|
||||
|
||||
375
Tools/sdlog2/geo_tag_images.py
Normal file
375
Tools/sdlog2/geo_tag_images.py
Normal file
@ -0,0 +1,375 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Tag the images recorded during a flight with geo location extracted from
|
||||
# a PX4 binary log file.
|
||||
#
|
||||
# This file accepts *.jpg format images and reads position information
|
||||
# from a *.bin file
|
||||
#
|
||||
# Example Syntax:
|
||||
# python geotag.py --logfile=log001.bin --input=images/ --output=imagesWithTag/ --offset=-0.4 -v
|
||||
#
|
||||
# Author: Hector Azpurua
|
||||
# Based on the script of Andreas Bircher
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import csv
|
||||
import bisect
|
||||
import pyexiv2
|
||||
import argparse
|
||||
from lxml import etree
|
||||
import datetime, calendar
|
||||
from shutil import copyfile
|
||||
from pykml.factory import KML_ElementMaker as KML
|
||||
from pykml.factory import GX_ElementMaker as GX
|
||||
|
||||
|
||||
class GpsPosition(object):
|
||||
def __init__(self, timestamp, lat, lon, alt):
|
||||
self.timestamp = timestamp
|
||||
self.lat = float(lat)
|
||||
self.lon = float(lon)
|
||||
self.alt = float(alt)
|
||||
|
||||
|
||||
class Main:
|
||||
def __init__(self):
|
||||
"""
|
||||
|
||||
:param logfile:
|
||||
:param input:
|
||||
:param output:
|
||||
:param offset:
|
||||
:param verbose:
|
||||
:return:
|
||||
"""
|
||||
args = self.get_arg()
|
||||
|
||||
self.logfile = args['logfile']
|
||||
self.input = args['input']
|
||||
self.output = args['output']
|
||||
self.klm = args['klm']
|
||||
self.verbose = args['verbose']
|
||||
self.offset = args['offset']
|
||||
self.time_tresh = args['treshold']
|
||||
|
||||
self.tdiff_list = []
|
||||
self.non_processed_files = []
|
||||
self.tagged_gps = []
|
||||
self.gps_list = self.load_gps_from_log(self.logfile, self.offset)
|
||||
self.img_list = self.load_image_list(self.input)
|
||||
|
||||
if len(self.img_list) <= 0:
|
||||
print '[ERROR] Cannot load JPG images from input folder, please check filename extensions.'
|
||||
sys.exit(1)
|
||||
|
||||
if not os.path.exists(self.output):
|
||||
os.makedirs(self.output)
|
||||
|
||||
if not self.output.endswith(os.path.sep):
|
||||
self.output += os.path.sep
|
||||
|
||||
self.tag_images()
|
||||
|
||||
if self.klm and len(self.tdiff_list) > 0:
|
||||
self.gen_klm()
|
||||
|
||||
if len(self.non_processed_files) > 0:
|
||||
print '[WARNING] Some images werent processed:'
|
||||
for elem in self.non_processed_files:
|
||||
print '\t', elem
|
||||
|
||||
@staticmethod
|
||||
def to_degree(value, loc):
|
||||
"""
|
||||
Convert a lat or lon value to degrees/minutes/seconds
|
||||
:param value: the latitude or longitude value
|
||||
:param loc: could be ["S", "N"] or ["W", "E"]
|
||||
:return:
|
||||
"""
|
||||
if value < 0:
|
||||
loc_value = loc[0]
|
||||
elif value > 0:
|
||||
loc_value = loc[1]
|
||||
else:
|
||||
loc_value = ""
|
||||
|
||||
absolute_value = abs(value)
|
||||
deg = int(absolute_value)
|
||||
t1 = (absolute_value-deg) * 60
|
||||
minute = int(t1)
|
||||
sec = round((t1 - minute) * 60, 5)
|
||||
|
||||
return deg, minute, sec, loc_value
|
||||
|
||||
@staticmethod
|
||||
def gps_week_seconds_to_datetime(gpsweek, gpsmillis, leapmillis=0):
|
||||
"""
|
||||
Convert GPS week and seconds to datetime object, using leap milliseconds if necessary
|
||||
:param gpsweek:
|
||||
:param gpsmillis:
|
||||
:param leapmillis:
|
||||
:return:
|
||||
"""
|
||||
datetimeformat = "%Y-%m-%d %H:%M:%S.%f"
|
||||
epoch = datetime.datetime.strptime("1980-01-06 00:00:00.000", datetimeformat)
|
||||
elapsed = datetime.timedelta(days=(gpsweek * 7), milliseconds=(gpsmillis + leapmillis))
|
||||
|
||||
return Main.utc_to_local(epoch + elapsed)
|
||||
|
||||
@staticmethod
|
||||
def utc_to_local(utc_dt):
|
||||
"""
|
||||
Convert UTC time in local time
|
||||
:param utc_dt:
|
||||
:return:
|
||||
"""
|
||||
timestamp = calendar.timegm(utc_dt.timetuple()) # use integer timestamp to avoid precision lost
|
||||
local_dt = datetime.datetime.fromtimestamp(timestamp)
|
||||
assert utc_dt.resolution >= datetime.timedelta(microseconds=1)
|
||||
|
||||
return local_dt.replace(microsecond=utc_dt.microsecond)
|
||||
|
||||
def gen_klm(self):
|
||||
"""
|
||||
Generate a KML file with keypoints on the locations of the pictures, including height
|
||||
:return:
|
||||
"""
|
||||
style_dot = "sn_shaded_dot"
|
||||
style_path = "red_path"
|
||||
|
||||
doc = KML.kml(
|
||||
KML.Document(
|
||||
KML.Name("GPS of the images"),
|
||||
KML.Style(
|
||||
KML.IconStyle(
|
||||
KML.scale(0.4),
|
||||
KML.Icon(
|
||||
KML.href("http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png")
|
||||
),
|
||||
),
|
||||
id=style_dot,
|
||||
),
|
||||
KML.Style(
|
||||
KML.LineStyle(
|
||||
KML.color('7f0000ff'),
|
||||
KML.width(6),
|
||||
GX.labelVisibility('1'),
|
||||
),
|
||||
id=style_path
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
# create points
|
||||
for i, gps in enumerate(self.tagged_gps):
|
||||
ii = i + 1
|
||||
doc.Document.append(
|
||||
KML.Placemark(
|
||||
KML.styleUrl('#{0}'.format(style_dot)),
|
||||
KML.Point(
|
||||
KML.extrude(True),
|
||||
KML.altitudeMode('relativeToGround'),
|
||||
KML.coordinates("{},{},{}".format(gps.lon, gps.lat, gps.alt))
|
||||
),
|
||||
KML.name(str(ii)) if ii % 5 == 0 or ii == 1 else KML.name()
|
||||
)
|
||||
)
|
||||
|
||||
# create the path
|
||||
doc.Document.append(
|
||||
KML.Placemark(
|
||||
KML.styleUrl('#{0}'.format(style_path)),
|
||||
KML.LineString(
|
||||
KML.altitudeMode('relativeToGround'),
|
||||
KML.coordinates(
|
||||
' '.join(["{},{},{}".format(gps.lon, gps.lat, gps.alt) for gps in self.tagged_gps])
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
s = etree.tostring(doc)
|
||||
|
||||
file_path = self.output + 'GoogleEarth_points.kml'
|
||||
f = open(file_path,'w')
|
||||
f.write(s)
|
||||
f.close()
|
||||
|
||||
print '[INFO] KML file generated on:', file_path
|
||||
|
||||
def get_closest_datetime_index(self, datetime_list, elem):
|
||||
"""
|
||||
Get the closest element between a list of datetime objects and a date
|
||||
:param datetime_list:
|
||||
:param elem:
|
||||
:return:
|
||||
"""
|
||||
i = bisect.bisect_left(datetime_list, elem)
|
||||
date = datetime_list[i]
|
||||
diff = (date - elem).total_seconds()
|
||||
|
||||
if diff > self.time_tresh:
|
||||
return -1, diff
|
||||
|
||||
return i, diff
|
||||
|
||||
def set_gps_location(self, file_name, lat, lng, alt):
|
||||
"""
|
||||
Add the GPS tag and altitude to a image file
|
||||
:param file_name:
|
||||
:param lat:
|
||||
:param lng:
|
||||
:param alt:
|
||||
:return:
|
||||
"""
|
||||
lat_deg = self.to_degree(lat, ["S", "N"])
|
||||
lng_deg = self.to_degree(lng, ["W", "E"])
|
||||
|
||||
exiv_lat = (pyexiv2.Rational(lat_deg[0] * 60 + lat_deg[1], 60),
|
||||
pyexiv2.Rational(lat_deg[2] * 100, 6000), pyexiv2.Rational(0, 1))
|
||||
exiv_lng = (pyexiv2.Rational(lng_deg[0] * 60 + lng_deg[1], 60),
|
||||
pyexiv2.Rational(lng_deg[2] * 100, 6000), pyexiv2.Rational(0, 1))
|
||||
|
||||
try:
|
||||
exiv_image = pyexiv2.ImageMetadata(file_name)
|
||||
exiv_image.read()
|
||||
|
||||
exiv_image["Exif.GPSInfo.GPSLatitude"] = exiv_lat
|
||||
exiv_image["Exif.GPSInfo.GPSLatitudeRef"] = lat_deg[3]
|
||||
exiv_image["Exif.GPSInfo.GPSLongitude"] = exiv_lng
|
||||
exiv_image["Exif.GPSInfo.GPSLongitudeRef"] = lng_deg[3]
|
||||
exiv_image["Exif.GPSInfo.GPSAltitude"] = pyexiv2.Rational(alt, 1)
|
||||
exiv_image["Exif.GPSInfo.GPSAltitudeRef"] = '0'
|
||||
exiv_image["Exif.Image.GPSTag"] = 654
|
||||
exiv_image["Exif.GPSInfo.GPSMapDatum"] = "WGS-84"
|
||||
exiv_image["Exif.GPSInfo.GPSVersionID"] = '2 0 0 0'
|
||||
|
||||
exiv_image.write(True)
|
||||
except Exception as e:
|
||||
print '[ERROR]', e
|
||||
|
||||
def load_gps_from_log(self, log_file, offset):
|
||||
"""
|
||||
Load gps list from PX4 binary log
|
||||
:param log_file:
|
||||
:param offset:
|
||||
:return:
|
||||
"""
|
||||
os.system('python sdlog2_dump.py ' + log_file + ' -f log.csv')
|
||||
f = open('log.csv', 'rb')
|
||||
reader = csv.reader(f)
|
||||
headers = reader.next()
|
||||
line = {}
|
||||
for h in headers:
|
||||
line[h] = []
|
||||
|
||||
for row in reader:
|
||||
for h, v in zip(headers, row):
|
||||
line[h].append(v)
|
||||
|
||||
gps_list = []
|
||||
for seq in range(0, len(line['GPS_Lat']) - 1):
|
||||
gps_time = int(line['GPS_TimeMS'][seq + 1])
|
||||
gps_week = int(line['GPS_Week'][seq + 1])
|
||||
gps_lat = float(line['GPS_Lat'][seq + 1])
|
||||
gps_lon = float(line['GPS_Lng'][seq + 1])
|
||||
gps_alt = float(line['GPS_RelAlt'][seq + 1])
|
||||
|
||||
date = self.gps_week_seconds_to_datetime(gps_week, gps_time, leapmillis=offset)
|
||||
print date
|
||||
gps_list.append(GpsPosition(date, gps_lat, gps_lon, gps_alt))
|
||||
|
||||
return gps_list
|
||||
|
||||
def load_image_list(self, input_folder, file_type='jpg'):
|
||||
"""
|
||||
Load image list from a folder given a file type
|
||||
:param input_folder:
|
||||
:param file_type:
|
||||
:return:
|
||||
"""
|
||||
self.img_list = [input_folder + filename for filename in os.listdir(input_folder)
|
||||
if re.search(r'\.'+file_type+'$', filename, re.IGNORECASE)]
|
||||
self.img_list = sorted(self.img_list)
|
||||
return self.img_list
|
||||
|
||||
def tag_images(self):
|
||||
"""
|
||||
Tag the image list using the GPS loaded from the LOG file
|
||||
:return:
|
||||
"""
|
||||
tagged_gps = []
|
||||
img_size = len(self.img_list)
|
||||
print '[INFO] Number of images:', img_size
|
||||
|
||||
dt_list = [x.timestamp for x in self.gps_list]
|
||||
|
||||
img_seq = 1
|
||||
|
||||
for i in xrange(img_size):
|
||||
base_path, filename = os.path.split(self.img_list[i])
|
||||
cdate = datetime.datetime.fromtimestamp(os.path.getmtime(self.img_list[i]))
|
||||
gps_i, img_tdiff = self.get_closest_datetime_index(dt_list, cdate)
|
||||
|
||||
if gps_i == -1:
|
||||
self.non_processed_files.append(filename)
|
||||
continue
|
||||
|
||||
closest_gps = self.gps_list[gps_i]
|
||||
self.tdiff_list.append(img_tdiff)
|
||||
|
||||
if self.verbose:
|
||||
msg = "[DEBUG] %s/%s) %s\n\timg %s -> gps %s (%ss)\n\tlat:%s, lon:%s, alt:%s".ljust(60) %\
|
||||
(i+1, img_size, filename, cdate, closest_gps.timestamp, img_tdiff, closest_gps.lat, closest_gps.lon, closest_gps.alt)
|
||||
print msg
|
||||
|
||||
copyfile(self.img_list[i], self.output + str(img_seq) + filename)
|
||||
self.set_gps_location(self.output + str(img_seq) + filename, closest_gps.lat, closest_gps.lon, closest_gps.alt)
|
||||
self.tagged_gps.append(closest_gps)
|
||||
img_seq += 1
|
||||
|
||||
if len(self.tdiff_list) > 0:
|
||||
print '[INFO] Mean diff in seconds:', sum(self.tdiff_list) / float(len(self.tdiff_list))
|
||||
|
||||
@staticmethod
|
||||
def get_arg():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Geotag script to add GPS info to pictures from PX4 binary log files.'\
|
||||
'It uses synchronized time to allocate GPS positions.'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-l', '--logfile', help='PX4 log file containing recorded positions.', required=True
|
||||
)
|
||||
parser.add_argument(
|
||||
'-i', '--input', help='Input folder containing untagged images.', required=True
|
||||
)
|
||||
parser.add_argument(
|
||||
'-o', '--output', help='Output folder to contain tagged images.', required=True
|
||||
)
|
||||
parser.add_argument(
|
||||
'-t', '--treshold', help='Time treshold between the GPS time and the local image time.',
|
||||
default=1, required=False, type=float
|
||||
)
|
||||
parser.add_argument(
|
||||
'-of', '--offset', help='Time offset in MILLISECONDS between the GPS time and the local time.',
|
||||
default=-17000, required=False, type=float
|
||||
)
|
||||
parser.add_argument(
|
||||
'-klm', '--klm', help='Save the in KML format the information of all tagged images.',
|
||||
required=False, action='store_true'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-v', '--verbose', help='Prints lots of information.',
|
||||
required=False, action='store_true'
|
||||
)
|
||||
|
||||
args = vars(parser.parse_args())
|
||||
return args
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
m = Main()
|
||||
@ -1 +1 @@
|
||||
Subproject commit 459a0c933598249fdf30d8162c5b9ec7d6620258
|
||||
Subproject commit 00dcabb1c2c001b40713903da1a4a7f71d01ef27
|
||||
@ -16,7 +16,7 @@ src_path=`pwd`
|
||||
rc_script="posix-configs/SITL/init/rcS_multiple"
|
||||
build_path=${src_path}/build_posix_sitl_default
|
||||
|
||||
pkill mainapp
|
||||
pkill px4
|
||||
sleep 2
|
||||
|
||||
cd $build_path/src/firmware/posix
|
||||
@ -39,7 +39,7 @@ while [ $n -le $sitl_num ]; do
|
||||
|
||||
cd $n
|
||||
|
||||
sudo -b -u $user ../mainapp -d rcS >out.log 2>err.log
|
||||
sudo -b -u $user ../px4 -d rcS >out.log 2>err.log
|
||||
|
||||
cd ../
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ fi
|
||||
# kill process names that might stil
|
||||
# be running from last time
|
||||
pkill gazebo
|
||||
pkill mainapp
|
||||
pkill px4
|
||||
jmavsim_pid=`jps | grep Simulator | cut -d" " -f1`
|
||||
if [ -n "$jmavsim_pid" ]
|
||||
then
|
||||
@ -117,18 +117,18 @@ set +e
|
||||
# Start Java simulator
|
||||
if [ "$debugger" == "lldb" ]
|
||||
then
|
||||
lldb -- mainapp ../../../../${rc_script}_${program}_${model}
|
||||
lldb -- px4 ../../../../${rc_script}_${program}_${model}
|
||||
elif [ "$debugger" == "gdb" ]
|
||||
then
|
||||
gdb --args mainapp ../../../../${rc_script}_${program}_${model}
|
||||
gdb --args px4 ../../../../${rc_script}_${program}_${model}
|
||||
elif [ "$debugger" == "ddd" ]
|
||||
then
|
||||
ddd --debugger gdb --args mainapp ../../../../${rc_script}_${program}_${model}
|
||||
ddd --debugger gdb --args px4 ../../../../${rc_script}_${program}_${model}
|
||||
elif [ "$debugger" == "valgrind" ]
|
||||
then
|
||||
valgrind ./mainapp ../../../../${rc_script}_${program}_${model}
|
||||
valgrind ./px4 ../../../../${rc_script}_${program}_${model}
|
||||
else
|
||||
$sudo_enabled ./mainapp $chroot_enabled ../../../../${rc_script}_${program}_${model}
|
||||
$sudo_enabled ./px4 $chroot_enabled ../../../../${rc_script}_${program}_${model}
|
||||
fi
|
||||
|
||||
if [ "$program" == "jmavsim" ]
|
||||
|
||||
@ -17,7 +17,7 @@ fi
|
||||
|
||||
if [ $SYSTYPE = "Linux" ];
|
||||
then
|
||||
SERIAL_PORTS="/dev/serial/by-id/usb-3D_Robotics*"
|
||||
SERIAL_PORTS="/dev/serial/by-id/usb-3D_Robotics*,/dev/serial/by-id/usb-The_Autopilot*"
|
||||
fi
|
||||
|
||||
if [ $SYSTYPE = "" ];
|
||||
@ -25,4 +25,4 @@ then
|
||||
SERIAL_PORTS="COM32,COM31,COM30,COM29,COM28,COM27,COM26,COM25,COM24,COM23,COM22,COM21,COM20,COM19,COM18,COM17,COM16,COM15,COM14,COM13,COM12,COM11,COM10,COM9,COM8,COM7,COM6,COM5,COM4,COM3,COM2,COM1,COM0"
|
||||
fi
|
||||
|
||||
python $BASEDIR/px_uploader.py --port $SERIAL_PORTS $1
|
||||
python $BASEDIR/px_uploader.py --port $SERIAL_PORTS $1
|
||||
|
||||
20
circle.yml
Normal file
20
circle.yml
Normal file
@ -0,0 +1,20 @@
|
||||
machine:
|
||||
services:
|
||||
- docker
|
||||
|
||||
checkout:
|
||||
post:
|
||||
- git submodule sync --recursive
|
||||
- git submodule update --init --recursive
|
||||
|
||||
## Customize dependencies
|
||||
dependencies:
|
||||
cache_directories:
|
||||
- "~/.ccache"
|
||||
pre:
|
||||
- docker pull px4io/px4-dev-nuttx-gcc4.9
|
||||
|
||||
test:
|
||||
override:
|
||||
- docker run --rm -v `pwd`:`pwd`:rw -w=`pwd` -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache --user=$UID -it px4io/px4-dev-nuttx-gcc4.9 /bin/bash -c "ccache -z; make px4fmu-v4_default; ccache -s"
|
||||
|
||||
@ -488,6 +488,7 @@ function(px4_add_upload)
|
||||
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
|
||||
list(APPEND serial_ports
|
||||
/dev/serial/by-id/usb-3D_Robotics*
|
||||
/dev/serial/by-id/usb-The_Autopilot*
|
||||
/dev/serial/by-id/pci-3D_Robotics*
|
||||
)
|
||||
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
@ -659,6 +660,7 @@ function(px4_add_common_flags)
|
||||
endif()
|
||||
|
||||
if ($ENV{MEMORY_DEBUG} MATCHES "1")
|
||||
message(STATUS "address sanitizer enabled")
|
||||
set(max_optimization -Os)
|
||||
|
||||
set(optimization_flags
|
||||
@ -786,6 +788,7 @@ function(px4_add_common_flags)
|
||||
string(REPLACE "-" "_" board_config ${board_upper})
|
||||
set(added_definitions
|
||||
-DCONFIG_ARCH_BOARD_${board_config}
|
||||
-D__STDC_FORMAT_MACROS
|
||||
)
|
||||
|
||||
if (NOT (APPLE AND (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")))
|
||||
|
||||
@ -64,13 +64,27 @@ set(config_module_list
|
||||
systemcmds/pwm
|
||||
systemcmds/esc_calib
|
||||
systemcmds/reboot
|
||||
#systemcmds/topic_listener
|
||||
systemcmds/topic_listener
|
||||
systemcmds/top
|
||||
systemcmds/config
|
||||
systemcmds/nshterm
|
||||
systemcmds/mtd
|
||||
systemcmds/dumpfile
|
||||
systemcmds/ver
|
||||
systemcmds/sd_bench
|
||||
systemcmds/motor_ramp
|
||||
|
||||
#
|
||||
# Tests
|
||||
#
|
||||
drivers/sf0x/sf0x_tests
|
||||
drivers/test_ppm
|
||||
modules/commander/commander_tests
|
||||
modules/controllib_test
|
||||
modules/mavlink/mavlink_tests
|
||||
modules/unit_test
|
||||
modules/uORB/uORB_tests
|
||||
systemcmds/tests
|
||||
|
||||
#
|
||||
# General system control
|
||||
@ -95,7 +109,6 @@ set(config_module_list
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
# modules/segway # XXX Needs GCC 4.7 fix
|
||||
modules/fw_pos_control_l1
|
||||
modules/fw_att_control
|
||||
modules/mc_att_control
|
||||
|
||||
@ -53,20 +53,33 @@ set(config_module_list
|
||||
# System commands
|
||||
#
|
||||
systemcmds/bl_update
|
||||
systemcmds/config
|
||||
systemcmds/dumpfile
|
||||
#systemcmds/esc_calib
|
||||
systemcmds/mixer
|
||||
#systemcmds/motor_ramp
|
||||
systemcmds/mtd
|
||||
systemcmds/nshterm
|
||||
systemcmds/param
|
||||
systemcmds/perf
|
||||
systemcmds/pwm
|
||||
systemcmds/esc_calib
|
||||
systemcmds/reboot
|
||||
#systemcmds/topic_listener
|
||||
systemcmds/top
|
||||
systemcmds/config
|
||||
systemcmds/nshterm
|
||||
systemcmds/mtd
|
||||
systemcmds/dumpfile
|
||||
systemcmds/ver
|
||||
#systemcmds/sd_bench
|
||||
systemcmds/top
|
||||
#systemcmds/topic_listener
|
||||
systemcmds/ver
|
||||
|
||||
#
|
||||
# Testing
|
||||
#
|
||||
#drivers/sf0x/sf0x_tests
|
||||
#drivers/test_ppm
|
||||
#lib/rc/rc_tests
|
||||
#modules/commander/commander_tests
|
||||
#modules/controllib_test
|
||||
#modules/mavlink/mavlink_tests
|
||||
#modules/unit_test
|
||||
#modules/uORB/uORB_tests
|
||||
#systemcmds/tests
|
||||
|
||||
#
|
||||
@ -84,9 +97,10 @@ set(config_module_list
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
modules/ekf_att_pos_estimator
|
||||
#modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
modules/ekf2
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
@ -100,7 +114,7 @@ set(config_module_list
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
modules/logger
|
||||
#modules/logger
|
||||
modules/sdlog2
|
||||
|
||||
#
|
||||
|
||||
@ -41,11 +41,13 @@ set(config_module_list
|
||||
modules/sensors
|
||||
#drivers/mkblctrl
|
||||
drivers/px4flow
|
||||
drivers/oreoled
|
||||
#drivers/oreoled
|
||||
drivers/gimbal
|
||||
drivers/pwm_input
|
||||
drivers/camera_trigger
|
||||
drivers/bst
|
||||
#drivers/snapdragon_rc_pwm
|
||||
#drivers/lis3mdl
|
||||
|
||||
#
|
||||
# System commands
|
||||
@ -64,6 +66,9 @@ set(config_module_list
|
||||
systemcmds/mtd
|
||||
systemcmds/dumpfile
|
||||
systemcmds/ver
|
||||
#systemcmds/sd_bench
|
||||
#systemcmds/tests
|
||||
systemcmds/motor_ramp
|
||||
|
||||
#
|
||||
# General system control
|
||||
@ -72,7 +77,7 @@ set(config_module_list
|
||||
modules/load_mon
|
||||
modules/navigator
|
||||
modules/mavlink
|
||||
modules/gpio_led
|
||||
#modules/gpio_led
|
||||
modules/uavcan
|
||||
modules/land_detector
|
||||
|
||||
@ -94,8 +99,8 @@ set(config_module_list
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
modules/sdlog2
|
||||
modules/logger
|
||||
modules/sdlog2
|
||||
|
||||
#
|
||||
# Library modules
|
||||
@ -136,7 +141,7 @@ set(config_module_list
|
||||
#
|
||||
# Rover apps
|
||||
#
|
||||
examples/rover_steering_control
|
||||
#examples/rover_steering_control
|
||||
|
||||
#
|
||||
# Demo apps
|
||||
|
||||
@ -48,37 +48,39 @@ set(config_module_list
|
||||
#drivers/bst
|
||||
#drivers/snapdragon_rc_pwm
|
||||
#drivers/lis3mdl
|
||||
#drivers/bmi160
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
systemcmds/bl_update
|
||||
systemcmds/config
|
||||
systemcmds/dumpfile
|
||||
#systemcmds/esc_calib
|
||||
systemcmds/mixer
|
||||
systemcmds/motor_ramp
|
||||
systemcmds/mtd
|
||||
systemcmds/nshterm
|
||||
systemcmds/param
|
||||
systemcmds/perf
|
||||
systemcmds/pwm
|
||||
systemcmds/esc_calib
|
||||
systemcmds/reboot
|
||||
#systemcmds/topic_listener
|
||||
#systemcmds/sd_bench
|
||||
systemcmds/top
|
||||
systemcmds/config
|
||||
systemcmds/nshterm
|
||||
systemcmds/mtd
|
||||
systemcmds/dumpfile
|
||||
#systemcmds/topic_listener
|
||||
systemcmds/ver
|
||||
systemcmds/sd_bench
|
||||
systemcmds/tests
|
||||
|
||||
#
|
||||
# Testing
|
||||
#
|
||||
drivers/sf0x/sf0x_tests
|
||||
drivers/test_ppm
|
||||
#lib/rc/rc_tests
|
||||
modules/commander/commander_tests
|
||||
modules/controllib_test
|
||||
modules/mavlink/mavlink_tests
|
||||
modules/unit_test
|
||||
modules/uORB/uORB_tests
|
||||
systemcmds/tests
|
||||
|
||||
#
|
||||
# General system control
|
||||
@ -87,7 +89,7 @@ set(config_module_list
|
||||
modules/load_mon
|
||||
modules/navigator
|
||||
modules/mavlink
|
||||
modules/gpio_led
|
||||
#modules/gpio_led
|
||||
modules/uavcan
|
||||
modules/land_detector
|
||||
|
||||
@ -95,14 +97,14 @@ set(config_module_list
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
modules/ekf_att_pos_estimator
|
||||
#modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
modules/ekf2
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
# modules/segway # XXX Needs GCC 4.7 fix
|
||||
modules/fw_pos_control_l1
|
||||
modules/fw_att_control
|
||||
modules/mc_att_control
|
||||
|
||||
@ -23,6 +23,7 @@ set(config_module_list
|
||||
drivers/mb12xx
|
||||
drivers/srf02
|
||||
drivers/sf0x
|
||||
drivers/sf1xx
|
||||
drivers/ll40ls
|
||||
drivers/trone
|
||||
drivers/gps
|
||||
@ -48,6 +49,7 @@ set(config_module_list
|
||||
drivers/bmp280
|
||||
drivers/bma180
|
||||
drivers/bmi160
|
||||
drivers/tap_esc
|
||||
|
||||
#
|
||||
# System commands
|
||||
@ -67,6 +69,18 @@ set(config_module_list
|
||||
systemcmds/dumpfile
|
||||
systemcmds/ver
|
||||
systemcmds/sd_bench
|
||||
systemcmds/motor_ramp
|
||||
|
||||
#
|
||||
# Testing
|
||||
#
|
||||
drivers/sf0x/sf0x_tests
|
||||
drivers/test_ppm
|
||||
modules/commander/commander_tests
|
||||
modules/controllib_test
|
||||
modules/mavlink/mavlink_tests
|
||||
modules/unit_test
|
||||
modules/uORB/uORB_tests
|
||||
systemcmds/tests
|
||||
|
||||
#
|
||||
|
||||
129
cmake/configs/nuttx_tap-v1_default.cmake
Normal file
129
cmake/configs/nuttx_tap-v1_default.cmake
Normal file
@ -0,0 +1,129 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
drivers/device
|
||||
drivers/stm32
|
||||
drivers/stm32/adc
|
||||
drivers/stm32/tone_alarm
|
||||
drivers/led
|
||||
drivers/px4fmu
|
||||
drivers/boards/tap-v1
|
||||
drivers/rgbled_pwm
|
||||
drivers/tap_esc
|
||||
#drivers/mpu6500
|
||||
drivers/ms5611
|
||||
drivers/hmc5883
|
||||
drivers/gps
|
||||
drivers/airspeed
|
||||
drivers/meas_airspeed
|
||||
modules/sensors
|
||||
drivers/camera_trigger
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
systemcmds/bl_update
|
||||
systemcmds/mixer
|
||||
systemcmds/param
|
||||
systemcmds/perf
|
||||
systemcmds/pwm
|
||||
systemcmds/motor_test
|
||||
systemcmds/reboot
|
||||
systemcmds/top
|
||||
systemcmds/config
|
||||
systemcmds/nshterm
|
||||
systemcmds/mtd
|
||||
systemcmds/dumpfile
|
||||
systemcmds/ver
|
||||
systemcmds/topic_listener
|
||||
|
||||
#
|
||||
# General system control
|
||||
#
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
modules/navigator
|
||||
modules/mavlink
|
||||
modules/land_detector
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
modules/ekf2
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
modules/fw_pos_control_l1
|
||||
modules/fw_att_control
|
||||
modules/mc_att_control
|
||||
modules/mc_pos_control
|
||||
modules/vtol_att_control
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
modules/logger
|
||||
|
||||
#
|
||||
# Library modules
|
||||
#
|
||||
modules/param
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
modules/uORB
|
||||
modules/dataman
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
lib/controllib
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
lib/ecl
|
||||
lib/external_lgpl
|
||||
lib/geo
|
||||
lib/geo_lookup
|
||||
lib/conversion
|
||||
lib/launchdetection
|
||||
lib/terrain_estimation
|
||||
lib/runway_takeoff
|
||||
lib/tailsitter_recovery
|
||||
lib/DriverFramework/framework
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
platforms/common
|
||||
platforms/nuttx/px4_layer
|
||||
)
|
||||
|
||||
set(config_extra_builtin_cmds
|
||||
serdis
|
||||
sercon
|
||||
)
|
||||
|
||||
set(config_io_board
|
||||
)
|
||||
|
||||
set(config_extra_libs
|
||||
)
|
||||
|
||||
set(config_io_extra_libs
|
||||
)
|
||||
|
||||
add_custom_target(sercon)
|
||||
set_target_properties(sercon PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "sercon"
|
||||
STACK_MAIN "2048")
|
||||
|
||||
add_custom_target(serdis)
|
||||
set_target_properties(serdis PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "serdis"
|
||||
STACK_MAIN "2048")
|
||||
@ -4,6 +4,8 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linu
|
||||
|
||||
add_definitions(
|
||||
-D__PX4_POSIX_BEBOP
|
||||
-D__LINUX
|
||||
-D__BEBOP
|
||||
)
|
||||
|
||||
set(CMAKE_PROGRAM_PATH
|
||||
@ -13,13 +15,16 @@ set(CMAKE_PROGRAM_PATH
|
||||
|
||||
set(config_module_list
|
||||
|
||||
examples/px4_simple_app
|
||||
# examples/px4_simple_app
|
||||
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
drivers/device
|
||||
modules/sensors
|
||||
platforms/posix/drivers/df_ms5607_wrapper
|
||||
platforms/posix/drivers/df_mpu6050_wrapper
|
||||
platforms/posix/drivers/df_ak8963_wrapper
|
||||
|
||||
#
|
||||
# System commands
|
||||
@ -47,7 +52,7 @@ set(config_module_list
|
||||
modules/mc_att_control
|
||||
modules/mc_pos_control
|
||||
modules/fw_att_control
|
||||
modules/fw_pos_control_l1
|
||||
modules/fw_pos_control_l1
|
||||
modules/vtol_att_control
|
||||
|
||||
#
|
||||
@ -56,7 +61,6 @@ set(config_module_list
|
||||
modules/sdlog2
|
||||
modules/logger
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
modules/param
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
@ -94,3 +98,9 @@ set(config_module_list
|
||||
platforms/posix/px4_layer
|
||||
platforms/posix/work_queue
|
||||
)
|
||||
|
||||
set(config_df_driver_list
|
||||
ms5607
|
||||
mpu6050
|
||||
ak8963
|
||||
)
|
||||
|
||||
@ -30,7 +30,6 @@ set(config_module_list
|
||||
modules/logger
|
||||
modules/simulator
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
|
||||
@ -49,7 +49,6 @@ set(config_module_list
|
||||
modules/simulator
|
||||
modules/commander
|
||||
modules/navigator
|
||||
modules/load_mon
|
||||
|
||||
lib/controllib
|
||||
lib/mathlib
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
include(posix/px4_impl_posix)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-native.cmake)
|
||||
|
||||
set(config_module_list
|
||||
drivers/device
|
||||
platforms/common
|
||||
platforms/posix/px4_layer
|
||||
platforms/posix/work_queue
|
||||
systemcmds/param
|
||||
systemcmds/mixer
|
||||
systemcmds/ver
|
||||
systemcmds/esc_calib
|
||||
systemcmds/reboot
|
||||
systemcmds/topic_listener
|
||||
systemcmds/perf
|
||||
modules/uORB
|
||||
modules/param
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
modules/sensors
|
||||
modules/mavlink
|
||||
modules/attitude_estimator_q
|
||||
modules/position_estimator_inav
|
||||
modules/navigator
|
||||
modules/vtol_att_control
|
||||
modules/mc_pos_control
|
||||
modules/mc_att_control
|
||||
modules/land_detector
|
||||
modules/fw_att_control
|
||||
modules/fw_pos_control_l1
|
||||
modules/dataman
|
||||
modules/sdlog2
|
||||
modules/logger
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
lib/controllib
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
lib/conversion
|
||||
lib/ecl
|
||||
lib/external_lgpl
|
||||
lib/geo
|
||||
lib/geo_lookup
|
||||
lib/launchdetection
|
||||
lib/terrain_estimation
|
||||
lib/runway_takeoff
|
||||
lib/tailsitter_recovery
|
||||
lib/DriverFramework/framework
|
||||
)
|
||||
@ -1,17 +1,15 @@
|
||||
# This file is shared between posix_rpi_native.cmake
|
||||
# and posix_rpi_cross.cmake.
|
||||
|
||||
include(posix/px4_impl_posix)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf-raspbian.cmake)
|
||||
|
||||
set(CMAKE_PROGRAM_PATH
|
||||
"${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin"
|
||||
${CMAKE_PROGRAM_PATH}
|
||||
)
|
||||
|
||||
# This definition allows to differentiate if this just the usual POSIX build
|
||||
# or if it is for the RPi.
|
||||
add_definitions(
|
||||
-D__PX4_POSIX_RPI2
|
||||
)
|
||||
-D__PX4_POSIX_RPI
|
||||
-D__LINUX
|
||||
)
|
||||
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
@ -20,7 +18,8 @@ set(config_module_list
|
||||
drivers/device
|
||||
modules/sensors
|
||||
platforms/posix/drivers/df_mpu9250_wrapper
|
||||
platforms/posix/drivers/df_bmp280_wrapper
|
||||
platforms/posix/drivers/df_lsm9ds1_wrapper
|
||||
platforms/posix/drivers/df_ms5611_wrapper
|
||||
platforms/posix/drivers/df_hmc5883_wrapper
|
||||
platforms/posix/drivers/df_trone_wrapper
|
||||
platforms/posix/drivers/df_isl29501_wrapper
|
||||
@ -32,6 +31,7 @@ set(config_module_list
|
||||
systemcmds/mixer
|
||||
systemcmds/ver
|
||||
systemcmds/esc_calib
|
||||
systemcmds/reboot
|
||||
systemcmds/topic_listener
|
||||
systemcmds/perf
|
||||
|
||||
@ -51,7 +51,7 @@ set(config_module_list
|
||||
modules/mc_att_control
|
||||
modules/mc_pos_control
|
||||
modules/fw_att_control
|
||||
modules/fw_pos_control_l1
|
||||
modules/fw_pos_control_l1
|
||||
modules/vtol_att_control
|
||||
|
||||
#
|
||||
@ -60,7 +60,6 @@ set(config_module_list
|
||||
modules/sdlog2
|
||||
modules/logger
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
modules/param
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
@ -73,6 +72,9 @@ set(config_module_list
|
||||
#
|
||||
# PX4 drivers
|
||||
#
|
||||
drivers/gps
|
||||
drivers/navio_sysfs_rc_in
|
||||
drivers/navio_sysfs_pwm_out
|
||||
|
||||
#
|
||||
# Libraries
|
||||
@ -97,13 +99,16 @@ set(config_module_list
|
||||
platforms/common
|
||||
platforms/posix/px4_layer
|
||||
platforms/posix/work_queue
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
#
|
||||
# DriverFramework driver
|
||||
#
|
||||
set(config_df_driver_list
|
||||
mpu9250
|
||||
bmp280
|
||||
lsm9ds1
|
||||
ms5611
|
||||
hmc5883
|
||||
trone
|
||||
isl29501
|
||||
)
|
||||
)
|
||||
8
cmake/configs/posix_rpi_cross.cmake
Normal file
8
cmake/configs/posix_rpi_cross.cmake
Normal file
@ -0,0 +1,8 @@
|
||||
include(configs/posix_rpi_common)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf-raspbian.cmake)
|
||||
|
||||
set(CMAKE_PROGRAM_PATH
|
||||
"${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin"
|
||||
${CMAKE_PROGRAM_PATH}
|
||||
)
|
||||
3
cmake/configs/posix_rpi_native.cmake
Normal file
3
cmake/configs/posix_rpi_native.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
include(configs/posix_rpi_common)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-native.cmake)
|
||||
@ -42,7 +42,6 @@ set(config_module_list
|
||||
modules/simulator
|
||||
modules/commander
|
||||
modules/navigator
|
||||
modules/load_mon
|
||||
|
||||
lib/controllib
|
||||
lib/mathlib
|
||||
|
||||
@ -30,6 +30,7 @@ set(config_module_list
|
||||
systemcmds/topic_listener
|
||||
systemcmds/ver
|
||||
systemcmds/top
|
||||
systemcmds/motor_ramp
|
||||
|
||||
modules/attitude_estimator_ekf
|
||||
modules/attitude_estimator_q
|
||||
@ -40,7 +41,6 @@ set(config_module_list
|
||||
modules/fw_att_control
|
||||
modules/fw_pos_control_l1
|
||||
modules/land_detector
|
||||
modules/load_mon
|
||||
modules/logger
|
||||
modules/mavlink
|
||||
modules/mc_att_control
|
||||
@ -51,6 +51,7 @@ set(config_module_list
|
||||
modules/param
|
||||
modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
modules/replay
|
||||
modules/sdlog2
|
||||
modules/sensors
|
||||
modules/simulator
|
||||
@ -69,6 +70,7 @@ set(config_module_list
|
||||
lib/launchdetection
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
lib/rc
|
||||
lib/runway_takeoff
|
||||
lib/tailsitter_recovery
|
||||
lib/terrain_estimation
|
||||
@ -78,9 +80,11 @@ set(config_module_list
|
||||
#
|
||||
# Testing
|
||||
#
|
||||
drivers/sf0x/sf0x_tests
|
||||
lib/rc/rc_tests
|
||||
modules/commander/commander_tests
|
||||
modules/controllib_test
|
||||
#modules/mavlink/mavlink_tests
|
||||
#modules/mavlink/mavlink_tests #TODO: fix mavlink_tests
|
||||
modules/unit_test
|
||||
modules/uORB/uORB_tests
|
||||
systemcmds/tests
|
||||
@ -110,3 +114,12 @@ set(config_sitl_debugger
|
||||
)
|
||||
set_property(CACHE config_sitl_debugger
|
||||
PROPERTY STRINGS "disable;gdb;lldb")
|
||||
|
||||
# If the environment variable 'replay' is defined, we are building with replay
|
||||
# support. In this case, we enable the orb publisher rules.
|
||||
set(REPLAY_FILE "$ENV{replay}")
|
||||
if(REPLAY_FILE)
|
||||
message("Building with uorb publisher rules support")
|
||||
add_definitions(-DORB_USE_PUBLISHER_RULES)
|
||||
endif()
|
||||
|
||||
|
||||
@ -1,111 +0,0 @@
|
||||
include(posix/px4_impl_posix)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-native.cmake)
|
||||
|
||||
set(config_module_list
|
||||
drivers/boards/sitl
|
||||
drivers/device
|
||||
drivers/gps
|
||||
drivers/pwm_out_sim
|
||||
|
||||
platforms/common
|
||||
platforms/posix/drivers/accelsim
|
||||
platforms/posix/drivers/adcsim
|
||||
platforms/posix/drivers/airspeedsim
|
||||
platforms/posix/drivers/barosim
|
||||
platforms/posix/drivers/gpssim
|
||||
platforms/posix/drivers/gyrosim
|
||||
platforms/posix/drivers/ledsim
|
||||
platforms/posix/drivers/rgbledsim
|
||||
platforms/posix/drivers/tonealrmsim
|
||||
platforms/posix/px4_layer
|
||||
platforms/posix/work_queue
|
||||
|
||||
systemcmds/esc_calib
|
||||
systemcmds/mixer
|
||||
systemcmds/param
|
||||
systemcmds/perf
|
||||
systemcmds/reboot
|
||||
systemcmds/sd_bench
|
||||
systemcmds/topic_listener
|
||||
systemcmds/ver
|
||||
|
||||
modules/attitude_estimator_ekf
|
||||
modules/attitude_estimator_q
|
||||
modules/commander
|
||||
modules/dataman
|
||||
modules/ekf2
|
||||
modules/ekf_att_pos_estimator
|
||||
modules/fw_att_control
|
||||
modules/fw_pos_control_l1
|
||||
modules/land_detector
|
||||
modules/load_mon
|
||||
modules/logger
|
||||
modules/mavlink
|
||||
modules/mc_att_control
|
||||
modules/mc_att_control_multiplatform
|
||||
modules/mc_pos_control
|
||||
modules/mc_pos_control_multiplatform
|
||||
modules/navigator
|
||||
modules/param
|
||||
modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
modules/sdlog2
|
||||
modules/sensors
|
||||
modules/simulator
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
modules/uORB
|
||||
modules/vtol_att_control
|
||||
|
||||
lib/controllib
|
||||
lib/conversion
|
||||
lib/DriverFramework/framework
|
||||
lib/ecl
|
||||
lib/external_lgpl
|
||||
lib/geo
|
||||
lib/geo_lookup
|
||||
lib/launchdetection
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
lib/runway_takeoff
|
||||
lib/tailsitter_recovery
|
||||
lib/terrain_estimation
|
||||
|
||||
examples/px4_simple_app
|
||||
|
||||
#
|
||||
# Testing
|
||||
#
|
||||
modules/commander/commander_tests
|
||||
modules/controllib_test
|
||||
#modules/mavlink/mavlink_tests
|
||||
modules/unit_test
|
||||
modules/uORB/uORB_tests
|
||||
systemcmds/tests
|
||||
|
||||
)
|
||||
|
||||
set(config_extra_builtin_cmds
|
||||
serdis
|
||||
sercon
|
||||
)
|
||||
|
||||
set(config_sitl_rcS
|
||||
posix-configs/SITL/init/rcS_test
|
||||
CACHE FILEPATH "init script for sitl"
|
||||
)
|
||||
|
||||
set(config_sitl_viewer
|
||||
jmavsim
|
||||
CACHE STRING "viewer for sitl"
|
||||
)
|
||||
set_property(CACHE config_sitl_viewer
|
||||
PROPERTY STRINGS "jmavsim;none")
|
||||
|
||||
set(config_sitl_debugger
|
||||
disable
|
||||
CACHE STRING "debugger for sitl"
|
||||
)
|
||||
set_property(CACHE config_sitl_debugger
|
||||
PROPERTY STRINGS "disable;gdb;lldb")
|
||||
@ -48,7 +48,6 @@ set(config_module_list
|
||||
modules/systemlib/mixer
|
||||
modules/uORB
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
|
||||
#
|
||||
# Libraries
|
||||
|
||||
@ -57,7 +57,6 @@ set(config_module_list
|
||||
modules/uORB
|
||||
modules/commander
|
||||
modules/land_detector
|
||||
modules/load_mon
|
||||
|
||||
#
|
||||
# PX4 drivers
|
||||
|
||||
@ -56,7 +56,6 @@ set(config_module_list
|
||||
modules/systemlib/mixer
|
||||
modules/uORB
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
|
||||
#
|
||||
# Libraries
|
||||
|
||||
@ -450,55 +450,8 @@ function(px4_os_add_flags)
|
||||
endif()
|
||||
|
||||
set(cpu_flags)
|
||||
if (${BOARD} STREQUAL "px4fmu-v1")
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m4
|
||||
-mthumb
|
||||
-march=armv7e-m
|
||||
-mfpu=fpv4-sp-d16
|
||||
-mfloat-abi=hard
|
||||
)
|
||||
elseif (${BOARD} STREQUAL "px4fmu-v2")
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m4
|
||||
-mthumb
|
||||
-march=armv7e-m
|
||||
-mfpu=fpv4-sp-d16
|
||||
-mfloat-abi=hard
|
||||
)
|
||||
elseif (${BOARD} STREQUAL "px4fmu-v4")
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m4
|
||||
-mthumb
|
||||
-march=armv7e-m
|
||||
-mfpu=fpv4-sp-d16
|
||||
-mfloat-abi=hard
|
||||
)
|
||||
elseif (${BOARD} STREQUAL "px4-stm32f4discovery")
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m4
|
||||
-mthumb
|
||||
-march=armv7e-m
|
||||
-mfpu=fpv4-sp-d16
|
||||
-mfloat-abi=hard
|
||||
)
|
||||
elseif (${BOARD} STREQUAL "aerocore")
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m4
|
||||
-mthumb
|
||||
-march=armv7e-m
|
||||
-mfpu=fpv4-sp-d16
|
||||
-mfloat-abi=hard
|
||||
)
|
||||
elseif (${BOARD} STREQUAL "mindpx-v2")
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m4
|
||||
-mthumb
|
||||
-march=armv7e-m
|
||||
-mfpu=fpv4-sp-d16
|
||||
-mfloat-abi=hard
|
||||
)
|
||||
elseif (${BOARD} STREQUAL "px4io-v1")
|
||||
# Handle non-F4 boards specifically here
|
||||
if (${BOARD} STREQUAL "px4io-v1")
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m3
|
||||
-mthumb
|
||||
@ -510,6 +463,14 @@ function(px4_os_add_flags)
|
||||
-mthumb
|
||||
-march=armv7-m
|
||||
)
|
||||
else ()
|
||||
set(cpu_flags
|
||||
-mcpu=cortex-m4
|
||||
-mthumb
|
||||
-march=armv7e-m
|
||||
-mfpu=fpv4-sp-d16
|
||||
-mfloat-abi=hard
|
||||
)
|
||||
endif()
|
||||
list(APPEND c_flags ${cpu_flags})
|
||||
list(APPEND cxx_flags ${cpu_flags})
|
||||
|
||||
@ -1,91 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import fnmatch
|
||||
import re
|
||||
import shutil
|
||||
import jinja2
|
||||
|
||||
src_path = os.path.join(os.path.curdir, 'src')
|
||||
|
||||
parser = argparse.ArgumentParser('converts module.mk to CMakeList.txt, run in root of repo')
|
||||
parser.add_argument('path', help='directory of modules to convert')
|
||||
parser.add_argument('--overwrite', help='overwrite existing files', dest='overwrite', action='store_true')
|
||||
parser.add_argument('--backup', help='create backup of existing files if overwriting', dest='backup', action='store_true')
|
||||
parser.set_defaults(overwrite=False, backup=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
cmake_template = jinja2.Template(open('cmake/scripts/cmake_lists.jinja', 'r').read())
|
||||
|
||||
module_files = []
|
||||
for root, dirnames, filenames in os.walk(args.path):
|
||||
for filename in fnmatch.filter(filenames, 'module.mk'):
|
||||
module_files.append(os.path.join(root, filename))
|
||||
|
||||
|
||||
search_data = [
|
||||
# name # re string
|
||||
('command', r'.*MODULE_COMMAND\s*[\+]?=\s*([^\n]+)'),
|
||||
('stacksize', r'.*MODULE_STACKSIZE\s*[\+]?=([^\n]+)'),
|
||||
('extracxxflags', r'.*EXTRACXXFLAGS\s*[\+]?=([^\n]+)'),
|
||||
('extracflags', r'.*EXTRACFLAGS\s*[\+]?=\s*([^\s]+)\s*'),
|
||||
('priority', r'.*MODULE_PRIORITY\s*[\+]?=\s*([^\s]+)\s*'),
|
||||
('maxoptimization', r'.*MAXOPTIMIZATION\s*[\+]?=\s*([^\s]+)\s*'),
|
||||
('srcs', '.*SRCS\s*[\+]?=([^\n\\\]*([\\\]\s*\n[^\n\\\]*)*)'),
|
||||
('include_dirs', '.*INCLUDE_DIRS\s*[\+]?=([^\n\\\]*([\\\]\s*\n[^\n\\\]*)*)'),
|
||||
]
|
||||
|
||||
progs = {}
|
||||
for name, re_str in search_data:
|
||||
progs[name] = re.compile(re_str)
|
||||
|
||||
for module_file in module_files:
|
||||
|
||||
data = {}
|
||||
with open(module_file, 'r') as f:
|
||||
module_text = f.read()
|
||||
data['text'] = module_text
|
||||
module_dir = os.path.dirname(module_file)
|
||||
data['module'] = os.path.relpath(module_dir, src_path).replace(
|
||||
os.sep, '__').split('.')[0]
|
||||
#print(module_text)
|
||||
for name, re_str in search_data:
|
||||
result = progs[name].search(module_text)
|
||||
if result is not None:
|
||||
d = result.group(1).strip()
|
||||
if name in ['srcs', 'extracxxflags', 'extracflags']:
|
||||
d_store = d.replace('\\', '').split()
|
||||
elif name == 'include_dirs':
|
||||
d_store = d.replace('(', '{').replace(')', '}').split()
|
||||
else:
|
||||
d_store = d
|
||||
data[name] = d_store
|
||||
else:
|
||||
data[name] = ''
|
||||
|
||||
cmake_file = os.path.join(os.path.dirname(module_file), 'CMakeLists.txt')
|
||||
cmake_file_backup = cmake_file + '.backup'
|
||||
|
||||
if os.path.exists(cmake_file):
|
||||
if args.backup:
|
||||
if os.path.exists(cmake_file_backup):
|
||||
print('error: file already exists:', cmake_file_backup)
|
||||
continue
|
||||
else:
|
||||
shutil.copyfile(cmake_file, cmake_file_backup)
|
||||
if args.overwrite:
|
||||
print('overwriting', cmake_file)
|
||||
else:
|
||||
print('error: file already exists:', cmake_file)
|
||||
continue
|
||||
|
||||
with open(cmake_file, 'w') as f:
|
||||
data_rendered = cmake_template.render(data=data)
|
||||
f.write(data_rendered)
|
||||
|
||||
|
||||
# vim: set et fenc= ff=unix sts=4 sw=4 ts=4 :
|
||||
@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
This runs a command and compares output to a known file over
|
||||
a given line range.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import subprocess
|
||||
import argparse
|
||||
import os
|
||||
|
||||
|
||||
#pylint: disable=invalid-name
|
||||
parser = argparse.ArgumentParser(description='Process some integers.')
|
||||
parser.add_argument('--command', required=True)
|
||||
parser.add_argument('--stdin', required=True)
|
||||
parser.add_argument('--stdout', required=True)
|
||||
parser.add_argument('--check', required=True)
|
||||
parser.add_argument('--start', default=0)
|
||||
parser.add_argument('--stop', default=-1)
|
||||
args = parser.parse_args()
|
||||
|
||||
d = os.path.dirname(args.stdout)
|
||||
if not os.path.exists(d):
|
||||
os.makedirs(d)
|
||||
|
||||
with open(args.stdout, 'w') as outfile:
|
||||
with open(args.stdin, 'r') as infile:
|
||||
proc = subprocess.Popen(
|
||||
args.command, stdout=outfile, stdin=infile)
|
||||
proc.communicate()
|
||||
|
||||
i_start = int(args.start)
|
||||
i_stop = int(args.stop)
|
||||
|
||||
with open(args.stdout, 'r') as outfile:
|
||||
out_contents = file.readlines(outfile)
|
||||
out_contents = "".join(out_contents[i_start:i_stop])
|
||||
|
||||
with open(args.check, 'r') as checkfile:
|
||||
check_contents = file.readlines(checkfile)
|
||||
check_contents = "".join(check_contents[i_start:i_stop])
|
||||
|
||||
if (out_contents != check_contents):
|
||||
print("output:\n", out_contents)
|
||||
print("check:\n", check_contents)
|
||||
exit(1)
|
||||
|
||||
exit(0)
|
||||
|
||||
# vim: set et ft=python fenc= ff=unix sts=4 sw=4 ts=4 :
|
||||
@ -2,7 +2,7 @@ INFO Shell id is 47996278451456
|
||||
WARN 1 starting task wkr_high (file /home/jgoppert/git/px4/cmake-Firmware/src/platforms/posix/px4_layer/px4_posix_tasks.cpp line 146)
|
||||
WARN 54 starting task wkr_low (file /home/jgoppert/git/px4/cmake-Firmware/src/platforms/posix/px4_layer/px4_posix_tasks.cpp line 146)
|
||||
WARN 100 starting task wkr_hrt (file /home/jgoppert/git/px4/cmake-Firmware/src/platforms/posix/px4_layer/px4_posix_tasks.cpp line 146)
|
||||
App name: mainapp
|
||||
App name: px4
|
||||
Enter a command and its args:
|
||||
----------------------------------
|
||||
Running: uorb
|
||||
|
||||
@ -71,7 +71,7 @@ foreach(tool echo grep rm mkdir nm cp touch make unzip)
|
||||
endforeach()
|
||||
|
||||
add_definitions(
|
||||
-D __RPI2
|
||||
-D __RPI
|
||||
)
|
||||
|
||||
set(LINKER_FLAGS "-Wl,-gc-sections")
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.432866957" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
@ -105,23 +105,32 @@
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
|
||||
<buildTargets>
|
||||
<target name="px4fmu-v1_default" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>px4fmu-v1_default</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="px4fmu-v2_default" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>px4fmu-v2_default</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="px4fmu-v2_default upload" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<target name="px4fmu-v4_default" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>px4fmu-v2_default upload</buildTarget>
|
||||
<buildTarget>px4fmu-v4_default</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
@ -129,54 +138,46 @@
|
||||
</target>
|
||||
<target name="posix_sitl_default" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>posix_sitl_default</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="px4fmu-v1_default" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<target name="check" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildTarget>px4fmu-v1_default</buildTarget>
|
||||
<buildTarget>check</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="distclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildTarget>distclean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="px4fmu-v4_default" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>px4fmu-v4_default</buildTarget>
|
||||
<buildTarget>distclean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="tests" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>tests</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="check" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<target name="submodulesclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>check</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<buildTarget>submodulesclean</buildTarget>
|
||||
<stopOnError>false</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
@ -17,9 +17,9 @@
|
||||
|
||||
connection_string = '127.0.0.1:14540'
|
||||
|
||||
import_mission_filename = 'VTOLmission.txt'
|
||||
max_execution_time = 250
|
||||
alt_acceptance_radius = 10
|
||||
import_mission_filename = 'VTOL_TAKEOFF.mission'
|
||||
max_execution_time = 200
|
||||
alt_acceptance_radius = 5
|
||||
|
||||
################################################################################################
|
||||
# Init
|
||||
@ -150,14 +150,14 @@ def save_mission(aFileName):
|
||||
Save a mission in the Waypoint file format
|
||||
(http://qgroundcontrol.org/mavlink/waypoint_protocol#waypoint_file_format).
|
||||
"""
|
||||
print "\nSave mission from Vehicle to file: %s" % export_mission_filename
|
||||
print "\nSave mission from Vehicle to file: %s" % aFileName
|
||||
#Download mission from vehicle
|
||||
missionlist = download_mission()
|
||||
#Add file-format information
|
||||
output='QGC WPL 110\n'
|
||||
#Add home location as 0th waypoint
|
||||
home = vehicle.home_location
|
||||
output+="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (0,1,0,16,0,0,0,0,home.lat,home.lon,home.alt,1)
|
||||
output+="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n\n\n" % (0,1,0,16,0,0,0,0,home.lat,home.lon,home.alt,1)
|
||||
#Add commands
|
||||
for cmd in missionlist:
|
||||
commandline="%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (cmd.seq,cmd.current,cmd.frame,cmd.command,cmd.param1,cmd.param2,cmd.param3,cmd.param4,cmd.x,cmd.y,cmd.z,cmd.autocontinue)
|
||||
@ -0,0 +1,5 @@
|
||||
QGC WPL 110
|
||||
1 0 3 84 0.0 0.0 -0.0 0.0 47.3975105286 8.55026626587 10.0 1
|
||||
1 0 3 16 0.0 0.0 -0.0 0.0 47.395450592 8.55018424988 10.0 1
|
||||
2 0 3 16 0.0 0.0 -0.0 0.0 47.3954582214 8.54566764832 10.0 1
|
||||
3 0 3 85 0.0 0.0 -0.0 0.0 47.3977355957 8.54561138153 10.0 1
|
||||
301
integrationtests/python_src/px4_it/mavros/mission_test.py
Executable file
301
integrationtests/python_src/px4_it/mavros/mission_test.py
Executable file
@ -0,0 +1,301 @@
|
||||
#!/usr/bin/env python
|
||||
#***************************************************************************
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#***************************************************************************/
|
||||
|
||||
#
|
||||
# @author Andreas Antener <andreas@uaventure.com>
|
||||
#
|
||||
PKG = 'px4'
|
||||
|
||||
import unittest
|
||||
import rospy
|
||||
import math
|
||||
import rosbag
|
||||
import sys
|
||||
import os
|
||||
|
||||
import mavros
|
||||
from pymavlink import mavutil
|
||||
from mavros import mavlink
|
||||
|
||||
from geometry_msgs.msg import PoseStamped
|
||||
from mavros_msgs.srv import CommandLong, WaypointPush
|
||||
from mavros_msgs.msg import Mavlink, Waypoint, ExtendedState
|
||||
from sensor_msgs.msg import NavSatFix
|
||||
from mavros.mission import QGroundControlWP
|
||||
#from px4_test_helper import PX4TestHelper
|
||||
|
||||
class MavrosMissionTest(unittest.TestCase):
|
||||
"""
|
||||
Run a mission
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
rospy.init_node('test_node', anonymous=True)
|
||||
|
||||
self.rate = rospy.Rate(10) # 10hz
|
||||
self.has_global_pos = False
|
||||
self.local_position = PoseStamped()
|
||||
self.global_position = NavSatFix()
|
||||
self.extended_state = ExtendedState()
|
||||
self.home_alt = 0
|
||||
self.mc_rad = 5
|
||||
self.fw_rad = 60
|
||||
self.fw_alt_rad = 10
|
||||
self.last_alt_d = 9999
|
||||
self.last_pos_d = 9999
|
||||
self.mission_name = ""
|
||||
|
||||
# need to simulate heartbeat for datalink loss detection
|
||||
rospy.Timer(rospy.Duration(0.5), self.send_heartbeat)
|
||||
|
||||
rospy.wait_for_service('mavros/cmd/command', 30)
|
||||
self.pub_mavlink = rospy.Publisher('mavlink/to', Mavlink, queue_size=1)
|
||||
self._srv_cmd_long = rospy.ServiceProxy('mavros/cmd/command', CommandLong, persistent=True)
|
||||
self._srv_wp_push = rospy.ServiceProxy('mavros/mission/push', WaypointPush, persistent=True)
|
||||
|
||||
rospy.Subscriber("mavros/local_position/pose", PoseStamped, self.position_callback)
|
||||
rospy.Subscriber("mavros/global_position/global", NavSatFix, self.global_position_callback)
|
||||
rospy.Subscriber("mavros/extended_state", ExtendedState, self.extended_state_callback)
|
||||
|
||||
def tearDown(self):
|
||||
#self.helper.tearDown()
|
||||
pass
|
||||
|
||||
#
|
||||
# General callback functions used in tests
|
||||
#
|
||||
def position_callback(self, data):
|
||||
self.local_position = data
|
||||
|
||||
def global_position_callback(self, data):
|
||||
self.global_position = data
|
||||
|
||||
if not self.has_global_pos:
|
||||
self.home_alt = data.altitude
|
||||
self.has_global_pos = True
|
||||
|
||||
def extended_state_callback(self, data):
|
||||
self.extended_state = data
|
||||
|
||||
#
|
||||
# Helper methods
|
||||
#
|
||||
def is_at_position(self, lat, lon, alt, xy_offset, z_offset):
|
||||
R = 6371000 # metres
|
||||
rlat1 = math.radians(lat)
|
||||
rlat2 = math.radians(self.global_position.latitude)
|
||||
|
||||
rlat_d = math.radians(self.global_position.latitude - lat)
|
||||
rlon_d = math.radians(self.global_position.longitude - lon)
|
||||
|
||||
a = (math.sin(rlat_d / 2) * math.sin(rlat_d / 2) +
|
||||
math.cos(rlat1) * math.cos(rlat2) *
|
||||
math.sin(rlon_d / 2) * math.sin(rlon_d / 2))
|
||||
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
|
||||
|
||||
d = R * c
|
||||
alt_d = abs(alt - self.global_position.altitude)
|
||||
|
||||
#rospy.loginfo("d: %f, alt_d: %f", d, alt_d)
|
||||
|
||||
# remember best distances
|
||||
if self.last_pos_d > d:
|
||||
self.last_pos_d = d
|
||||
if self.last_alt_d > alt_d:
|
||||
self.last_alt_d = alt_d
|
||||
|
||||
return d < xy_offset and alt_d < z_offset
|
||||
|
||||
def reach_position(self, lat, lon, alt, timeout, index):
|
||||
# reset best distances
|
||||
self.last_alt_d = 9999
|
||||
self.last_pos_d = 9999
|
||||
|
||||
rospy.loginfo("trying to reach waypoint " +
|
||||
"lat: %f, lon: %f, alt: %f, timeout: %d, index: %d" %
|
||||
(lat, lon, alt, timeout, index))
|
||||
|
||||
# does it reach the position in X seconds?
|
||||
count = 0
|
||||
while count < timeout:
|
||||
# use MC radius by default
|
||||
# FIXME: also check MAV_TYPE from system status, otherwise pure fixed-wing won't work
|
||||
xy_radius = self.mc_rad
|
||||
z_radius = self.mc_rad
|
||||
|
||||
# use FW radius if in FW or in transition
|
||||
if (self.extended_state.vtol_state == ExtendedState.VTOL_STATE_FW or
|
||||
self.extended_state.vtol_state == ExtendedState.VTOL_STATE_TRANSITION_TO_MC or
|
||||
self.extended_state.vtol_state == ExtendedState.VTOL_STATE_TRANSITION_TO_FW):
|
||||
xy_radius = self.fw_rad
|
||||
z_radius = self.fw_alt_rad
|
||||
|
||||
if self.is_at_position(lat, lon, alt, xy_radius, z_radius):
|
||||
rospy.loginfo("position reached, index: %d, count: %d, pos_d: %f, alt_d: %f" %
|
||||
(index, count, self.last_pos_d, self.last_alt_d))
|
||||
break
|
||||
|
||||
count = count + 1
|
||||
self.rate.sleep()
|
||||
|
||||
self.assertTrue(count < timeout, (("(%s) took too long to get to position " +
|
||||
"lat: %f, lon: %f, alt: %f, xy off: %f, z off: %f, timeout: %d, index: %d, pos_d: %f, alt_d: %f") %
|
||||
(self.mission_name, lat, lon, alt, xy_radius, z_radius, timeout, index, self.last_pos_d, self.last_alt_d)))
|
||||
|
||||
def run_mission(self):
|
||||
"""switch mode: armed | auto"""
|
||||
self._srv_cmd_long(False, 176, False,
|
||||
# arm | custom, auto, mission
|
||||
128 | 1, 4, 4, 0, 0, 0, 0)
|
||||
|
||||
def wait_until_ready(self):
|
||||
"""FIXME: hack to wait for simulation to be ready"""
|
||||
while not self.has_global_pos:
|
||||
self.rate.sleep()
|
||||
|
||||
def wait_on_landing(self, timeout, index):
|
||||
"""Wait for landed state"""
|
||||
|
||||
rospy.loginfo("waiting for landing " +
|
||||
"timeout: %d, index: %d" %
|
||||
(timeout, index))
|
||||
|
||||
count = 0
|
||||
while count < timeout:
|
||||
if self.extended_state.landed_state == ExtendedState.LANDED_STATE_ON_GROUND:
|
||||
break
|
||||
|
||||
count = count + 1
|
||||
self.rate.sleep()
|
||||
|
||||
self.assertTrue(count < timeout, ("(%s) landing not detected after landing WP " +
|
||||
"timeout: %d, index: %d") %
|
||||
(self.mission_name, timeout, index))
|
||||
|
||||
def wait_on_transition(self, transition, timeout, index):
|
||||
"""Wait for VTOL transition"""
|
||||
|
||||
rospy.loginfo("waiting for VTOL transition " +
|
||||
"transition: %d, timeout: %d, index: %d" %
|
||||
(transition, timeout, index))
|
||||
|
||||
count = 0
|
||||
while count < timeout:
|
||||
# transition to MC
|
||||
if (transition == ExtendedState.VTOL_STATE_MC and
|
||||
self.extended_state.vtol_state == ExtendedState.VTOL_STATE_MC):
|
||||
break
|
||||
|
||||
# transition to FW
|
||||
if (transition == ExtendedState.VTOL_STATE_FW and
|
||||
self.extended_state.vtol_state == ExtendedState.VTOL_STATE_FW):
|
||||
break
|
||||
|
||||
count = count + 1
|
||||
self.rate.sleep()
|
||||
|
||||
self.assertTrue(count < timeout, ("(%s) transition not detected " +
|
||||
"timeout: %d, index: %d") %
|
||||
(self.mission_name, timeout, index))
|
||||
|
||||
def send_heartbeat(self, event=None):
|
||||
# mav type gcs
|
||||
mavmsg = mavutil.mavlink.MAVLink_heartbeat_message(6, 0, 0, 0, 0, 0)
|
||||
# XXX: hack: using header object to set mav properties
|
||||
mavmsg.pack(mavutil.mavlink.MAVLink_header(0, 0, 0, 2, 1))
|
||||
rosmsg = mavlink.convert_to_rosmsg(mavmsg)
|
||||
self.pub_mavlink.publish(rosmsg)
|
||||
|
||||
def test_mission(self):
|
||||
"""Test mission"""
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
self.fail("usage: mission_test.py mission_file")
|
||||
return
|
||||
|
||||
self.mission_name = sys.argv[1]
|
||||
mission_file = os.path.dirname(os.path.realpath(__file__)) + "/" + sys.argv[1]
|
||||
|
||||
rospy.loginfo("reading mission %s", mission_file)
|
||||
mission = QGroundControlWP()
|
||||
wps = []
|
||||
for waypoint in mission.read(open(mission_file, 'r')):
|
||||
wps.append(waypoint)
|
||||
rospy.logdebug(waypoint)
|
||||
|
||||
rospy.loginfo("wait until ready")
|
||||
self.wait_until_ready()
|
||||
|
||||
rospy.loginfo("send mission")
|
||||
res = self._srv_wp_push(wps)
|
||||
rospy.loginfo(res)
|
||||
self.assertTrue(res.success, "(%s) mission could not be transfered" % self.mission_name)
|
||||
|
||||
rospy.loginfo("run mission")
|
||||
self.run_mission()
|
||||
|
||||
index = 0
|
||||
for waypoint in wps:
|
||||
# only check position for waypoints where this makes sense
|
||||
if waypoint.frame == Waypoint.FRAME_GLOBAL_REL_ALT or waypoint.frame == Waypoint.FRAME_GLOBAL:
|
||||
alt = waypoint.z_alt
|
||||
if waypoint.frame == Waypoint.FRAME_GLOBAL_REL_ALT:
|
||||
alt += self.home_alt
|
||||
self.reach_position(waypoint.x_lat, waypoint.y_long, alt, 600, index)
|
||||
|
||||
# check if VTOL transition happens if applicable
|
||||
if waypoint.command == 84 or waypoint.command == 85 or waypoint.command == 3000:
|
||||
transition = waypoint.param1
|
||||
|
||||
if waypoint.command == 84: # VTOL takeoff implies transition to FW
|
||||
transition = ExtendedState.VTOL_STATE_FW
|
||||
|
||||
if waypoint.command == 85: # VTOL takeoff implies transition to MC
|
||||
transition = ExtendedState.VTOL_STATE_MC
|
||||
|
||||
self.wait_on_transition(transition, 600, index)
|
||||
|
||||
# after reaching position, wait for landing detection if applicable
|
||||
if waypoint.command == 85 or waypoint.command == 21:
|
||||
self.wait_on_landing(600, index)
|
||||
|
||||
index += 1
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import rostest
|
||||
name = "mavros_mission_test"
|
||||
if len(sys.argv) > 1:
|
||||
name += "-%s" % sys.argv[1]
|
||||
rostest.rosrun(PKG, name, MavrosMissionTest)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user