mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-08 06:00:05 +08:00
Compare commits
985 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0ee5256d5 | |||
| bdb76d013e | |||
| 1fbc688757 | |||
| 9442c89691 | |||
| 1424994bc0 | |||
| dd1ca0daa2 | |||
| 6906d966ce | |||
| 0c49abbef8 | |||
| 6b08ba6272 | |||
| e3ef206846 | |||
| 1941dfca87 | |||
| c2b6381759 | |||
| 5ed35e9731 | |||
| 6865a70dea | |||
| fc9f2143d2 | |||
| 78f1d9d017 | |||
| 13df03c78a | |||
| fa834497bf | |||
| 7b81374fda | |||
| 162c0a7418 | |||
| 176c6e0df2 | |||
| e4e5a77f71 | |||
| e3537ca6c2 | |||
| aabf753ecb | |||
| f15d1ce5e7 | |||
| 77298e42db | |||
| 69cc4d7e7f | |||
| 9d494e625f | |||
| a8747a01fe | |||
| 2c23c16b4f | |||
| 3294d839d6 | |||
| 2f962a986b | |||
| 1a1b8f69ac | |||
| 1b19b78c2b | |||
| b229dd891f | |||
| 3166aeb8a4 | |||
| 9f14ace0fa | |||
| 4b6a11161e | |||
| d71645b321 | |||
| 64657900de | |||
| 899fb8d3c5 | |||
| ef495d26b8 | |||
| e9737d6f7a | |||
| c069264752 | |||
| b531e65f6a | |||
| f772fc2d02 | |||
| f092b31f54 | |||
| c53d828e09 | |||
| 654c7d2d16 | |||
| fee75c61a1 | |||
| e416a8cb83 | |||
| b982dca45a | |||
| 10867131fa | |||
| 126172d70c | |||
| 9bb77adbec | |||
| b020be13f6 | |||
| a0796c6847 | |||
| e0a9793347 | |||
| abc79faf3b | |||
| 0109f6f549 | |||
| 780e903d5b | |||
| 2fb09b7978 | |||
| f51595ab16 | |||
| 8fe765c3aa | |||
| 9befff1e79 | |||
| 621a0fe492 | |||
| 8fb15f1de8 | |||
| c49c3f469e | |||
| 6af31a109f | |||
| 4989f8d40a | |||
| 508c782bab | |||
| 1360c26c62 | |||
| 4943437327 | |||
| 873901c7cd | |||
| 8f0322b8aa | |||
| 66628a4cf1 | |||
| fdb5a92873 | |||
| f5c65cf206 | |||
| 99bb7be10f | |||
| 3b3d4f385c | |||
| 1eadee19c3 | |||
| 893714dc6a | |||
| 15c75ebb40 | |||
| effdb37a2b | |||
| ce8a7f6bdc | |||
| 1aea9457a9 | |||
| 51f85858f2 | |||
| 7ced5a1b6f | |||
| 0f9ad1c393 | |||
| 8788e2e81e | |||
| 007731df46 | |||
| e690af14d8 | |||
| ef7c3b2174 | |||
| a1eec553dc | |||
| cf07fa3a1c | |||
| 0cd7984b7f | |||
| 4b90daf605 | |||
| 100f977b0c | |||
| c042f49fde | |||
| 5b5076ae01 | |||
| fb3e2665f3 | |||
| 70e597bd9a | |||
| cf9945ecdc | |||
| 707666488e | |||
| fdc489358a | |||
| 0a0f268407 | |||
| 6680af0d96 | |||
| 9230f419e5 | |||
| f559b6ca88 | |||
| afd6fd3896 | |||
| 109558cf1f | |||
| 43caf2b683 | |||
| 87f0ec19e4 | |||
| f8f12ee265 | |||
| d77547e7e1 | |||
| 92a5db92a2 | |||
| 7a698952fb | |||
| 4ea72f35ed | |||
| dd1821b02e | |||
| 59c1dd7183 | |||
| d720cbe189 | |||
| fe9ffb824c | |||
| 912ed98a28 | |||
| a61b1e089c | |||
| 9f57ee8564 | |||
| 76f862de33 | |||
| 7ba49aeb80 | |||
| ae7f61b0bf | |||
| 1e1bf7e4bb | |||
| 8155044b40 | |||
| f80b4f8732 | |||
| b3f9114b1c | |||
| d4c87d62f1 | |||
| 0e481a5d00 | |||
| b2410460a5 | |||
| 937c5adfc0 | |||
| 0d7189c894 | |||
| 89f81cb626 | |||
| c17c8884d1 | |||
| 6cdd188158 | |||
| c701085ed4 | |||
| 6f10f8de9a | |||
| 9e589cef48 | |||
| 46a697787f | |||
| 0fa79eab5c | |||
| 90c049d8ec | |||
| cd40512505 | |||
| 96fc66ff7d | |||
| e284a28e25 | |||
| 4edd12c44a | |||
| 81dc20ea86 | |||
| 9301e9cc50 | |||
| 983cfb8fdd | |||
| 55bf6b4974 | |||
| c07f7b5659 | |||
| 06aca33085 | |||
| 2799c0fae2 | |||
| 37641042cc | |||
| a634c14582 | |||
| a94c8d7812 | |||
| dd8d178168 | |||
| 8a2399eee1 | |||
| 0eadf26d34 | |||
| 1f0e630958 | |||
| 616c5012da | |||
| 8ebc846ae7 | |||
| b83363a518 | |||
| 9ff1feb92f | |||
| 056ac3c9c6 | |||
| 680a8f0b44 | |||
| 72ad6627e1 | |||
| 5435b99f86 | |||
| e4f5710ec3 | |||
| f00f6e6eff | |||
| 1223e4ba6b | |||
| 106c882cea | |||
| d550290e63 | |||
| 0734db1740 | |||
| 3414fc1c7c | |||
| 25d1daa7a5 | |||
| 53c23e7bff | |||
| 0ca397ab20 | |||
| 2f19aebac0 | |||
| 896118281c | |||
| 9221c74e46 | |||
| 7106881cbc | |||
| 12ddf9d25e | |||
| eec55a0918 | |||
| dc6ca7c372 | |||
| 14fd1b8693 | |||
| d54e22614f | |||
| a96ee50442 | |||
| 0fbf26e955 | |||
| de85fbe1dc | |||
| ebeb187522 | |||
| 04aa2bb3a4 | |||
| 86c581b2ef | |||
| 9866ff8959 | |||
| 83e9e1c382 | |||
| 697d401b73 | |||
| 77a23a043f | |||
| 92ae763535 | |||
| 40f2c4a8e4 | |||
| bdec646736 | |||
| ab76a37910 | |||
| 47c14395d3 | |||
| 6bdca1053c | |||
| 88e81aa58e | |||
| 068ef591ab | |||
| 4d6d0b2850 | |||
| 3511f8abfb | |||
| d1d47c4c27 | |||
| 18d69698a0 | |||
| 7e312f3961 | |||
| 8ddda0a8fa | |||
| 278d63eef6 | |||
| 7df11b900d | |||
| d0b1983784 | |||
| 1e617f362d | |||
| 643ccd66b6 | |||
| d32d250a50 | |||
| 66ffc834d3 | |||
| 246dc5421b | |||
| d19a62a8f6 | |||
| d75600b8a4 | |||
| 0ee75dbc6b | |||
| 08a380ae2d | |||
| 5ac73f3440 | |||
| 699edd2535 | |||
| ef7ed97cbd | |||
| 7d0d29f62d | |||
| 7be71459f5 | |||
| 9180268a17 | |||
| 8ac4dd04ae | |||
| 223595e978 | |||
| d1a3261e81 | |||
| 5bcfa3c7e6 | |||
| f7e3e46a92 | |||
| cc27d2a1e0 | |||
| 53cf27eb84 | |||
| 85cee9460f | |||
| 0f2b31b41e | |||
| 309c256e9e | |||
| 53e0bc5f12 | |||
| bae8adc1a8 | |||
| f44ab6f05d | |||
| 2bfac7ff4f | |||
| bf9a1c5a18 | |||
| 2d451991af | |||
| b2b9a0be9f | |||
| d77e107e31 | |||
| ab43baa02d | |||
| c4d91ef644 | |||
| fd797ae3b4 | |||
| 9603794b9d | |||
| 03beeb2e55 | |||
| fc73ab5e40 | |||
| a8369c6ac8 | |||
| 39cc75b4a0 | |||
| 4bcf2cdb52 | |||
| 09d36a63ef | |||
| ab4d7dfc59 | |||
| 587c5161a3 | |||
| fa461d018d | |||
| 25be7aa7cf | |||
| 76082da674 | |||
| c5100b6273 | |||
| 8b237d7cf3 | |||
| 10491884ca | |||
| 32403ddb90 | |||
| 6cbd398974 | |||
| 4b8fc2365e | |||
| 4c0c526898 | |||
| cdd317ba38 | |||
| 93fb02bfa3 | |||
| 00cd2902c7 | |||
| 2908f1c16d | |||
| 27a50275b6 | |||
| 0bff3593d3 | |||
| 52b8e75aea | |||
| 278124bfb8 | |||
| b280e28623 | |||
| f17dc2f2a6 | |||
| d6ed416d29 | |||
| cabcc39816 | |||
| 53b4996379 | |||
| b76c8cd80c | |||
| 016aa47dfc | |||
| 2b23835d56 | |||
| d8ac044414 | |||
| 5076ba0049 | |||
| 99ad8f464e | |||
| 93343487e7 | |||
| c9f0d1e645 | |||
| b9cf679118 | |||
| b3e948d28c | |||
| 62603bee45 | |||
| 0a043365ec | |||
| 90f3e3b5d3 | |||
| baf89f4398 | |||
| e29b9b5d39 | |||
| ae2aeab5e4 | |||
| 5b52cd0fe6 | |||
| 1999ed2601 | |||
| a2c493efc7 | |||
| d37a927cdb | |||
| 7ae749090b | |||
| 4cc97aa705 | |||
| 95f5ba9635 | |||
| cbbee30e48 | |||
| c8a79d2443 | |||
| 3029555016 | |||
| d0dace7c23 | |||
| f466913a32 | |||
| f9abe39c3a | |||
| 3bed398a1e | |||
| 8d51e4ade1 | |||
| 05bc9acfb7 | |||
| 5ddd69c872 | |||
| c7cdef2a4b | |||
| 0a4fedd778 | |||
| 9e7d5f088e | |||
| ff0d7613b1 | |||
| db774798fa | |||
| c340974991 | |||
| eaae1abdaf | |||
| 9821499113 | |||
| 5899ce715d | |||
| 4160b65edb | |||
| 82f27884df | |||
| 032f4df3de | |||
| dcd0df7d02 | |||
| 4f5fa50efb | |||
| 72e46e7ed0 | |||
| ff415a4f1d | |||
| 3a332bb11a | |||
| 9b0ab83f9b | |||
| eff6a7b5d0 | |||
| 9448e0d673 | |||
| f7d8612bc9 | |||
| 7c6d99d30f | |||
| 09d8e4fd8c | |||
| 1bdad65849 | |||
| 4da2ae2302 | |||
| c50e4a6e21 | |||
| 03c12c4c78 | |||
| a5e6f3213f | |||
| 64df463a85 | |||
| 7140914d38 | |||
| f244a78368 | |||
| 4120cd93df | |||
| 296b07f9d8 | |||
| 3aa9a72562 | |||
| 06ad477847 | |||
| 79ec263b1e | |||
| 6a3b147477 | |||
| a2ad92b2d7 | |||
| bdfb2bbb8d | |||
| b75ff417ea | |||
| 6fc30c76a6 | |||
| c200ef88ed | |||
| d57e9f13d7 | |||
| d1822699a9 | |||
| a14c565ab1 | |||
| 78b0d1a01f | |||
| 2fff2ab9ac | |||
| 10c4ec2e1a | |||
| 0002e86b6f | |||
| 7ed81e5edb | |||
| 7415d94e12 | |||
| 3fda48517d | |||
| 7b2898eaee | |||
| 3f5f74399e | |||
| f7f406c45d | |||
| 6f7a5cdf9b | |||
| 210b5704a9 | |||
| 3bb479f72e | |||
| 7c40c8dfd9 | |||
| 9272aa592a | |||
| b2d45732c2 | |||
| 318c970477 | |||
| 8f5656f033 | |||
| 326800e5a8 | |||
| 8e0d548f51 | |||
| 6999bb3e9a | |||
| 7d72f31a29 | |||
| 57d85de4d1 | |||
| f29a50df31 | |||
| 2dc59efbb6 | |||
| b7d07d77d6 | |||
| b233753e23 | |||
| 8ea38bc278 | |||
| 7a60c1296e | |||
| 12ded377d1 | |||
| de20f1778e | |||
| 1ddddccb81 | |||
| 78f19fccce | |||
| ccdaabc7fb | |||
| 4e1a4440ca | |||
| c26e29d11c | |||
| 14b0511c6c | |||
| 21bc78dedc | |||
| 3696e7722a | |||
| a12780c88f | |||
| 5317d29ffd | |||
| af5d2c488c | |||
| ffaed18e67 | |||
| ffe4c77dc9 | |||
| 062df05865 | |||
| 2c23aa4348 | |||
| 9bb230fa3d | |||
| 43d8e5710c | |||
| 7a7bf2205d | |||
| 17a4b64434 | |||
| 7c2ebd96a0 | |||
| 06931e12cf | |||
| d086a348aa | |||
| 7cb06c01eb | |||
| 51941b0af8 | |||
| a978d61d9a | |||
| 3faaeb06d1 | |||
| ee314d2f50 | |||
| f1e5fe9b39 | |||
| 57f193174c | |||
| b035b6a112 | |||
| 5d9c91dece | |||
| 526fb8f515 | |||
| d349bd570f | |||
| 0bd42402fb | |||
| 13833e5fd6 | |||
| ac936a28dd | |||
| 873ed17b14 | |||
| affefcc75e | |||
| 56b2fd0257 | |||
| 38b949a5aa | |||
| 0d0fa133e6 | |||
| eb18622d85 | |||
| b8a219d351 | |||
| 5e0e522903 | |||
| 215bfaa377 | |||
| 78c52be08c | |||
| e2c308c4e6 | |||
| 340b9002e2 | |||
| b5b077ae04 | |||
| 75657dc2eb | |||
| 0a4ca7c77f | |||
| f8a1631077 | |||
| e4398c7088 | |||
| c2285c84a9 | |||
| ecbe8c2179 | |||
| 86ec703620 | |||
| bb71aa5b64 | |||
| b2bf9e15eb | |||
| b1e94b98b3 | |||
| 44b5b52bcb | |||
| 979381fcfa | |||
| 24e20b2cec | |||
| 1152b68a28 | |||
| dce2262243 | |||
| 0544a6ee32 | |||
| e73218c112 | |||
| cd937321c8 | |||
| 7eabf1ccb3 | |||
| 8450178849 | |||
| 9842e49dc6 | |||
| eb51184bbd | |||
| 2d039af7a4 | |||
| 8bbc1b8472 | |||
| 36b2e4be09 | |||
| 9c82293bc4 | |||
| 3ffff212e1 | |||
| 35bf165190 | |||
| 02c3ea0a5b | |||
| 865b6404ec | |||
| ed0cc2af43 | |||
| 7a9e3002ff | |||
| 23a379a6bf | |||
| dbd94907c4 | |||
| 43b665ae01 | |||
| cf658638f4 | |||
| db44129ec0 | |||
| f30dd2b819 | |||
| 027badc340 | |||
| 1cb180728e | |||
| c6015e65d0 | |||
| b4e85d1273 | |||
| 569cceb059 | |||
| e9bce5dd71 | |||
| 69551141b7 | |||
| c87933d556 | |||
| 7cdf9c31bf | |||
| f6ad9b8283 | |||
| d80a233bcb | |||
| bef4850ae3 | |||
| 6eabf80f2a | |||
| fa47569aa5 | |||
| b6d69ca3aa | |||
| c0fe08a203 | |||
| bc530ea992 | |||
| 66e887e581 | |||
| 5a69f4560a | |||
| 2bda15d72b | |||
| ad65e56f47 | |||
| e9e15ba3d1 | |||
| f3b5c243e5 | |||
| 9a219da9c2 | |||
| c2e0246650 | |||
| 710a8e8f56 | |||
| 0f763768b1 | |||
| ddea179e95 | |||
| 2771b92dc0 | |||
| cdc1c5c7a4 | |||
| ed62957474 | |||
| 4cfd84b56a | |||
| 9d2b5b1c28 | |||
| a56d50599d | |||
| 605cffc230 | |||
| e73cd08a30 | |||
| 55bff206be | |||
| 248cd45503 | |||
| 1c766aef12 | |||
| 5cd85b98c2 | |||
| f543463349 | |||
| 9ceb5a7e2e | |||
| bad107a374 | |||
| b864983c5e | |||
| a42f0f5a62 | |||
| 6d0288d494 | |||
| 80771ce8b3 | |||
| c6f43689e7 | |||
| 2799525462 | |||
| 9bd3f6c9bf | |||
| e7b582502a | |||
| 96a5baa12b | |||
| 56ef984529 | |||
| b9728ecf39 | |||
| 7e0946466e | |||
| 6bb03f3665 | |||
| bc44ba2907 | |||
| 71e87cf287 | |||
| fde165b4f1 | |||
| 57d7a00261 | |||
| 6d41ab9e16 | |||
| c81a1631ec | |||
| 9500b7f01f | |||
| ec1609350f | |||
| 29a4113ce3 | |||
| cb5728297e | |||
| 03bfcae351 | |||
| 7c2798269c | |||
| 2f6abf26a3 | |||
| c24046ca5b | |||
| 93ad4fa440 | |||
| 74b2780874 | |||
| 4c04b7bb53 | |||
| fe40e9cfae | |||
| f6bed6f2d2 | |||
| 91f92aa7d3 | |||
| 0027333e6d | |||
| cf8f484868 | |||
| c2a511d81d | |||
| cced6fc8b2 | |||
| 8b889caa33 | |||
| 2607769470 | |||
| 66ddea01d1 | |||
| b6b8892606 | |||
| 489f63a3d3 | |||
| 76733ce54b | |||
| 549d456ec7 | |||
| e061842219 | |||
| 98ac60e3fd | |||
| 50b8ed0a89 | |||
| ce0d31b7d9 | |||
| 241fd629ce | |||
| c606554da3 | |||
| cf5338df02 | |||
| 27aaf244af | |||
| d7ed47e2e5 | |||
| ac189704ed | |||
| f25947b964 | |||
| 1d111cb254 | |||
| a51d1bc5dc | |||
| 35e93c24e8 | |||
| 763d2d0447 | |||
| 17a1d31b79 | |||
| 69f6708f37 | |||
| 7f8f6c3879 | |||
| b1708f3871 | |||
| 8ff237c69f | |||
| aa6d9e363f | |||
| ab4441c00b | |||
| 1b69f9cb23 | |||
| 158a0be6c4 | |||
| 1eca97757c | |||
| bb61144efc | |||
| acc1cc3158 | |||
| 92d160c431 | |||
| 219ab519e3 | |||
| d1850f5112 | |||
| 52dde93a31 | |||
| f601428e82 | |||
| f5654511b8 | |||
| 83c5323c3a | |||
| fbd7aac4b5 | |||
| 670c93e726 | |||
| 65e3ae70dd | |||
| 676e90cd98 | |||
| adf56050b9 | |||
| 5b674ffe48 | |||
| af8cbee6d5 | |||
| f49eabdb9d | |||
| c433e7bf3e | |||
| 88cffaddec | |||
| cf671b5134 | |||
| 1909f2b02f | |||
| 2b9596cac0 | |||
| 69c28177ac | |||
| edf0057cee | |||
| 398d9642cb | |||
| fb75240ee9 | |||
| ebdfa2860b | |||
| 9fd0513be3 | |||
| e27f396f55 | |||
| f750140b6f | |||
| 7c0a567eaa | |||
| 7b03bce416 | |||
| 660a9e13e7 | |||
| 238f597b78 | |||
| 047c0e44bd | |||
| 997ae98444 | |||
| c6a2641507 | |||
| 6d655d2d6e | |||
| 1d0a667826 | |||
| 0eca86443d | |||
| c4eabbd083 | |||
| bd922e4eed | |||
| 9915a416ff | |||
| e42ff72d6a | |||
| 11f8da5fc6 | |||
| 35b45e02b1 | |||
| b9c5d117dd | |||
| e7d90b1cd3 | |||
| 3b58caa32a | |||
| 69ae0091b8 | |||
| cfe59e74b2 | |||
| 9fb167b642 | |||
| 21ce157763 | |||
| 281c450b6e | |||
| c4b9b05af9 | |||
| 392391e8df | |||
| 95f899fee7 | |||
| 8f64825297 | |||
| ca9ac1c807 | |||
| f24b199775 | |||
| 79f2cd79d9 | |||
| 3a084fbdb8 | |||
| 89a7e0cf87 | |||
| 4e1652fa6b | |||
| 44ac7d11e7 | |||
| d297d31c23 | |||
| 3a94afb03c | |||
| f334a6225a | |||
| 937f3477d3 | |||
| 83105fca95 | |||
| c9a17fdd68 | |||
| eafc0dad4a | |||
| 984e7521d4 | |||
| c191a82882 | |||
| 69865e4e04 | |||
| ead9b2111c | |||
| 3ae2ca74c5 | |||
| 057d71e101 | |||
| 5825b8c3e7 | |||
| a03441b818 | |||
| 71fd4b9e98 | |||
| d98bbd9b82 | |||
| 4453e4201b | |||
| d2626d725d | |||
| e93324785b | |||
| 6f94f7031b | |||
| 77d356d275 | |||
| 541c8a06ca | |||
| 900026818b | |||
| 03d176d097 | |||
| 6c7e5651ce | |||
| 5a7046027c | |||
| a59038e3cb | |||
| ab4731a99f | |||
| e1e410783a | |||
| 8c9f4e8ab8 | |||
| 46105f735e | |||
| c6e4926d4e | |||
| 670697b0ac | |||
| 31ddf6bdd9 | |||
| e7afecb544 | |||
| 7d7e40f594 | |||
| 29d33a12dc | |||
| f815d9fa74 | |||
| 1c2b932cf8 | |||
| bb48787811 | |||
| 9a8e6de7fe | |||
| c52c692c4f | |||
| 5b69e58925 | |||
| efd64e2cd2 | |||
| 52fdbf4acc | |||
| 446f8e3a36 | |||
| d5c96ec66a | |||
| 76c2d92b7e | |||
| 3163cf90c9 | |||
| be4db3c5df | |||
| c1b73a068e | |||
| f34a56999f | |||
| 79d8d580b1 | |||
| cbbf5e2e7c | |||
| 93201835d3 | |||
| 57fee8b9de | |||
| 1fac4c4874 | |||
| 40bf8f75d6 | |||
| ad8f51f662 | |||
| d84a325010 | |||
| 5d3e9df731 | |||
| 8dfbb43e00 | |||
| 06bfecd829 | |||
| 9ea4c33ede | |||
| e011a528eb | |||
| 78df9de4c4 | |||
| 9c0380c31d | |||
| 44520522ac | |||
| 3f07b03911 | |||
| 90c7b06152 | |||
| 3de4ec7093 | |||
| 7e05c12f5d | |||
| 340cb05f70 | |||
| 010c9e937b | |||
| 41913c4a80 | |||
| 0a95c447b0 | |||
| ccde51304a | |||
| 94dbf358bd | |||
| 8757b9a9a5 | |||
| faebdeedcf | |||
| e6391189bc | |||
| 0da44b7166 | |||
| f07cd13fe8 | |||
| 4a5eae23a2 | |||
| f607069a57 | |||
| 3aa66da20f | |||
| 07966de432 | |||
| 8709078c38 | |||
| 585147d5b7 | |||
| 1fd3636ab3 | |||
| c842b0457f | |||
| b99b886576 | |||
| e91821d2a2 | |||
| e6b98b2ab8 | |||
| 5100785f51 | |||
| 9c8e56401b | |||
| b65ff53b00 | |||
| c1e681df60 | |||
| 45f740e210 | |||
| 31bba3a847 | |||
| 8c49372e7a | |||
| cc69dd5665 | |||
| f999fbe440 | |||
| a071ef94db | |||
| d03611763a | |||
| b9b9f17eee | |||
| 723d3c121a | |||
| a054fb1e04 | |||
| ea212a8ef5 | |||
| 686fd5b125 | |||
| ced33e982b | |||
| 33fdb072df | |||
| 48a94e3570 | |||
| d219b8cf46 | |||
| 22d286b9ce | |||
| 1d99f83b34 | |||
| 9d861f021c | |||
| f6d7fef7c2 | |||
| 8707cbc315 | |||
| 5a734de319 | |||
| ece70dc18d | |||
| 2a90f7e9c0 | |||
| 36acb90680 | |||
| 02029882db | |||
| 15e50b26dc | |||
| 8dc8ae7de8 | |||
| d4b588f84a | |||
| 19c2ae615f | |||
| 1a716e1a0d | |||
| 6f19531ce4 | |||
| 6b08e8ce1f | |||
| be1417f613 | |||
| 4499006744 | |||
| dbc5e90993 | |||
| bad6f0032c | |||
| 25182108f9 | |||
| 5ef6d7952f | |||
| 720c445f21 | |||
| e67a6bdfc2 | |||
| ebce93f338 | |||
| a1627fad9a | |||
| cda4338095 | |||
| 3d7906647e | |||
| 73014acf97 | |||
| add2aa0680 | |||
| 1dfe51b11b | |||
| f511d49cc2 | |||
| 61f7470e7e | |||
| a7ef9b4954 | |||
| 4b6e6572b9 | |||
| d4530d3a39 | |||
| 111b41bc86 | |||
| 545152f676 | |||
| 96384bdc29 | |||
| eede43a786 | |||
| b8e247a018 | |||
| 441a05d976 | |||
| 528ca931af | |||
| df53fb0fde | |||
| eae1585e38 | |||
| aefd217fc0 | |||
| 6b4c24fb12 | |||
| e2afb0be6b | |||
| d404359888 | |||
| 14ed65f0e4 | |||
| 0127f4017a | |||
| fadac79617 | |||
| 1fffd731b1 | |||
| 79678c5f25 | |||
| 7f04e3c759 | |||
| 75c95955fc | |||
| 1b5964dc42 | |||
| 7579ebf4e8 | |||
| 62297c3d86 | |||
| 821d7062df | |||
| 306a911dc9 | |||
| c3c8fa55b3 | |||
| fe62c259e8 | |||
| 90b509a73f | |||
| 372d16ee5e | |||
| 569e87d46b | |||
| 192cde408a | |||
| 818840b576 | |||
| d32a7ffb8d | |||
| 24e90e3c90 | |||
| d12be196a2 | |||
| 2784c3c5f0 | |||
| 64d7946cdc | |||
| 36efc8c83e | |||
| 61ffc6c432 | |||
| 2fad9a6397 | |||
| 42031ab572 | |||
| e27d3f4e13 | |||
| 2ba70c5d89 | |||
| 211c2b9ca6 | |||
| 9181f97f71 | |||
| a1f89e4fd9 | |||
| a8d3b15d73 | |||
| ae00abe468 | |||
| dfed00d870 | |||
| 03e5d7490f | |||
| 7d4e7aff20 | |||
| a962098645 | |||
| 021da9b2e1 | |||
| 3daf4a3a67 | |||
| 9fe95275bb | |||
| 70cd06bc84 | |||
| a97c5ec4e1 | |||
| 3d1f1522d9 | |||
| 1efe011522 | |||
| 5bb36162be | |||
| e6834579e5 | |||
| 7afa21ebb7 | |||
| f1a1c9d7da | |||
| 5c78af0f36 | |||
| 31e634b082 | |||
| e3557e0d3e | |||
| ce27cc8326 | |||
| 9f9c51eab3 | |||
| 7472c9033b | |||
| 73362f325b | |||
| 39ce001c41 | |||
| d810726c6e | |||
| a7ad722b98 | |||
| 7cc0b32e74 | |||
| 5786b73772 | |||
| a130b6a65c | |||
| 1a9688c42f | |||
| 8934aaa912 | |||
| eceb7e21b2 | |||
| 8b66a76432 | |||
| 4b9e1d58f7 | |||
| 0c9ead44f1 | |||
| e6dcc0a2ed | |||
| 90b5fcc1ec | |||
| 7ef8d197c6 | |||
| b36d705688 | |||
| bedf081d92 | |||
| 5d0f57d61e | |||
| 0551275b9c | |||
| ed6c63e48f | |||
| f231feb0f6 | |||
| 39303aa87a | |||
| ac1003875a | |||
| 6f973f1d6c | |||
| b9d93f2cad | |||
| 6173649c43 | |||
| 8bd4a624a7 | |||
| d21023c966 | |||
| 2fad39aaae | |||
| 3fff9e5826 | |||
| 3203d3f770 | |||
| 7e878e221c | |||
| 5678b4cc83 | |||
| 957b01a8eb | |||
| 63275ef92f | |||
| c3022bf713 | |||
| 1c0a494b4d | |||
| 64e47f2fae | |||
| a52d0ca00a | |||
| 2e44fe9edd | |||
| 5175d45e74 | |||
| 5eaf104318 | |||
| 853a5b77fd | |||
| 9087ef5990 | |||
| ae533b01b6 | |||
| deeefe5dd1 | |||
| 17561daefb | |||
| 9f4a91ab19 | |||
| 6f7b78821a | |||
| c62b886da5 | |||
| b8c377b91a | |||
| a664747d0a | |||
| 43f772154c | |||
| aae3a37983 | |||
| 12a5ce7a0a | |||
| 630cebeabc | |||
| e24d18f810 | |||
| 207a04bba0 | |||
| ead8e31de4 | |||
| 7b5917567a | |||
| 8b9bef3872 | |||
| ba047f234d | |||
| 393acf2231 | |||
| 0e9c352927 | |||
| c5e11cd16f | |||
| e8ae0fe13c | |||
| 5f342c3b5f | |||
| a0cad961b3 | |||
| 58135d892b | |||
| 990304ee22 | |||
| a73d5037f2 | |||
| cf776aeb0a | |||
| 148b6e6135 | |||
| cba4bcd2fb | |||
| ee5cdab963 | |||
| cff9e90bec | |||
| 4049ec2e96 | |||
| d4196f7f0c | |||
| 8f01324890 | |||
| 968a3d499b | |||
| a260a6eead | |||
| 61d5d8ce2a | |||
| 3cc64b3b7b | |||
| fb4c620f94 | |||
| 68986604e9 | |||
| 1dd2c94949 | |||
| 2a15578f8d | |||
| aa3ffa28c8 | |||
| 5920711c20 | |||
| eded7bf772 | |||
| 9a5f88d6bf | |||
| ff647e7bc8 | |||
| 3049b9af01 | |||
| 40ba3f5131 | |||
| c0e3ab632e | |||
| b86cf2b017 | |||
| 7280f71cef | |||
| 45a0a7c5ab | |||
| 2dd29ec4a1 | |||
| c97a18b6a4 | |||
| 3deefb1a79 | |||
| 124e1c26d9 | |||
| 9398a4819f | |||
| 3e87ec5153 |
@@ -5,6 +5,7 @@
|
||||
*.px4log
|
||||
*.dSYM
|
||||
*.o
|
||||
*.gch
|
||||
*.pyc
|
||||
*~
|
||||
.*.swp
|
||||
@@ -72,3 +73,11 @@ GTAGS
|
||||
# uavcan firmware
|
||||
ROMFS/px4fmu_common/uavcan/
|
||||
vectorcontrol/
|
||||
|
||||
|
||||
# CLion ignores
|
||||
.idea
|
||||
|
||||
# gcov code coverage
|
||||
coverage-html/
|
||||
coverage.info
|
||||
|
||||
+20
-15
@@ -3,17 +3,20 @@
|
||||
|
||||
language: cpp
|
||||
|
||||
git:
|
||||
depth: 1000
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- os: linux
|
||||
sudo: required
|
||||
env: GCC_VER=4.8 DOCKER_REPO="px4io/px4-dev-base:2016-07-14"
|
||||
env: GCC_VER=4.9 DOCKER_REPO="px4io/px4-dev-base:2016-10-20"
|
||||
services:
|
||||
- docker
|
||||
- os: osx
|
||||
sudo: true
|
||||
osx_image: xcode7.3
|
||||
osx_image: xcode8
|
||||
env: CCACHE_CPP2=1
|
||||
|
||||
cache:
|
||||
@@ -61,20 +64,20 @@ env:
|
||||
script:
|
||||
- ccache -M 1GB; ccache -z
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
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";
|
||||
docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e CI=true -e GIT_SUBMODULES_ARE_EVIL=1 -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "make check_qgc_firmware VECTORCONTROL=0";
|
||||
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
make check_posix_sitl_default;
|
||||
make tests;
|
||||
fi
|
||||
- ccache -s
|
||||
|
||||
after_success:
|
||||
- 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
|
||||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/
|
||||
&& 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/;
|
||||
fi
|
||||
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "$GCC_VER" == "4.9" ]]; then
|
||||
export PX4_S3_DEPLOY=1;
|
||||
fi
|
||||
|
||||
@@ -117,7 +120,7 @@ deploy:
|
||||
tags: true
|
||||
all_branches: true
|
||||
repo: PX4/Firmware
|
||||
condition: $GCC_VER = 4.8
|
||||
condition: $GCC_VER = 4.9
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
@@ -126,6 +129,8 @@ notifications:
|
||||
on_success: always # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
slack:
|
||||
secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
|
||||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
rooms:
|
||||
- secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
|
||||
on_pull_requests: false
|
||||
on_success: never # options: [always|never|change] default: always
|
||||
on_failure: never # options: [always|never|change] default: always
|
||||
|
||||
+92
-27
@@ -121,6 +121,14 @@
|
||||
# and leads to wrong toolchain detection
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
execute_process(
|
||||
COMMAND Tools/check_submodules.sh
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# Use clang
|
||||
#SET (CMAKE_C_COMPILER /usr/bin/clang-3.6)
|
||||
#SET (CMAKE_CXX_COMPILER /usr/bin/clang++-3.6)
|
||||
@@ -138,6 +146,7 @@ set_property(CACHE CONFIG PROPERTY STRINGS ${configs})
|
||||
set(THREADS "4" CACHE STRING
|
||||
"number of threads to use for external build processes")
|
||||
set(DEBUG_PORT "/dev/ttyACM0" CACHE STRING "debugging port")
|
||||
set(EXTERNAL_MODULES_LOCATION "" CACHE STRING "External modules source location")
|
||||
|
||||
#=============================================================================
|
||||
# configuration
|
||||
@@ -155,6 +164,9 @@ message(STATUS "${target_name}")
|
||||
# Define GNU standard installation directories
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Add support for external project building
|
||||
include(ExternalProject)
|
||||
|
||||
# Setup install paths
|
||||
if(NOT CMAKE_INSTALL_PREFIX)
|
||||
if (${OS} STREQUAL "posix")
|
||||
@@ -163,12 +175,8 @@ if(NOT CMAKE_INSTALL_PREFIX)
|
||||
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")
|
||||
else() # otherwise use the rest of this file
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/cmake")
|
||||
message(STATUS "cmake module path: ${CMAKE_MODULE_PATH}")
|
||||
set(config_module "configs/${CONFIG}")
|
||||
include(${config_module})
|
||||
|
||||
@@ -199,6 +207,9 @@ if(DEFINED config_df_driver_list)
|
||||
message("DF Drivers: ${config_df_driver_list}")
|
||||
endif()
|
||||
|
||||
# force static lib build
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
#=============================================================================
|
||||
# project definition
|
||||
#
|
||||
@@ -213,14 +224,28 @@ if (NOT ${CMAKE_VERSION} VERSION_LESS 3.1.0)
|
||||
endif()
|
||||
|
||||
set(version_major 1)
|
||||
set(version_minor 4)
|
||||
set(version_patch 1)
|
||||
set(version_minor 5)
|
||||
set(version_patch 0)
|
||||
set(version "${version_major}.${version_minor}.${version_patch}")
|
||||
set(package-contact "px4users@googlegroups.com")
|
||||
|
||||
#=============================================================================
|
||||
# programs
|
||||
# find programs and packages
|
||||
#
|
||||
|
||||
# see if catkin was invoked to build this
|
||||
if (CATKIN_DEVEL_PREFIX)
|
||||
message(STATUS "catkin ENABLED")
|
||||
find_package(catkin REQUIRED)
|
||||
if (catkin_FOUND)
|
||||
catkin_package()
|
||||
else()
|
||||
message(FATAL_ERROR "catkin not found")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "catkin DISABLED")
|
||||
endif()
|
||||
|
||||
find_package(PythonInterp REQUIRED)
|
||||
|
||||
#=============================================================================
|
||||
@@ -228,6 +253,11 @@ find_package(PythonInterp REQUIRED)
|
||||
#
|
||||
enable_testing()
|
||||
|
||||
#=============================================================================
|
||||
# generate compile command database
|
||||
#
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
#=============================================================================
|
||||
# check required toolchain variables
|
||||
#
|
||||
@@ -257,7 +287,7 @@ px4_add_git_submodule(TARGET git_matrix PATH "src/lib/matrix")
|
||||
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "cmake/cmake_hexagon")
|
||||
|
||||
add_custom_target(submodule_clean
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMAND git submodule deinit -f .
|
||||
COMMAND rm -rf .git/modules/*
|
||||
)
|
||||
@@ -267,12 +297,12 @@ add_custom_target(submodule_clean
|
||||
#
|
||||
add_custom_target(check_format
|
||||
COMMAND Tools/check_code_style.sh
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(config
|
||||
COMMAND cmake-gui .
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
)
|
||||
|
||||
#=============================================================================
|
||||
@@ -289,14 +319,15 @@ px4_os_add_flags(
|
||||
BOARD ${BOARD}
|
||||
C_FLAGS c_flags
|
||||
CXX_FLAGS cxx_flags
|
||||
OPTIMIZATION_FLAGS optimization_flags
|
||||
EXE_LINKER_FLAGS exe_linker_flags
|
||||
INCLUDE_DIRS include_dirs
|
||||
LINK_DIRS link_dirs
|
||||
DEFINITIONS definitions)
|
||||
|
||||
px4_join(OUT CMAKE_EXE_LINKER_FLAGS LIST "${exe_linker_flags}" GLUE " ")
|
||||
px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags}" GLUE " ")
|
||||
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags}" GLUE " ")
|
||||
px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags};${optimization_flags}" GLUE " ")
|
||||
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags};${optimization_flags}" GLUE " ")
|
||||
|
||||
include_directories(${include_dirs})
|
||||
#message("INCLUDE_DIRS=${include_dirs}")
|
||||
@@ -321,7 +352,7 @@ add_custom_target(xml_gen
|
||||
# external projects
|
||||
#
|
||||
|
||||
set(ep_base ${CMAKE_BINARY_DIR}/external)
|
||||
set(ep_base ${PX4_BINARY_DIR}/external)
|
||||
set_property(DIRECTORY PROPERTY EP_BASE ${ep_base})
|
||||
|
||||
# add external project install folders to build
|
||||
@@ -341,6 +372,24 @@ foreach(driver ${config_df_driver_list})
|
||||
message("Adding DF driver: ${driver}")
|
||||
endforeach()
|
||||
|
||||
#=============================================================================
|
||||
# external modules
|
||||
#
|
||||
if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
|
||||
message(STATUS "External modules: ${EXTERNAL_MODULES_LOCATION}")
|
||||
add_subdirectory("${EXTERNAL_MODULES_LOCATION}/src" external_modules_src)
|
||||
|
||||
set(config_module_list_external_expanded)
|
||||
foreach(external_module ${config_module_list_external})
|
||||
list(APPEND config_module_list_external_expanded
|
||||
${EXTERNAL_MODULES_LOCATION}/src/${external_module})
|
||||
endforeach()
|
||||
set(config_module_list
|
||||
${config_module_list}
|
||||
${config_module_list_external_expanded}
|
||||
)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# subdirectories
|
||||
#
|
||||
@@ -350,7 +399,7 @@ foreach(module ${config_module_list})
|
||||
if(external_module)
|
||||
STRING(REGEX REPLACE "//" "/" EXT_MODULE ${module})
|
||||
STRING(REGEX REPLACE "/" "__" EXT_MODULE_PREFIX ${EXT_MODULE})
|
||||
add_subdirectory(${module} ${CMAKE_BINARY_DIR}/${EXT_MODULE_PREFIX})
|
||||
add_subdirectory(${module} ${PX4_BINARY_DIR}/${EXT_MODULE_PREFIX})
|
||||
else()
|
||||
add_subdirectory(src/${module})
|
||||
endif()
|
||||
@@ -372,16 +421,35 @@ if (config_io_board)
|
||||
add_subdirectory(src/modules/px4iofirmware)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# generate custom target to print for all executable and module cmake targets
|
||||
#
|
||||
if(all_posix_cmake_targets)
|
||||
list(SORT all_posix_cmake_targets)
|
||||
px4_join(OUT posix_cmake_target_list LIST ${all_posix_cmake_targets} GLUE "\\n")
|
||||
add_custom_target(list_cmake_targets
|
||||
COMMAND sh -c "printf \"${posix_cmake_target_list}\\n\""
|
||||
COMMENT "List of cmake targets that can be matched by PX4_NO_OPTIMIZATION:"
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# generate git version
|
||||
#
|
||||
px4_create_git_hash_header(HEADER ${CMAKE_BINARY_DIR}/build_git_version.h)
|
||||
px4_create_git_hash_header(HEADER ${PX4_BINARY_DIR}/build_git_version.h)
|
||||
|
||||
#=============================================================================
|
||||
# packaging
|
||||
#
|
||||
# Important to having packaging at end of cmake file.
|
||||
#
|
||||
execute_process(
|
||||
COMMAND git describe --always --tags
|
||||
OUTPUT_VARIABLE git_tag
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}-${CONFIG})
|
||||
set(CPACK_PACKAGE_VERSION ${version})
|
||||
set(CPACK_PACKAGE_CONTACT ${package-contact})
|
||||
@@ -391,20 +459,17 @@ 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_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CONFIG}-${version}")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CONFIG}-${git_tag}")
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${version}")
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
|
||||
set(CPACK_SET_DESTDIR "OFF")
|
||||
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")
|
||||
find_program(DPKG_PROGRAM dpkg)
|
||||
if (EXISTS ${DPKG_PROGRAM})
|
||||
list (APPEND CPACK_GENERATOR "DEB")
|
||||
endif()
|
||||
endif()
|
||||
include(CPack)
|
||||
|
||||
endif() # ros alternative endif
|
||||
|
||||
# vim: set noet fenc=utf-8 ff=unix ft=cmake :
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"board_id": 65,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the Intel Aero FC board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "AEROFCv1",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"board_id": 33,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the AUAV X2.1 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "AUAV X2.1",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"board_id": 12,
|
||||
"magic": "Crazyflie",
|
||||
"description": "Firmware for the Crazyflie 2.0",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "CRAZYFLIE",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"board_id": 9,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the PX4FMUv3 board",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "PX4FMUv3",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"board_id": 78,
|
||||
"board_id": 64,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the TAPv1 board",
|
||||
"image": "",
|
||||
|
||||
@@ -42,7 +42,7 @@ endif
|
||||
CMAKE_VER := $(shell Tools/check_cmake.sh; echo $$?)
|
||||
ifneq ($(CMAKE_VER),0)
|
||||
$(warning Not a valid CMake version or CMake not installed.)
|
||||
$(warning On Ubuntu, install or upgrade via:)
|
||||
$(warning On Ubuntu 16.04, install or upgrade via:)
|
||||
$(warning )
|
||||
$(warning 3rd party PPA:)
|
||||
$(warning sudo add-apt-repository ppa:george-edison55/cmake-3.x -y)
|
||||
@@ -84,10 +84,13 @@ all: posix_sitl_default
|
||||
# assume 1st argument passed is the main target, the
|
||||
# rest are arguments to pass to the makefile generated
|
||||
# by cmake in the subdirectory
|
||||
FIRST_ARG := $(firstword $(MAKECMDGOALS))
|
||||
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||
j ?= 4
|
||||
|
||||
ifndef NO_NINJA_BUILD
|
||||
NINJA_BUILD := $(shell ninja --version 2>/dev/null)
|
||||
endif
|
||||
ifdef NINJA_BUILD
|
||||
PX4_CMAKE_GENERATOR ?= "Ninja"
|
||||
PX4_MAKE = ninja
|
||||
@@ -100,7 +103,7 @@ ifdef SYSTEMROOT
|
||||
else
|
||||
PX4_CMAKE_GENERATOR ?= "Unix Makefiles"
|
||||
endif
|
||||
PX4_MAKE = make
|
||||
PX4_MAKE = $(MAKE)
|
||||
PX4_MAKE_ARGS = -j$(j) --no-print-directory
|
||||
endif
|
||||
|
||||
@@ -111,27 +114,30 @@ else
|
||||
BUILD_DIR_SUFFIX :=
|
||||
endif
|
||||
|
||||
# additional config parameters passed to cmake
|
||||
CMAKE_ARGS :=
|
||||
ifdef EXTERNAL_MODULES_LOCATION
|
||||
CMAKE_ARGS := -DEXTERNAL_MODULES_LOCATION:STRING=$(EXTERNAL_MODULES_LOCATION)
|
||||
endif
|
||||
|
||||
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
# Functions
|
||||
# --------------------------------------------------------------------
|
||||
# describe how to build a cmake config
|
||||
define cmake-build
|
||||
+@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: $@$(BUILD_DIR_SUFFIX)" && cd ./build_$@$(BUILD_DIR_SUFFIX) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
|
||||
+@$(eval BUILD_DIR = $(SRC_DIR)/build_$@$(BUILD_DIR_SUFFIX))
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
|
||||
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) $(CMAKE_ARGS) || (cd .. && rm -rf $(BUILD_DIR)); fi
|
||||
+@echo "PX4 CONFIG: $(BUILD_DIR)"
|
||||
+@$(PX4_MAKE) -C "$(BUILD_DIR)" $(PX4_MAKE_ARGS) $(ARGS)
|
||||
endef
|
||||
|
||||
define cmake-build-other
|
||||
+@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
|
||||
define cmake-targ
|
||||
$(1):
|
||||
@#
|
||||
.PHONY: $(1)
|
||||
+@$(eval BUILD_DIR = $(SRC_DIR)/build_$@$(BUILD_DIR_SUFFIX))
|
||||
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
|
||||
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(2) -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(BUILD_DIR)); fi
|
||||
+@$(PX4_MAKE) -C "$(BUILD_DIR)" $(PX4_MAKE_ARGS) $(ARGS)
|
||||
endef
|
||||
|
||||
define colorecho
|
||||
@@ -140,107 +146,60 @@ define colorecho
|
||||
@tput sgr0
|
||||
endef
|
||||
|
||||
# Get a list of all config targets.
|
||||
ALL_CONFIG_TARGETS := $(basename $(shell find "$(SRC_DIR)/cmake/configs" ! -name '*_common*' ! -name '*_sdflight_*' -name '*.cmake' -print | sed -e 's:^.*/::' | sort))
|
||||
# Strip off leading nuttx_
|
||||
NUTTX_CONFIG_TARGETS := $(patsubst nuttx_%,%,$(filter nuttx_%,$(ALL_CONFIG_TARGETS)))
|
||||
|
||||
# ADD CONFIGS HERE
|
||||
# --------------------------------------------------------------------
|
||||
# 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)
|
||||
|
||||
px4fmu-v4_default:
|
||||
$(call cmake-build,nuttx_px4fmu-v4_default)
|
||||
|
||||
px4-stm32f4discovery_default:
|
||||
$(call cmake-build,nuttx_px4-stm32f4discovery_default)
|
||||
|
||||
px4fmu-v2_ekf2:
|
||||
$(call cmake-build,nuttx_px4fmu-v2_ekf2)
|
||||
|
||||
mindpx-v2_default:
|
||||
$(call cmake-build,nuttx_mindpx-v2_default)
|
||||
|
||||
posix_sitl_default:
|
||||
# All targets.
|
||||
$(ALL_CONFIG_TARGETS):
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_sitl_lpe:
|
||||
$(call cmake-build,$@)
|
||||
# Abbreviated config targets.
|
||||
|
||||
posix_sitl_replay:
|
||||
$(call cmake-build,$@)
|
||||
# nuttx_ is left off by default; provide a rule to allow that.
|
||||
$(NUTTX_CONFIG_TARGETS):
|
||||
$(call cmake-build,nuttx_$@)
|
||||
|
||||
posix_sitl_broadcast:
|
||||
$(call cmake-build,$@)
|
||||
all_nuttx_targets: $(NUTTX_CONFIG_TARGETS)
|
||||
|
||||
posix: posix_sitl_default
|
||||
broadcast: posix_sitl_broadcast
|
||||
|
||||
# Multi- config targets.
|
||||
|
||||
eagle_default: posix_eagle_default qurt_eagle_default
|
||||
eagle_legacy_default: posix_eagle_legacy_driver_default qurt_eagle_legacy_driver_default
|
||||
excelsior_default: posix_excelsior_default qurt_excelsior_default
|
||||
|
||||
# Deprecated config targets.
|
||||
|
||||
ros_sitl_default:
|
||||
@echo "This target is deprecated. Use make 'posix_sitl_default gazebo' instead."
|
||||
|
||||
qurt_eagle_travis:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
qurt_eagle_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_eagle_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
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,$@)
|
||||
|
||||
posix_eagle_legacy_driver_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
qurt_excelsior_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_excelsior_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
excelsior_default: posix_excelsior_default qurt_excelsior_default
|
||||
|
||||
posix_rpi_native:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_rpi_cross:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix_bebop_default:
|
||||
$(call cmake-build,$@)
|
||||
|
||||
posix: posix_sitl_default
|
||||
|
||||
broadcast: posix_sitl_broadcast
|
||||
|
||||
sitl_deprecation:
|
||||
_sitl_deprecation:
|
||||
@echo "Deprecated. Use 'make posix_sitl_default jmavsim' or"
|
||||
@echo "'make posix_sitl_default gazebo' if Gazebo is preferred."
|
||||
|
||||
run_sitl_quad: sitl_deprecation
|
||||
run_sitl_plane: sitl_deprecation
|
||||
run_sitl_ros: sitl_deprecation
|
||||
run_sitl_quad: _sitl_deprecation
|
||||
run_sitl_plane: _sitl_deprecation
|
||||
run_sitl_ros: _sitl_deprecation
|
||||
|
||||
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
|
||||
.PHONY: all posix broadcast eagle_default eagle_legacy_default excelsior_default run_sitl_quad run_sitl_plane run_sitl_ros all_nuttx_targets
|
||||
|
||||
# Other targets
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
.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
|
||||
.PHONY: uavcan_firmware check check_format format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
||||
.NOTPARALLEL:
|
||||
|
||||
gazebo_build:
|
||||
@mkdir -p build_gazebo
|
||||
@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
|
||||
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
|
||||
.PHONY: checks_defaults checks_bootloaders checks_tests checks_alts checks_uavcan checks_sitls checks_last quick_check tests extra_firmware
|
||||
|
||||
uavcan_firmware:
|
||||
ifeq ($(VECTORCONTROL),1)
|
||||
@@ -248,46 +207,6 @@ ifeq ($(VECTORCONTROL),1)
|
||||
@(rm -rf vectorcontrol && git clone --quiet --depth 1 https://github.com/thiemar/vectorcontrol.git && cd vectorcontrol && BOARD=s2740vc_1_0 make --silent --no-print-directory && BOARD=px4esc_1_6 make --silent --no-print-directory && ../Tools/uavcan_copy.sh)
|
||||
endif
|
||||
|
||||
checks_defaults: \
|
||||
check_px4fmu-v1_default \
|
||||
check_px4fmu-v2_default \
|
||||
check_mindpx-v2_default \
|
||||
check_px4-stm32f4discovery_default \
|
||||
check_tap-v1_default \
|
||||
|
||||
checks_bootloaders: \
|
||||
|
||||
|
||||
checks_tests: \
|
||||
check_px4fmu-v2_test
|
||||
|
||||
checks_alts: \
|
||||
check_px4fmu-v2_ekf2 \
|
||||
|
||||
checks_uavcan: \
|
||||
check_px4fmu-v4_default_and_uavcan
|
||||
|
||||
checks_sitls: \
|
||||
check_posix_sitl_default
|
||||
|
||||
checks_last: \
|
||||
check_tests \
|
||||
check_format \
|
||||
|
||||
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")
|
||||
@./Tools/fix_code_style.sh
|
||||
@./Tools/check_code_style_all.sh
|
||||
|
||||
check_%:
|
||||
@echo
|
||||
$(call colorecho,"Building" $(subst check_,,$@))
|
||||
@$(MAKE) --no-print-directory $(subst check_,,$@)
|
||||
@echo
|
||||
|
||||
check_px4fmu-v4_default: uavcan_firmware
|
||||
check_px4fmu-v4_default_and_uavcan: check_px4fmu-v4_default
|
||||
@echo
|
||||
@@ -297,53 +216,83 @@ ifeq ($(VECTORCONTROL),1)
|
||||
@rm -rf ROMFS/px4fmu_common/uavcan
|
||||
endif
|
||||
|
||||
# All default targets that don't require a special build environment (currently built on semaphore-ci)
|
||||
check: check_px4fmu-v1_default \
|
||||
check_px4fmu-v2_default \
|
||||
check_px4fmu-v2_test \
|
||||
check_px4fmu-v4_default_and_uavcan \
|
||||
check_mindpx-v2_default \
|
||||
check_posix_sitl_default \
|
||||
check_tap-v1_default \
|
||||
check_aerofc-v1_default \
|
||||
check_px4-stm32f4discovery_default \
|
||||
check_crazyflie_default \
|
||||
check_tests \
|
||||
check_format
|
||||
|
||||
# quick_check builds a single nuttx and posix target, runs testing, and checks the style
|
||||
quick_check: check_posix_sitl_default check_px4fmu-v4_default check_tests check_format
|
||||
|
||||
check_format:
|
||||
$(call colorecho,"Checking formatting with astyle")
|
||||
@./Tools/check_code_style_all.sh
|
||||
@git diff --check
|
||||
|
||||
format:
|
||||
$(call colorecho,"Formatting with astyle")
|
||||
@./Tools/check_code_style_all.sh --fix
|
||||
|
||||
check_%:
|
||||
@echo
|
||||
$(call colorecho,"Building" $(subst check_,,$@))
|
||||
@$(MAKE) --no-print-directory $(subst check_,,$@)
|
||||
@echo
|
||||
|
||||
unittest: posix_sitl_default
|
||||
$(call cmake-build-other,unittest, ../unittests)
|
||||
@(cd build_unittest && ctest -j2 --output-on-failure)
|
||||
|
||||
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)
|
||||
@(cd build_posix_sitl_default/ && ctest -V)
|
||||
|
||||
tests: check_unittest run_tests_posix
|
||||
|
||||
# QGroundControl flashable firmware
|
||||
tests_coverage:
|
||||
@(PX4_CODE_COVERAGE=1 CCACHE_DISABLE=1 ${MAKE} tests)
|
||||
@(lcov --directory . --capture --quiet --output-file coverage.info)
|
||||
@(lcov --remove coverage.info '/usr/*' --quiet --output-file coverage.info)
|
||||
#@(lcov --list coverage.info)
|
||||
@(genhtml coverage.info --quiet --output-directory coverage-html)
|
||||
|
||||
# QGroundControl flashable firmware (currently built by travis-ci)
|
||||
qgc_firmware: \
|
||||
check_px4fmu-v1_default \
|
||||
check_px4fmu-v2_default \
|
||||
check_mindpx-v2_default \
|
||||
check_px4fmu-v3_default \
|
||||
check_px4fmu-v4_default_and_uavcan \
|
||||
check_mindpx-v2_default \
|
||||
check_tap-v1_default \
|
||||
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`
|
||||
|
||||
clean:
|
||||
@rm -rf build_*/
|
||||
@(cd NuttX/nuttx && make clean)
|
||||
-@$(MAKE) -C NuttX/nuttx clean
|
||||
|
||||
submodulesclean:
|
||||
@git submodule sync --recursive
|
||||
@git submodule deinit -f .
|
||||
@git submodule update --init --recursive --force
|
||||
|
||||
distclean: submodulesclean
|
||||
@git clean -ff -x -d -e ".project" -e ".cproject"
|
||||
distclean: submodulesclean clean
|
||||
@git clean -ff -x -d -e ".project" -e ".cproject" -e ".idea"
|
||||
|
||||
# targets handled by cmake
|
||||
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_typhoon_h480
|
||||
$(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
|
||||
# All other targets are handled by PX4_MAKE. Add a rule here to avoid printing an error.
|
||||
%:
|
||||
$(if $(filter $(FIRST_ARG),$@), \
|
||||
$(error "$@ cannot be the first argument. Use '$(MAKE) help|list_config_targets' to get a list of all possible [configuration] targets."),@#)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
@@ -354,3 +303,22 @@ CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
|
||||
# @echo "Type 'make ' and hit the tab key twice to see a list of the available"
|
||||
# @echo "build configurations."
|
||||
# @echo
|
||||
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
|
||||
# Print a list of non-config targets (based on http://stackoverflow.com/a/26339924/1487069)
|
||||
help:
|
||||
@echo "Usage: $(MAKE) <target>"
|
||||
@echo "Where <target> is one of:"
|
||||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
|
||||
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | \
|
||||
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS) $(NUTTX_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(posix|eagle|Makefile)'
|
||||
@echo
|
||||
@echo "Or, $(MAKE) <config_target> [<make_target(s)>]"
|
||||
@echo "Use '$(MAKE) list_config_targets' for a list of configuration targets."
|
||||
|
||||
# Print a list of all config targets.
|
||||
list_config_targets:
|
||||
@for targ in $(patsubst nuttx_%,[nuttx_]%,$(ALL_CONFIG_TARGETS)); do echo $$targ; done
|
||||
|
||||
|
||||
+1
-1
Submodule NuttX updated: 55e8d557ec...af5d2b058c
@@ -6,30 +6,60 @@
|
||||
|
||||
This repository holds the [PX4 Pro](http://px4.io) flight control solution for drones, with the main applications located in the src/modules directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
|
||||
|
||||
* Official Website: http://px4.io
|
||||
* License: BSD 3-clause (see [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
|
||||
* Supported airframes (more experimental are supported):
|
||||
* Official Website: http://px4.io (License: BSD 3-clause, [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
|
||||
* Supported airframes (more experimental types than listed here are supported):
|
||||
* [Multicopters](http://px4.io/portfolio_category/multicopter/)
|
||||
* [Fixed wing](http://px4.io/portfolio_category/plane/)
|
||||
* [VTOL](http://px4.io/portfolio_category/vtol/)
|
||||
* Releases
|
||||
* [Downloads](https://github.com/PX4/Firmware/releases)
|
||||
* Releases: [Downloads](https://github.com/PX4/Firmware/releases)
|
||||
|
||||
### Users ###
|
||||
|
||||
Please refer to the [user documentation](http://px4.io) and [user forum](http://discuss.px4.io) for flying drones with the PX4 flight stack.
|
||||
Please refer to the [user documentation](http://px4.io/user-guide/) and [user forum](http://discuss.px4.io) for flying drones with the PX4 flight stack.
|
||||
|
||||
### Developers ###
|
||||
|
||||
* [Developer Forum / Mailing list](http://groups.google.com/group/px4users)
|
||||
* [Developer Forum](http://discuss.px4.io)
|
||||
* [Guide for Contributions](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md)
|
||||
* [Developer guide](http://dev.px4.io)
|
||||
|
||||
## Maintenance Team
|
||||
|
||||
* Project / Founder - [Lorenz Meier](http://github.com/LorenzMeier)
|
||||
* Dev Call - [Mark Whitehorn](http://github.com/kd0aij), [Ramon Roche](http://github.com/mrpollo)
|
||||
* Communication Architecture - [Beat Kueng](http://github.com/bkueng), [Julian Oes](http://github.com/JulianOes)
|
||||
* UI / UX - [Gus Grubba](http://github.com/dogmaphobic)
|
||||
* Multicopter Flight Control - [Dennis Mannhart](http://github.com/Stifael), [Matthias Grob](http://github.com/MaEtUgR)
|
||||
* VTOL Flight Control - [Roman Bapst](http://github.com/tumbili), [Andreas Antener](http://github.com/AndreasAntener), [Sander Smeets](http://github.com/sanderux)
|
||||
* Fixed Wing Flight Control - [Daniel Agar](http://github.com/dagar), [Paul Riseborough](http://github.com/priseborough)
|
||||
* Racers - [Mark Whitehorn](http://github.com/kd0aij)
|
||||
* OS / drivers - [David Sidrane](http://github.com/david_s5)
|
||||
* UAVCAN / Industrial - [Pavel Kirienko](http://github.com/pavel-kirienko)
|
||||
* State Estimation - [James Goppert](http://github.com/jgoppert), [Paul Riseborough](http://github.com/priseborough)
|
||||
* VIO - Christoph Tobler
|
||||
* Obstacle Avoidance - [Vilhjalmur Vilhjalmsson](http://github.com/vilhjalmur89)
|
||||
* Snapdragon - [Mark Charlebois](http://github.com/mcharleb)
|
||||
* Intel Aero - [Lucas de Marchi](http://github.com/lucasdemarchi), [Simone Guscetti](http://github.com/simonegu)
|
||||
* Raspberry Pi / Navio - [Beat Kueng](http://github.com/bkueng)
|
||||
* Parrot Bebop - [Michael Schaeuble](http://github.com/eyeam3)
|
||||
|
||||
## Supported Hardware
|
||||
|
||||
This repository contains code supporting these boards:
|
||||
* [Snapdragon Flight](http://dev.px4.io/hardware-snapdragon.html)
|
||||
* Intel Aero
|
||||
* Raspberry PI with Navio 2
|
||||
* [Parrot Bebop](http://dev.px4.io/starting-building.html#parrot-bebop)
|
||||
* FMUv1.x
|
||||
* FMUv2.x ([Pixhawk](http://dev.px4.io/hardware-pixhawk.html), Pixhawk 2 and [Pixfalcon](http://dev.px4.io/hardware-pixfalcon.html))
|
||||
* FMUv4.x (Pixhawk X and [Pixracer](http://dev.px4.io/hardware-pixracer.html))
|
||||
* FMUv2.x ([Pixhawk](http://dev.px4.io/hardware-pixhawk.html) and [Pixfalcon](http://dev.px4.io/hardware-pixfalcon.html))
|
||||
* FMUv3.x ([Pixhawk 2](http://dev.px4.io/hardware-pixhawk.html))
|
||||
* FMUv4.x (Pixhawk 3 Pro and [Pixracer](http://dev.px4.io/hardware-pixracer.html))
|
||||
* FMUv5.x (ARM Cortex M7, future Pixhawk)
|
||||
* AeroCore (v1 and v2)
|
||||
* STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery)
|
||||
* MindPX V2.8 [Tutorial] (http://www.mindpx.net/assets/accessories/UserGuide_MindPX.pdf)
|
||||
* MindRacer V1.2 [Tutorial] (http://mindpx.net/assets/accessories/mindracer_user_guide_v1.2.pdf)
|
||||
|
||||
## Project Milestones
|
||||
|
||||
The PX4 software and Pixhawk hardware (which has been designed for it) has been created in 2011 by Lorenz Meier.
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name HobbyKing SK450 DeadCat modification
|
||||
#
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Anton Matosov <anton.matosov@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_ROLLRATE_P 0.08
|
||||
param set MC_ROLLRATE_I 0.03
|
||||
param set MC_ROLLRATE_D 0.0015
|
||||
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.03
|
||||
param set MC_PITCHRATE_D 0.0015
|
||||
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.1
|
||||
param set MC_YAWRATE_I 0.07
|
||||
param set MC_YAWRATE_D 0.0
|
||||
fi
|
||||
|
||||
set MIXER sk450_deadcat
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
set PWM_AUX_OUT 1234
|
||||
# set PWM_AUX_MIN 900
|
||||
# set PWM_AUX_MAX 2100
|
||||
set PWM_AUX_RATE 100
|
||||
|
||||
gimbal start
|
||||
@@ -0,0 +1,26 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name H4 680mm with Z1 Tiny2 Gimbal
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Leon Mueller <thedevleon>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4002_quad_x_mount
|
||||
|
||||
# The Z1 Tiny2 can handle up to 400Hz
|
||||
# and works with min 1020us, middle 1520us, max 2020us
|
||||
# see http://www.zhiyun-tech.com/uploadfile/datedown/instruction/Tiny2_English_instructionV1.03.pdf
|
||||
# under Gimbal Connection Instruction
|
||||
|
||||
set PWM_AUX_RATE 400
|
||||
set PWM_AUX_DISARMED 1520
|
||||
set PWM_AUX_MIN 1020
|
||||
set PWM_AUX_MAX 2020
|
||||
|
||||
# Start FrSky telemetry on SERIAL4 (ttyS6, designated "SERIAL4/5" on the case)
|
||||
frsky_telemetry start -d /dev/ttyS6
|
||||
|
||||
# GPIO LED
|
||||
gpio_led start -p 6
|
||||
@@ -1,14 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name HIL Rascal 110 (Flightgear)
|
||||
#
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
set HIL yes
|
||||
|
||||
set MIXER AERT
|
||||
@@ -1,41 +0,0 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name HIL Malolo 1 (Flightgear)
|
||||
#
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MIN 12
|
||||
param set FW_AIRSPD_TRIM 25
|
||||
param set FW_AIRSPD_MAX 40
|
||||
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 15
|
||||
param set FW_PR_FF 0.8
|
||||
param set FW_PR_I 0.05
|
||||
param set FW_PR_IMAX 0.2
|
||||
param set FW_PR_P 0.1
|
||||
param set FW_P_ROLLFF 0
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_I 0.02
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.1
|
||||
param set FW_R_LIM 45
|
||||
param set FW_R_RMAX 0
|
||||
param set FW_YR_FF 0.0
|
||||
param set FW_YR_I 0
|
||||
param set FW_YR_IMAX 0.2
|
||||
param set FW_YR_P 0.0
|
||||
fi
|
||||
|
||||
set HIL yes
|
||||
|
||||
# Set the AERT mixer for HIL (even if the malolo is a flying wing)
|
||||
set MIXER AERT
|
||||
@@ -1,10 +1,17 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Fun Cub Quad VTOL.
|
||||
#
|
||||
# @name Fun Cub Quad VTOL
|
||||
# @type Standard VTOL
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@uaventure.com>
|
||||
# @output MAIN1 Front right motor: CCW
|
||||
# @output MAIN2 Back left motor: CCW
|
||||
# @output MAIN3 Front left motor: CW
|
||||
# @output MAIN4 Back right motor: CW
|
||||
# @output AUX1 Aileron 1
|
||||
# @output AUX2 Aileron 2
|
||||
# @output AUX3 Elevator
|
||||
# @output AUX4 Rudder
|
||||
# @output AUX5 Throttle
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
@@ -33,6 +40,8 @@ then
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
param set MC_YAWRATE_MAX 40
|
||||
param set MC_YAWRAUTO_MAX 40
|
||||
|
||||
param set FW_PR_FF 0.5
|
||||
param set FW_PR_I 0.02
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic quad delta VTOL.
|
||||
#
|
||||
# @name Generic quad delta VTOL
|
||||
# @type Standard VTOL
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@uaventure.com>
|
||||
# @output MAIN1 Front right motor: CCW
|
||||
# @output MAIN2 Back left motor: CCW
|
||||
# @output MAIN3 Front left motor: CW
|
||||
# @output MAIN4 Back right motor: CW
|
||||
# @output AUX1 Right elevon
|
||||
# @output AUX2 Left elevon
|
||||
# @output AUX3 Motor
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
@@ -31,6 +31,8 @@ then
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
param set MC_YAWRATE_MAX 40
|
||||
param set MC_YAWRAUTO_MAX 40
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
|
||||
@@ -34,6 +34,8 @@ then
|
||||
param set MC_YAWRATE_I 0.04
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAWRATE_FF 0.0
|
||||
param set MC_YAWRATE_MAX 40.0
|
||||
param set MC_YAWRAUTO_MAX 40.0
|
||||
|
||||
param set MPC_ACC_HOR_MAX 2.0
|
||||
param set MPC_Z_VEL_MAX 1.5
|
||||
|
||||
@@ -45,6 +45,7 @@ then
|
||||
param set MC_YAWRATE_I 0.02
|
||||
param set MC_YAWRATE_MAX 40.0
|
||||
param set MC_YAWRATE_P 0.18
|
||||
param set MC_YAWRATE_MAX 40.0
|
||||
param set MC_YAWRAUTO_MAX 40.0
|
||||
|
||||
param set MIS_TAKEOFF_ALT 2.5
|
||||
|
||||
@@ -17,6 +17,7 @@ param set VT_TILT_TRANS 0.5
|
||||
param set VT_TILT_FW 0.9
|
||||
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_FW_MOT_OFFID 13
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
fi
|
||||
|
||||
@@ -17,11 +17,6 @@ set MIXER coax
|
||||
|
||||
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
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Blade 130X
|
||||
#
|
||||
# @type Helicopter
|
||||
#
|
||||
# @maintainer Bart Slinger <bartslinger@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
# Configure as helicopter (number 4 defined in commander_helper.cpp)
|
||||
set MAV_TYPE 4
|
||||
|
||||
set MIXER heli_120deg
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 5.0
|
||||
param set MC_ROLLRATE_P 0.0
|
||||
param set MC_ROLLRATE_I 0.0
|
||||
param set MC_ROLLRATE_D 0.0
|
||||
param set MC_ROLLRATE_FF 0.15
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.0
|
||||
param set MC_PITCHRATE_I 0.0
|
||||
param set MC_PITCHRATE_D 0.0
|
||||
param set MC_PITCHRATE_FF 0.15
|
||||
param set MC_YAW_P 3.0
|
||||
param set MC_YAWRATE_P 0.1
|
||||
param set MC_YAWRATE_I 0.0
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.0
|
||||
param set MC_ROLLRATE_MAX 720.0
|
||||
param set MC_PITCHRATE_MAX 720.0
|
||||
param set MC_YAWRATE_MAX 400.0
|
||||
param set MC_ACRO_R_MAX 360.0
|
||||
param set MC_ACRO_P_MAX 360.0
|
||||
|
||||
param set PWM_MIN 1075
|
||||
|
||||
param set MPC_THR_MIN 0.06
|
||||
param set MPC_MANTHR_MIN 0.06
|
||||
|
||||
param set ATT_BIAS_MAX 0.0
|
||||
|
||||
param set CBRK_IO_SAFETY 22027
|
||||
fi
|
||||
@@ -17,17 +17,19 @@ 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_I 0.16
|
||||
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_I 0.2
|
||||
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 MC_TPA_BREAK 0.7
|
||||
param set MC_TPA_SLOPE 1.0
|
||||
param set PWM_MIN 1075
|
||||
param set MPC_THR_MIN 0.06
|
||||
param set MPC_MANTHR_MIN 0.06
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Generic Quadrotor X config with mount (e.g. gimbal)
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
#
|
||||
# @maintainer Leon Mueller <thedevleon>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER quad_x
|
||||
set PWM_OUT 1234
|
||||
|
||||
set MIXER_AUX mount
|
||||
set PWM_AUX_OUT 123456
|
||||
set PWM_AUX_RATE 50
|
||||
|
||||
# Start mount driver
|
||||
vmount start
|
||||
@@ -4,9 +4,15 @@
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output MAIN1 motor1 (front right: CCW)
|
||||
# @output MAIN2 motor2 (back left: CCW)
|
||||
# @output MAIN3 motor3 (front left: CW)
|
||||
# @output MAIN4 motor4 (back right: CW)
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
# @output AUX4 feed-through of RC FLAPS channel
|
||||
#
|
||||
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
|
||||
#
|
||||
@@ -33,4 +39,6 @@ then
|
||||
param set MPC_MANTHR_MIN 0.06
|
||||
param set CBRK_IO_SAFETY 22027
|
||||
param set ATT_BIAS_MAX 0.0
|
||||
param set MC_TPA_BREAK 0.5
|
||||
param set MC_TPA_SLOPE 1.0
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Parrot Bebop Frame
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Michael Schaeuble
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
#
|
||||
# Load default params for this platform
|
||||
#
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# Set all params here, then disable autoconfig
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.109999999403953552
|
||||
param set MC_ROLLRATE_I 0.0
|
||||
param set MC_ROLLRATE_D 0.0006
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.0
|
||||
param set MC_PITCHRATE_D 0.000799999
|
||||
param set MC_YAW_P 1.049999
|
||||
param set MC_YAWRATE_P 0.05
|
||||
param set MC_YAWRATE_I 0.001
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.7
|
||||
fi
|
||||
|
||||
set OUTPUT_MODE bebop
|
||||
set USE_IO no
|
||||
set MIXER bebop
|
||||
@@ -4,9 +4,15 @@
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output MAIN1 motor1 (front right: CCW)
|
||||
# @output MAIN2 motor2 (back left: CCW)
|
||||
# @output MAIN3 motor3 (front left: CW)
|
||||
# @output MAIN4 motor4 (back right: CW)
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
# @output AUX4 feed-through of RC FLAPS channel
|
||||
#
|
||||
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
|
||||
#
|
||||
@@ -20,9 +26,9 @@ then
|
||||
param set MC_ROLLRATE_I 0.1
|
||||
param set MC_ROLLRATE_D 0.0055
|
||||
param set MC_PITCH_P 8.0
|
||||
param set MC_PITCHRATE_P 0.24
|
||||
param set MC_PITCHRATE_P 0.19
|
||||
param set MC_PITCHRATE_I 0.1
|
||||
param set MC_PITCHRATE_D 0.0065
|
||||
param set MC_PITCHRATE_D 0.0055
|
||||
param set MC_YAW_P 4.0
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
@@ -33,6 +39,9 @@ then
|
||||
param set MC_YAWRATE_MAX 400.0
|
||||
param set MC_ACRO_R_MAX 360.0
|
||||
param set MC_ACRO_P_MAX 360.0
|
||||
param set MC_TPA_BREAK 0.5
|
||||
param set MC_TPA_SLOPE 1.0
|
||||
|
||||
|
||||
param set PWM_MIN 1075
|
||||
|
||||
|
||||
@@ -15,9 +15,17 @@ sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.05
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.001
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_PITCHRATE_P 0.05
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.001
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.0
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set BAT_N_CELLS 6
|
||||
param set PWM_MIN 1200
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Intel Aero RTF
|
||||
#
|
||||
# @type Quadrotor x
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
#
|
||||
# Load default params for this platform
|
||||
#
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# Set all params here, then disable autoconfig
|
||||
param set MC_ROLL_P 8.0000
|
||||
param set MC_ROLLRATE_P 0.1300
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.0012
|
||||
param set MC_ROLLRATE_MAX 360
|
||||
param set MC_PITCH_P 8.0000
|
||||
param set MC_PITCHRATE_P 0.1300
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.0012
|
||||
param set MC_PITCHRATE_MAX 360
|
||||
param set MC_YAW_P 4.0
|
||||
param set MC_YAWRATE_P 0.119999997317790985
|
||||
param set MC_YAWRATE_I 0.050000000745058060
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
param set MPC_XY_CRUISE 8
|
||||
|
||||
param set SYS_LOGGER 1
|
||||
fi
|
||||
|
||||
tap_esc start -d /dev/ttyS0 -n 4
|
||||
usleep 300000
|
||||
|
||||
set OUTPUT_MODE tap_esc
|
||||
set MIXER quad_x
|
||||
set USE_IO no
|
||||
|
||||
param set SYS_COMPANION 1500000
|
||||
set MAVLINK_COMPANION_DEVICE /dev/ttyS1
|
||||
@@ -0,0 +1,42 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Crazyflie 2.0
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set COM_RC_IN_MODE 2
|
||||
param set BAT_N_CELLS 1
|
||||
param set BAT_CAPACITY 240
|
||||
param set BAT_SOURCE 1
|
||||
|
||||
param set PWM_DISARMED 0
|
||||
param set PWM_MIN 0
|
||||
param set PWM_MAX 255
|
||||
|
||||
param set SYS_COMPANION 20
|
||||
|
||||
param set MC_PITCHRATE_D 0.0015
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_P 0.045
|
||||
param set MC_PITCH_P 6.5
|
||||
param set MC_ROLLRATE_D 0.0015
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_P 0.045
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_YAW_P 3.0
|
||||
|
||||
param set CBRK_SUPPLY_CHK 894281
|
||||
param set CBRK_USB_CHK 197848
|
||||
fi
|
||||
|
||||
set PWM_MIN none
|
||||
set PWM_MAX none
|
||||
set PWM_DISARMED none
|
||||
# Will run the motors at 328.125 kHz (recommended)
|
||||
set PWM_RATE 3921
|
||||
@@ -4,7 +4,7 @@
|
||||
# att & pos estimator, rover steering control
|
||||
#
|
||||
|
||||
ekf_att_pos_estimator start
|
||||
ekf2 start
|
||||
|
||||
# disabled the start of steering control app due to use of offboard mode only
|
||||
# rover_steering_control start
|
||||
|
||||
@@ -17,11 +17,6 @@ then
|
||||
|
||||
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
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.0
|
||||
fi
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
|
||||
@@ -43,6 +43,11 @@ then
|
||||
set OUTPUT_DEV /dev/uavcan/esc
|
||||
fi
|
||||
|
||||
if [ $OUTPUT_MODE == tap_esc ]
|
||||
then
|
||||
set OUTPUT_DEV /dev/tap_esc
|
||||
fi
|
||||
|
||||
if mixer load $OUTPUT_DEV $MIXER_FILE
|
||||
then
|
||||
echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
|
||||
@@ -109,6 +114,16 @@ then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
|
||||
then
|
||||
#
|
||||
@@ -133,7 +148,18 @@ then
|
||||
then
|
||||
if fmu mode_$AUX_MODE
|
||||
then
|
||||
if [ -e $OUTPUT_AUX_DEV ]
|
||||
# Append aux mixer to main device
|
||||
if [ $OUTPUT_MODE == hil ]
|
||||
then
|
||||
if mixer append $OUTPUT_DEV $MIXER_AUX_FILE
|
||||
then
|
||||
echo "INFO [init] Mixer: $MIXER_AUX_FILE appended to $OUTPUT_DEV"
|
||||
else
|
||||
echo "ERROR [init] Error appending mixer: $MIXER_AUX_FILE"
|
||||
echo "ERROR [init] Could not append mixer: $MIXER_AUX_FILE" >> $LOG_FILE
|
||||
fi
|
||||
fi
|
||||
if [ -e $OUTPUT_AUX_DEV -a $OUTPUT_MODE != hil ]
|
||||
then
|
||||
if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE
|
||||
then
|
||||
|
||||
@@ -8,18 +8,25 @@
|
||||
#---------------------------------------
|
||||
# Estimator group selction
|
||||
#
|
||||
# INAV
|
||||
# INAV (deprecated)
|
||||
if param compare SYS_MC_EST_GROUP 0
|
||||
then
|
||||
attitude_estimator_q start
|
||||
position_estimator_inav start
|
||||
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
|
||||
param set SYS_MC_EST_GROUP 1
|
||||
param save
|
||||
fi
|
||||
|
||||
# LPE
|
||||
if param compare SYS_MC_EST_GROUP 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
local_position_estimator start
|
||||
# Try to start LPE. If it fails, start EKF2 as a default
|
||||
# Unfortunately we do not build it on px4fmu-v2 duo to a limited flash.
|
||||
if attitude_estimator_q start
|
||||
then
|
||||
local_position_estimator start
|
||||
else
|
||||
ekf2 start
|
||||
fi
|
||||
fi
|
||||
|
||||
# EKF
|
||||
|
||||
@@ -4,24 +4,19 @@ 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 PWM_RATE 400
|
||||
|
||||
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_RATE p:PWM_RATE
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
@@ -34,15 +29,6 @@ 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
|
||||
|
||||
@@ -8,30 +8,47 @@ then
|
||||
if ms5611 start
|
||||
then
|
||||
fi
|
||||
|
||||
else
|
||||
# Configure all I2C buses to 100 KHz as they
|
||||
# are all external or slow
|
||||
fmu i2c 1 100000
|
||||
fmu i2c 2 100000
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
if ver hwcmp AEROFC_V1
|
||||
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
|
||||
# Aero FC uses separate driver
|
||||
else
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
# Crazyflie uses separate driver
|
||||
else
|
||||
# Configure all I2C buses to 100 KHz as they
|
||||
# are all external or slow
|
||||
fmu i2c 1 100000
|
||||
fmu i2c 2 100000
|
||||
fi
|
||||
|
||||
if ms5611 -s start
|
||||
then
|
||||
fi
|
||||
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 50
|
||||
fi
|
||||
|
||||
# Blacksheep telemetry
|
||||
if bst start
|
||||
then
|
||||
# External SPI
|
||||
if ms5611 -S start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI
|
||||
if ms5611 -s start
|
||||
then
|
||||
fi
|
||||
|
||||
# Blacksheep telemetry
|
||||
if bst start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -39,6 +56,29 @@ if adc start
|
||||
then
|
||||
fi
|
||||
|
||||
if ver hwcmp AUAV_X21
|
||||
then
|
||||
# I2C bus
|
||||
if hmc5883 -C -T start
|
||||
then
|
||||
fi
|
||||
|
||||
# I2C bus
|
||||
if lis3mdl 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
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
# External I2C bus
|
||||
@@ -56,16 +96,30 @@ then
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus ICM-20608-G
|
||||
if mpu6000 -T 20608 start
|
||||
then
|
||||
fi
|
||||
|
||||
# external MPU6K is rotated 180 degrees yaw
|
||||
if mpu6000 -X -R 4 start
|
||||
if mpu6000 -S -R 4 start
|
||||
then
|
||||
set BOARD_FMUV3 true
|
||||
else
|
||||
set BOARD_FMUV3 false
|
||||
# Check for Pixhawk 2.1 board
|
||||
if mpu9250 -S -R 4 start
|
||||
then
|
||||
set BOARD_FMUV3 true
|
||||
else
|
||||
set BOARD_FMUV3 false
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $BOARD_FMUV3 == true ]
|
||||
then
|
||||
# sensor heating is available, but we disable it for now
|
||||
param set SENS_EN_THERMAL 0
|
||||
|
||||
# external L3GD20H is rotated 180 degrees yaw
|
||||
if l3gd20 -X -R 4 start
|
||||
then
|
||||
@@ -79,6 +133,10 @@ then
|
||||
# internal MPU6000 is rotated 180 deg roll, 270 deg yaw
|
||||
if mpu6000 -R 14 start
|
||||
then
|
||||
else
|
||||
if mpu9250 -R 14 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if hmc5883 -C -T -S -R 8 start
|
||||
@@ -95,6 +153,10 @@ then
|
||||
then
|
||||
fi
|
||||
|
||||
if mpu9250 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
@@ -126,10 +188,19 @@ then
|
||||
then
|
||||
fi
|
||||
|
||||
# Start either MPU9250 or BMI160. They are both connected to the same SPI bus and use the same
|
||||
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
||||
# will prevent the incorrect driver from a successful initialization.
|
||||
|
||||
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||
if mpu9250 -R 2 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal SPI bus BMI160
|
||||
if bmi160 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V1
|
||||
@@ -167,24 +238,63 @@ fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
if mpu6500 start
|
||||
then
|
||||
fi
|
||||
|
||||
if lsm303d start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lis3mdl -R 2 start
|
||||
# Internal I2C bus
|
||||
if hmc5883 -C -T -I -R 8 start
|
||||
then
|
||||
fi
|
||||
|
||||
if mpu6500 -R 8 start
|
||||
then
|
||||
fi
|
||||
|
||||
if lsm303d -R 10 start
|
||||
then
|
||||
fi
|
||||
|
||||
if l3gd20 -R 14 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
# Onboard I2C
|
||||
if mpu9250 -R 12 start
|
||||
then
|
||||
fi
|
||||
|
||||
# I2C bypass of mpu
|
||||
if lps25h start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
if ms5611 start
|
||||
then
|
||||
fi
|
||||
|
||||
if mpu6500 -R 14 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Internal compass
|
||||
if hmc5883 -I -R 4 start
|
||||
then
|
||||
fi
|
||||
|
||||
# Possible external compasses
|
||||
if hmc5883 -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if ist8310 -C -b 1 -R 8 start
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -9,18 +9,25 @@
|
||||
#---------------------------------------
|
||||
# Estimator group selction
|
||||
#
|
||||
# INAV
|
||||
# INAV (deprecated)
|
||||
if param compare SYS_MC_EST_GROUP 0
|
||||
then
|
||||
attitude_estimator_q start
|
||||
position_estimator_inav start
|
||||
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
|
||||
param set SYS_MC_EST_GROUP 1
|
||||
param save
|
||||
fi
|
||||
|
||||
# LPE
|
||||
if param compare SYS_MC_EST_GROUP 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
local_position_estimator start
|
||||
# Try to start LPE. If it fails, start EKF2 as a default
|
||||
# Unfortunately we do not build it on px4fmu-v2 duo to a limited flash.
|
||||
if attitude_estimator_q start
|
||||
then
|
||||
local_position_estimator start
|
||||
else
|
||||
ekf2 start
|
||||
fi
|
||||
fi
|
||||
|
||||
# EKF
|
||||
|
||||
@@ -8,12 +8,6 @@ then
|
||||
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
|
||||
#
|
||||
@@ -34,15 +28,6 @@ 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
|
||||
|
||||
+164
-89
@@ -145,6 +145,7 @@ then
|
||||
set FMU_MODE pwm
|
||||
set AUX_MODE pwm
|
||||
set MAVLINK_F default
|
||||
set MAVLINK_COMPANION_DEVICE /dev/ttyS2
|
||||
set EXIT_ON_END no
|
||||
set MAV_TYPE none
|
||||
set FAILSAFE none
|
||||
@@ -164,18 +165,36 @@ then
|
||||
then
|
||||
set USE_IO no
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
set USE_IO no
|
||||
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
param set SYS_AUTOSTART 4900
|
||||
set AUTOCNF yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set USE_IO no
|
||||
fi
|
||||
else
|
||||
set USE_IO no
|
||||
fi
|
||||
|
||||
# should set to 0.8 for mindpx-v2 borad.
|
||||
if param compare INAV_LIDAR_ERR 0.5
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
if ver hwcmp MINDPX_V2
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
param set INAV_LIDAR_ERR 0.8
|
||||
param save
|
||||
set AUTOCNF yes
|
||||
fi
|
||||
|
||||
# We don't allow changing AUTOSTART as it doesn't work in
|
||||
# other configurations
|
||||
param set SYS_AUTOSTART 4070
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -183,7 +202,6 @@ then
|
||||
#
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
echo "INFO [init] No autostart"
|
||||
else
|
||||
sh /etc/init.d/rc.autostart
|
||||
fi
|
||||
@@ -196,13 +214,18 @@ then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set MIXER_AUX none
|
||||
fi
|
||||
|
||||
#
|
||||
# Override parameters from user configuration file
|
||||
#
|
||||
set FCONFIG /fs/microsd/etc/config.txt
|
||||
if [ -f $FCONFIG ]
|
||||
then
|
||||
echo "INFO [init] Custom: $FCONFIG"
|
||||
echo "Custom: $FCONFIG"
|
||||
sh $FCONFIG
|
||||
fi
|
||||
unset FCONFIG
|
||||
@@ -213,7 +236,6 @@ then
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set SYS_AUTOCONFIG 0
|
||||
param save
|
||||
fi
|
||||
unset AUTOCNF
|
||||
|
||||
@@ -233,7 +255,7 @@ then
|
||||
|
||||
if px4io checkcrc ${IO_FILE}
|
||||
then
|
||||
echo "INFO [init] PX4IO CRC OK" >> $LOG_FILE
|
||||
echo "[init] PX4IO CRC OK" >> $LOG_FILE
|
||||
|
||||
set IO_PRESENT yes
|
||||
else
|
||||
@@ -256,16 +278,16 @@ then
|
||||
usleep 500000
|
||||
if px4io checkcrc $IO_FILE
|
||||
then
|
||||
echo "INFO [init] PX4IO CRC OK after updating" >> $LOG_FILE
|
||||
echo "PX4IO CRC OK after updating" >> $LOG_FILE
|
||||
tone_alarm MLL8CDE
|
||||
|
||||
set IO_PRESENT yes
|
||||
else
|
||||
echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
|
||||
echo "PX4IO update failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
else
|
||||
echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
|
||||
echo "PX4IO update failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -273,7 +295,7 @@ then
|
||||
|
||||
if [ $IO_PRESENT == no ]
|
||||
then
|
||||
echo "ERROR [init] PX4IO not found" >> $LOG_FILE
|
||||
echo "PX4IO not found" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -308,6 +330,11 @@ then
|
||||
set FMU_MODE gpio_serial
|
||||
fi
|
||||
|
||||
if [ $OUTPUT_MODE == tap_esc ]
|
||||
then
|
||||
set FMU_MODE rcin
|
||||
fi
|
||||
|
||||
if [ $HIL == yes ]
|
||||
then
|
||||
set OUTPUT_MODE hil
|
||||
@@ -358,6 +385,20 @@ then
|
||||
set OUTPUT_MODE uavcan_esc
|
||||
fi
|
||||
|
||||
# Sensors on the PWM interface bank
|
||||
# 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
|
||||
set FMU_MODE pwm4
|
||||
set AUX_MODE pwm4
|
||||
camera_trigger start
|
||||
fi
|
||||
|
||||
# If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output
|
||||
if [ $OUTPUT_MODE != none ]
|
||||
then
|
||||
@@ -365,8 +406,8 @@ then
|
||||
then
|
||||
if param compare UAVCAN_ENABLE 0
|
||||
then
|
||||
echo "INFO [init] OVERRIDING UAVCAN_ENABLE = 1" >> $LOG_FILE
|
||||
param set UAVCAN_ENABLE 1
|
||||
echo "OVERRIDING UAVCAN_ENABLE = 3" >> $LOG_FILE
|
||||
param set UAVCAN_ENABLE 3
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -376,7 +417,7 @@ then
|
||||
then
|
||||
sh /etc/init.d/rc.io
|
||||
else
|
||||
echo "INFO [init] PX4IO start failed" >> $LOG_FILE
|
||||
echo "PX4IO start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -386,7 +427,7 @@ then
|
||||
if fmu mode_$FMU_MODE
|
||||
then
|
||||
else
|
||||
echo "ERR [init] FMU start failed" >> $LOG_FILE
|
||||
echo "FMU start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
|
||||
@@ -418,7 +459,7 @@ then
|
||||
if mkblctrl $MKBLCTRL_ARG
|
||||
then
|
||||
else
|
||||
echo "ERROR [init] MK start failed" >> $LOG_FILE
|
||||
echo "MK start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
unset MKBLCTRL_ARG
|
||||
@@ -427,10 +468,9 @@ then
|
||||
|
||||
if [ $OUTPUT_MODE == hil ]
|
||||
then
|
||||
if pwm_out_sim mode_port2_pwm8
|
||||
if pwm_out_sim mode_pwm16
|
||||
then
|
||||
else
|
||||
echo "ERROR [init] PWM SIM start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -446,7 +486,7 @@ then
|
||||
then
|
||||
sh /etc/init.d/rc.io
|
||||
else
|
||||
echo "ERROR [init] PX4IO start failed" >> $LOG_FILE
|
||||
echo "PX4IO start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
fi
|
||||
@@ -456,7 +496,7 @@ then
|
||||
if fmu mode_$FMU_MODE
|
||||
then
|
||||
else
|
||||
echo "ERROR [init] FMU mode_$FMU_MODE start failed" >> $LOG_FILE
|
||||
echo "FMU mode_$FMU_MODE start failed" >> $LOG_FILE
|
||||
tone_alarm $TUNE_ERR
|
||||
fi
|
||||
|
||||
@@ -494,10 +534,25 @@ then
|
||||
# Start MAVLink on Wifi (ESP8266 port)
|
||||
mavlink start -r 20000 -m config -b 921600 -d /dev/ttyS0
|
||||
fi
|
||||
|
||||
if ver hwcmp AEROFC_V1
|
||||
then
|
||||
set MAVLINK_F "-r 1200 -d /dev/ttyS4"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
# Avoid using either of the two available serials
|
||||
set MAVLINK_F none
|
||||
fi
|
||||
fi
|
||||
|
||||
mavlink start $MAVLINK_F
|
||||
if [ "x$MAVLINK_F" == xnone ]
|
||||
then
|
||||
else
|
||||
mavlink start $MAVLINK_F
|
||||
fi
|
||||
unset MAVLINK_F
|
||||
|
||||
#
|
||||
@@ -510,60 +565,57 @@ then
|
||||
# but this works for now
|
||||
if param compare SYS_COMPANION 10
|
||||
then
|
||||
frsky_telemetry start -d /dev/ttyS2
|
||||
frsky_telemetry start -d $MAVLINK_COMPANION_DEVICE
|
||||
fi
|
||||
if param compare SYS_COMPANION 20
|
||||
then
|
||||
syslink start
|
||||
mavlink start -d /dev/bridge0 -b 57600 -m osd -r 40000
|
||||
fi
|
||||
if param compare SYS_COMPANION 921600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 921600 -m onboard -r 80000 -x
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 921600 -m onboard -r 80000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 57600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m onboard -r 5000 -x
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m onboard -r 5000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 157600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m osd -r 1000
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m osd -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 257600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m magic -r 5000 -x
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m magic -r 5000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 319200
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 19200 -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 338400
|
||||
then
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 38400 -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 357600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -r 1000
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -r 1000
|
||||
fi
|
||||
if param compare SYS_COMPANION 1921600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 921600 -r 20000
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 921600 -r 20000
|
||||
fi
|
||||
# Sensors on the PWM interface bank
|
||||
# clear pins 5 and 6
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
if param compare SYS_COMPANION 1500000
|
||||
then
|
||||
set FMU_MODE pwm4
|
||||
set AUX_MODE pwm4
|
||||
fi
|
||||
if param greater TRIG_MODE 0
|
||||
then
|
||||
set FMU_MODE pwm4
|
||||
set AUX_MODE pwm4
|
||||
camera_trigger start
|
||||
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 1500000 -m onboard -r 100000 -x
|
||||
fi
|
||||
fi
|
||||
|
||||
unset MAVLINK_COMPANION_DEVICE
|
||||
|
||||
#
|
||||
# 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
|
||||
@@ -587,44 +639,62 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
# sf0x lidar sensor
|
||||
if param compare SENS_EN_SF0X 1
|
||||
# lightware serial lidar sensor
|
||||
if param compare SENS_EN_SF0X 0
|
||||
then
|
||||
else
|
||||
sf0x start
|
||||
fi
|
||||
|
||||
# lightware i2c lidar sensor
|
||||
if param compare SENS_EN_SF1XX 0
|
||||
then
|
||||
else
|
||||
sf1xx start
|
||||
fi
|
||||
|
||||
# mb12xx sonar sensor
|
||||
if param compare SENS_EN_MB12XX 1
|
||||
then
|
||||
mb12xx start
|
||||
fi
|
||||
|
||||
# teraranger one tof sensor
|
||||
if param compare SENS_EN_TRONE 1
|
||||
then
|
||||
trone start
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
frsky_telemetry start -d /dev/ttyS6
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
frsky_telemetry start -d /dev/ttyS6
|
||||
fi
|
||||
|
||||
if ver hwcmp PX4FMU_V2
|
||||
then
|
||||
# Check for flow sensor - as it is a background task, launch it last
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
if ver hwcmp MINDPX_V2
|
||||
if ver hwcmp PX4FMU_V4
|
||||
then
|
||||
#mindxp also need flow
|
||||
# Check for flow sensor - as it is a background task, launch it last
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
# Start USB shell if no microSD present, MAVLink else
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
if ver hwcmp MINDPX_V2
|
||||
then
|
||||
# Try to get an USB console
|
||||
nshterm /dev/ttyACM0 &
|
||||
else
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
px4flow start &
|
||||
fi
|
||||
|
||||
# Start MAVLink
|
||||
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
@@ -634,30 +704,34 @@ then
|
||||
then
|
||||
fi
|
||||
else
|
||||
# check if we should increase logging rate for ekf2 replay message logging
|
||||
if param greater EKF2_REC_RPL 0
|
||||
if param compare SYS_LOGGER 0
|
||||
then
|
||||
if param compare SYS_LOGGER 0
|
||||
# check if we should increase logging rate for ekf2 replay message logging
|
||||
if param greater EKF2_REC_RPL 0
|
||||
then
|
||||
if sdlog2 start -r 500 -e -b 18 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
if logger start -r 500
|
||||
if sdlog2 start -r 100 -a -b 9 -t
|
||||
then
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if param compare SYS_LOGGER 0
|
||||
set LOGGER_ARGS ""
|
||||
if param compare SDLOG_MODE 1
|
||||
then
|
||||
if sdlog2 start -r 100 -a -b 9 -t
|
||||
then
|
||||
fi
|
||||
else
|
||||
if logger start -b 12 -t
|
||||
then
|
||||
fi
|
||||
set LOGGER_ARGS "-e"
|
||||
fi
|
||||
if param compare SDLOG_MODE 2
|
||||
then
|
||||
set LOGGER_ARGS "-f"
|
||||
fi
|
||||
|
||||
if logger start -b 12 -t $LOGGER_ARGS
|
||||
then
|
||||
fi
|
||||
unset LOGGER_ARGS
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -674,8 +748,6 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == fw ]
|
||||
then
|
||||
echo "INFO [init] Fixedwing"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
# Set default mixer for fixed wing if not defined
|
||||
@@ -702,11 +774,9 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == mc ]
|
||||
then
|
||||
echo "INFO [init] Multicopter"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
echo "INFO [init] Mixer undefined"
|
||||
echo "Mixer undefined"
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
@@ -753,7 +823,7 @@ then
|
||||
# Still no MAV_TYPE found
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
echo "WARN [init] Unknown MAV_TYPE"
|
||||
echo "Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 2
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
@@ -771,11 +841,9 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == vtol ]
|
||||
then
|
||||
echo "INFO [init] VTOL"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
then
|
||||
echo "WARN [init] VTOL mixer undefined"
|
||||
echo "VTOL mixer undefined"
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
@@ -798,7 +866,7 @@ then
|
||||
# Still no MAV_TYPE found
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
echo "WARN [init] Unknown MAV_TYPE"
|
||||
echo "Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 19
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
@@ -882,23 +950,30 @@ then
|
||||
#
|
||||
if [ $VEHICLE_TYPE == none ]
|
||||
then
|
||||
echo "WARN [init] No autostart ID found"
|
||||
echo "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"
|
||||
echo "Addons script: $FEXTRAS"
|
||||
sh $FEXTRAS
|
||||
fi
|
||||
unset FEXTRAS
|
||||
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
if ver hwcmp CRAZYFLIE
|
||||
then
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
# CF2 shouldn't have an sd card
|
||||
else
|
||||
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# End of autostart
|
||||
@@ -913,7 +988,7 @@ mavlink boot_complete
|
||||
|
||||
if [ $EXIT_ON_END == yes ]
|
||||
then
|
||||
echo "INFO [init] NSH exit"
|
||||
echo "NSH exit"
|
||||
exit
|
||||
fi
|
||||
unset EXIT_ON_END
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Multirotor mixer for Parrot Bebop
|
||||
=================================
|
||||
|
||||
This file defines a single mixer for a quadrotor in the x configuration. All controls
|
||||
are mixed 100%.
|
||||
|
||||
R: 4x 10000 10000 -10000 0
|
||||
@@ -1,4 +1,4 @@
|
||||
# mixer for the CruiseAder Claire tilt mechansim servo, aileron and elevator
|
||||
# mixer for the CruiseAder Claire tilt mechansim servo and elevons
|
||||
|
||||
=======================================================================
|
||||
|
||||
@@ -15,24 +15,17 @@ S: 1 4 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
|
||||
Aileron mixers
|
||||
Elevon mixers
|
||||
|
||||
-------------
|
||||
|
||||
M: 1
|
||||
M: 2
|
||||
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 -7500 -7500 0 -10000 10000
|
||||
S: 1 1 7500 7500 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
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 -7500 -7500 0 -10000 10000
|
||||
S: 1 1 -7500 -7500 0 -10000 10000
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
Helicopter 120 degree Cyclic-Collective-Pitch Mixing (CCPM) for PX4FMU
|
||||
Blade 130x helicopter has longer servo arms left and right. The front servo arm is shorter.
|
||||
Therefore it is not required to use the 0.866 factor.
|
||||
==================================================
|
||||
|
||||
Output 0 - Left Servo Mixer
|
||||
-----------------
|
||||
Left Servo = Collective (Thurst - 3) - 0.5 * Elevator (Pitch - 1) + Aileron (Roll - 0)
|
||||
|
||||
M: 3
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 1 -10000 -10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
Output 1 - Front Servo Mixer
|
||||
----------------
|
||||
|
||||
Rear Servo = Collective (Thrust - 3) + Elevator (Pitch - 1)
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 1 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
Output 2 - Right Servo Mixer
|
||||
----------------
|
||||
Right Servo = Collective (Thurst - 3) - 0.5 * Elevator (Pitch - 1) - Aileron (Roll - 0)
|
||||
|
||||
M: 3
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 3 5 10000 10000 0 -10000 10000
|
||||
S: 0 1 -10000 -10000 0 -10000 10000
|
||||
S: 0 0 -10000 -10000 0 -10000 10000
|
||||
|
||||
|
||||
Output 3 - Tail Servo Mixer
|
||||
----------------
|
||||
Tail Servo = Yaw (control index = 2)
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
Output 4 - Motor speed mixer
|
||||
-----------------
|
||||
This would be the motor speed control output from governor power demand- not sure what index to use here?
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
@@ -1,3 +1,4 @@
|
||||
# Hexa X
|
||||
|
||||
R: 6x 10000 10000 10000 0
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Mount Mixer (e.g. Gimbal, servo-controlled gimbal, etc...)
|
||||
|
||||
|
||||
# pitch
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 0 10000 10000 0 -10000 10000
|
||||
|
||||
# roll
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 1 10000 10000 0 -10000 10000
|
||||
|
||||
# yaw
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 2 10000 10000 0 -10000 10000
|
||||
|
||||
# mode
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 3 10000 10000 0 -10000 10000
|
||||
|
||||
# retracts
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 4 10000 10000 0 -10000 10000
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
# Roll channel for mount
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 0 10000 10000 0 -10000 10000
|
||||
|
||||
# Pitch channel for mount
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 1 10000 10000 0 -10000 10000
|
||||
|
||||
# Yaw channel for mount
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 2 10000 10000 0 -10000 10000
|
||||
|
||||
|
||||
# mixer for left leg
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 0 20000 -10000 -10000 10000
|
||||
|
||||
# mixer for right leg
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 0 20000 -10000 -10000 10000
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
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: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 -4000 -4000 0 -10000 10000
|
||||
S: 0 1 10000 10000 0 -10000 10000
|
||||
|
||||
# mixer for the right aileron
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 4000 4000 0 -10000 10000
|
||||
S: 0 1 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
|
||||
@@ -12,7 +12,10 @@
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
if tap_esc start -d /dev/ttyS4 -n 4
|
||||
then
|
||||
fi
|
||||
set OUTPUT_MODE tap_esc
|
||||
param set BAT_N_CELLS 4
|
||||
|
||||
set MIXER quad_x
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
@@ -13,7 +13,13 @@
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER hexa_x
|
||||
param set MAV_TYPE 13
|
||||
param set MC_YAWRATE_P 0.12
|
||||
param set CAL_MAG0_ROT 6
|
||||
|
||||
# Need to set all 8 channels
|
||||
set PWM_OUT 12345678
|
||||
if tap_esc start -d /dev/ttyS4 -n 6
|
||||
then
|
||||
fi
|
||||
set OUTPUT_MODE tap_esc
|
||||
|
||||
set MIXER hexa_x
|
||||
|
||||
@@ -12,11 +12,6 @@ then
|
||||
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
|
||||
|
||||
@@ -16,9 +16,9 @@ then
|
||||
|
||||
set OUTPUT_DEV /dev/pwm_output0
|
||||
|
||||
if [ $OUTPUT_MODE == uavcan_esc ]
|
||||
if [ $OUTPUT_MODE == tap_esc ]
|
||||
then
|
||||
set OUTPUT_DEV /dev/uavcan/esc
|
||||
set OUTPUT_DEV /dev/tap_esc
|
||||
fi
|
||||
|
||||
if mixer load $OUTPUT_DEV $MIXER_FILE
|
||||
|
||||
@@ -4,21 +4,19 @@ 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
|
||||
|
||||
param set NAV_ACC_RAD 2.0
|
||||
param set MIS_TAKEOFF_ALT 2.5
|
||||
param set RTL_RETURN_ALT 30.0
|
||||
param set RTL_DESCEND_ALT 10.0
|
||||
param set RTL_LAND_DELAY 0
|
||||
param set MPC_THR_MIN 0.10
|
||||
param set MPC_MANTHR_MIN 0.04
|
||||
|
||||
# set environment variables (!= parameters)
|
||||
set PWM_RATE 400
|
||||
# tell the mixer to use parameters for these instead
|
||||
@@ -33,17 +31,3 @@ 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
|
||||
|
||||
@@ -7,40 +7,22 @@ if adc start
|
||||
then
|
||||
fi
|
||||
|
||||
if ms5611 -T 5607 -I start
|
||||
then
|
||||
fi
|
||||
|
||||
# External I2C bus
|
||||
if hmc5883 -C -T -X start
|
||||
then
|
||||
fi
|
||||
|
||||
if lis3mdl -R 2 start
|
||||
# Internal I2C bus
|
||||
if mpu6000 -I -T 6000 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
|
||||
# Wait 50 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
|
||||
usleep 50000
|
||||
if sensors start
|
||||
then
|
||||
fi
|
||||
|
||||
@@ -8,12 +8,6 @@ then
|
||||
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
|
||||
#
|
||||
|
||||
+278
-404
@@ -1,38 +1,41 @@
|
||||
#!nsh
|
||||
#
|
||||
# PX4FMU startup script.
|
||||
# TAP startup script.
|
||||
#
|
||||
# NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS.
|
||||
#
|
||||
|
||||
# Serial map:
|
||||
# /dev/ttyS0: GPS
|
||||
# /dev/ttyS1: GB
|
||||
# /dev/ttyS2: nsh shell / console
|
||||
# /dev/ttyS3: payload
|
||||
# /dev/ttyS4: esc bus
|
||||
# /dev/ttyS5: RC input
|
||||
|
||||
#
|
||||
# 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
|
||||
set DATAMAN_OPT -r
|
||||
|
||||
#
|
||||
# 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
|
||||
echo "microSD present"
|
||||
unset DATAMAN_OPT
|
||||
else
|
||||
tone_alarm MBAGP
|
||||
if mkfatfs /dev/mmcsd0
|
||||
then
|
||||
if mount -t vfat /dev/mmcsd0 /fs/microsd
|
||||
then
|
||||
echo "INFO [init] MicroSD card formatted"
|
||||
echo "microSD card formatted"
|
||||
unset DATAMAN_OPT
|
||||
else
|
||||
echo "ERROR [init] Format failed"
|
||||
tone_alarm MNBG
|
||||
@@ -44,431 +47,309 @@ else
|
||||
fi
|
||||
|
||||
#
|
||||
# Look for an init script on the microSD card.
|
||||
# Disable autostart if the script found.
|
||||
# Start the ORB (first app to start)
|
||||
#
|
||||
set FRC /fs/microsd/etc/rc.txt
|
||||
if [ -f $FRC ]
|
||||
uorb start
|
||||
|
||||
#
|
||||
# Load parameters
|
||||
#
|
||||
set PARAM_FILE /fs/microsd/params
|
||||
if mtd start
|
||||
then
|
||||
echo "INFO [init] Executing script: $FRC"
|
||||
sh $FRC
|
||||
set MODE custom
|
||||
set PARAM_FILE /fs/mtd_params
|
||||
fi
|
||||
unset FRC
|
||||
|
||||
if [ $MODE == autostart ]
|
||||
param select $PARAM_FILE
|
||||
if param load
|
||||
then
|
||||
|
||||
#
|
||||
# Start the ORB (first app to start)
|
||||
#
|
||||
uorb start
|
||||
|
||||
#
|
||||
# Load parameters
|
||||
#
|
||||
set PARAM_FILE /fs/microsd/params
|
||||
if mtd start
|
||||
else
|
||||
if param reset
|
||||
then
|
||||
set PARAM_FILE /fs/mtd_params
|
||||
fi
|
||||
fi
|
||||
|
||||
param select $PARAM_FILE
|
||||
if param load
|
||||
tone_alarm start
|
||||
|
||||
#
|
||||
# Start system state indicator
|
||||
#
|
||||
if rgbled start
|
||||
then
|
||||
fi
|
||||
|
||||
#
|
||||
# Set parameters and env variables for selected AUTOSTART
|
||||
#
|
||||
if param compare SYS_AUTOSTART 0
|
||||
then
|
||||
param set SYS_AUTOSTART 6001
|
||||
param set SYS_AUTOCONFIG 1
|
||||
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 MAV_TYPE none
|
||||
set FAILSAFE none
|
||||
|
||||
# Start canned airframe config
|
||||
sh /etc/init.d/rc.autostart
|
||||
|
||||
#
|
||||
# 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
|
||||
if param reset
|
||||
set OUTPUT_MODE fmu
|
||||
fi
|
||||
fi
|
||||
|
||||
gps start -d /dev/ttyS0
|
||||
|
||||
# waypoint storage
|
||||
# REBOOTWORK this needs to start in parallel
|
||||
if dataman start $DATAMAN_OPT
|
||||
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 MAVLink on the gimbal port
|
||||
#mavlink start -r 1200 -d /dev/ttyS1
|
||||
|
||||
# Start MAVLink on USB, developers can use the MAVLink shell
|
||||
mavlink start -r 60000 -d /dev/ttyACM0 -m config
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
#if logger start -b 2 -t
|
||||
#then
|
||||
#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
|
||||
|
||||
#
|
||||
# Start system state indicator
|
||||
#
|
||||
if rgbled start
|
||||
# Still no MAV_TYPE found
|
||||
if [ $MAV_TYPE == none ]
|
||||
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
|
||||
echo "WARN [init] Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 2
|
||||
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 ]
|
||||
# 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 "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
|
||||
echo "WARN [init] VTOL mixer undefined"
|
||||
fi
|
||||
|
||||
#
|
||||
# VTOL setup
|
||||
#
|
||||
if [ $VEHICLE_TYPE == vtol ]
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
echo "INFO [init] VTOL"
|
||||
|
||||
if [ $MIXER == none ]
|
||||
# Use mixer to detect vehicle type
|
||||
if [ $MIXER == caipirinha_vtol ]
|
||||
then
|
||||
echo "WARN [init] VTOL mixer undefined"
|
||||
set MAV_TYPE 19
|
||||
fi
|
||||
|
||||
if [ $MAV_TYPE == none ]
|
||||
if [ $MIXER == firefly6 ]
|
||||
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
|
||||
set MAV_TYPE 21
|
||||
fi
|
||||
|
||||
# Still no MAV_TYPE found
|
||||
if [ $MAV_TYPE == none ]
|
||||
if [ $MIXER == quad_x_pusher_vtol ]
|
||||
then
|
||||
echo "WARN [init] Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 19
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
set MAV_TYPE 22
|
||||
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 ]
|
||||
# Still no MAV_TYPE found
|
||||
if [ $MAV_TYPE == none ]
|
||||
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
|
||||
echo "WARN [init] Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 19
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
fi
|
||||
|
||||
unset MIXER
|
||||
unset MAV_TYPE
|
||||
unset OUTPUT_MODE
|
||||
# Load mixer and configure outputs
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
#
|
||||
# Start the navigator
|
||||
#
|
||||
navigator start
|
||||
# Start standard vtol apps
|
||||
sh /etc/init.d/rc.vtol_apps
|
||||
fi
|
||||
|
||||
#
|
||||
# Generic setup (autostart ID not found)
|
||||
#
|
||||
if [ $VEHICLE_TYPE == none ]
|
||||
then
|
||||
echo "WARN [init] No autostart ID found"
|
||||
fi
|
||||
#
|
||||
# Rover setup
|
||||
#
|
||||
if [ $VEHICLE_TYPE == rover ]
|
||||
then
|
||||
# 10 is MAV_TYPE_GROUND_ROVER
|
||||
set MAV_TYPE 10
|
||||
|
||||
# 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
|
||||
# Load mixer and configure outputs
|
||||
sh /etc/init.d/rc.interface
|
||||
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
fi
|
||||
# Start standard rover apps
|
||||
sh /etc/init.d/rc.axialracing_ax10_apps
|
||||
|
||||
# End of autostart
|
||||
param set MAV_TYPE 10
|
||||
fi
|
||||
|
||||
unset MIXER
|
||||
unset MAV_TYPE
|
||||
unset OUTPUT_MODE
|
||||
|
||||
#
|
||||
# Start the RC input driver
|
||||
#
|
||||
if fmu mode_pwm1
|
||||
then
|
||||
fi
|
||||
|
||||
#
|
||||
# Use 400 Hz PWM output for landing gear (frequency also affects RGB LED)
|
||||
#
|
||||
pwm rate -c 1 -r 400
|
||||
|
||||
#
|
||||
# Load the gear mixer onto fmu
|
||||
#
|
||||
mixer load /dev/px4fmu /etc/mixers/gear.mix
|
||||
|
||||
#
|
||||
# Start the navigator
|
||||
#
|
||||
if navigator start
|
||||
then
|
||||
fi
|
||||
|
||||
# There is no further script processing, so we can free some RAM
|
||||
@@ -477,10 +358,3 @@ 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
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# This maps actuator_controls_0[7] to the first and only PWM output
|
||||
#
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
@@ -33,6 +33,10 @@ sleep 1
|
||||
adb shell mount -o remount,rw /
|
||||
adb shell touch /home/root/parameters
|
||||
|
||||
${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-strip \
|
||||
-R .comment -R .gnu.version \
|
||||
../build_posix_bebop_default/src/firmware/posix/px4
|
||||
|
||||
../Tools/adb_upload.sh $@
|
||||
|
||||
echo "Disconnecting from bebop"
|
||||
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (C) 2016 Intel Corporation. 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
set -e
|
||||
|
||||
USER=${AERO_USER:-root}
|
||||
HOSTNAME=${AERO_HOSTNAME:-intel-aero.local}
|
||||
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
|
||||
|
||||
target=$USER@$HOSTNAME
|
||||
firmware=$1
|
||||
px_uploader=${SCRIPT_DIR}/px_uploader.py
|
||||
|
||||
echo "Copying files to Aero board ($target)..."
|
||||
scp -v $firmware $px_uploader $target:
|
||||
|
||||
echo "Running px_uploader.py on Aero to update firmware in AeroFC..."
|
||||
ssh $target 'PATH=$PATH":/usr/sbin" && /etc/init.d/mavlink_bridge.sh stop'
|
||||
ssh $target "./px_uploader.py --port /dev/ttyS1 --baud-flightstack 1500000 $(basename $firmware)"
|
||||
ssh $target 'PATH=$PATH":/usr/sbin" && /etc/init.d/mavlink_bridge.sh start'
|
||||
|
||||
echo "Firmware updated"
|
||||
+13
-13
@@ -1,23 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
file=$1
|
||||
|
||||
FILE=$1
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
if [ -f "$file" ];
|
||||
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
|
||||
if [ -f "$FILE" ]; 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
|
||||
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty
|
||||
rm -f $FILE.pretty
|
||||
echo
|
||||
|
||||
rm -f $file.pretty
|
||||
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
|
||||
exit 1
|
||||
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
|
||||
${DIR}/fix_code_style.sh $FILE
|
||||
else
|
||||
echo $FILE 'bad formatting, please run "make format" or "./Tools/fix_code_style.sh' $FILE'"'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
failed=0
|
||||
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
ASTYLE_VER_REQUIRED="Artistic Style Version 2.05.1"
|
||||
astyle_ver() {
|
||||
echo "PX4 requires ${ASTYLE_VER_REQUIRED}"
|
||||
echo "You can get the correct version here: https://github.com/PX4/astyle/releases/tag/2.05.1"
|
||||
}
|
||||
|
||||
find \
|
||||
src/drivers \
|
||||
src/examples \
|
||||
src/firmware \
|
||||
src/include \
|
||||
src/lib/controllib \
|
||||
src/lib/conversion \
|
||||
src/lib/geo \
|
||||
src/lib/geo_lookup \
|
||||
src/lib/launchdetection \
|
||||
src/lib/rc \
|
||||
src/lib/tailsitter_recovery \
|
||||
src/lib/terrain_estimation \
|
||||
src/lib/version \
|
||||
src/modules/attitude_estimator_q \
|
||||
src/modules/bottle_drop \
|
||||
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 \
|
||||
src/modules/logger \
|
||||
src/modules/mavlink/mavlink_tests \
|
||||
src/modules/muorb \
|
||||
src/modules/param \
|
||||
src/modules/px4iofirmware \
|
||||
src/modules/replay \
|
||||
src/modules/segway \
|
||||
src/modules/sensors \
|
||||
src/modules/simulator \
|
||||
src/modules/systemlib \
|
||||
src/modules/unit_test \
|
||||
src/modules/uORB \
|
||||
src/modules/vtol_att_control \
|
||||
src/platforms \
|
||||
src/systemcmds \
|
||||
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) \
|
||||
-not -name '*generated.h' \
|
||||
-not -name '*uthash.h' \
|
||||
-not -name '*utstring.h' \
|
||||
-not -name '*utlist.h' \
|
||||
-not -name '*utarray.h' \
|
||||
-print0 | xargs -0 -n 1 -P 8 -I % ${DIR}/check_code_style.sh %
|
||||
# check if astyle is installed
|
||||
condition=$(which astyle 2>/dev/null | grep -v "not found" | wc -l)
|
||||
if [ $condition -eq 0 ]; then
|
||||
echo "astyle is not installed"
|
||||
astyle_ver
|
||||
exit 1
|
||||
else
|
||||
ASTYLE_VER=`astyle --version`
|
||||
|
||||
if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED" ]; then
|
||||
echo "Error: you're using ${ASTYLE_VER}"
|
||||
astyle_ver
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
CI="${CI:-false}"
|
||||
DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||
|
||||
if [[ "$@" == "--fix" ]]
|
||||
then
|
||||
export PX4_ASTYLE_FIX=1
|
||||
fi
|
||||
|
||||
|
||||
# install git pre-commit hook
|
||||
HOOK_FILE="$DIR/../.git/hooks/pre-commit"
|
||||
if [ ! -f $HOOK_FILE ] && [ "$CI" != "true" ]; then
|
||||
echo ""
|
||||
echo -e "\033[31mNinja tip: add a git pre-commit hook to automatically check code style\033[0m"
|
||||
echo -e "Would you like to install one now? (\033[94mcp ./Tools/pre-commit .git/hooks/pre-commit\033[0m): [y/\033[1mN\033[0m]"
|
||||
|
||||
read user_cmd
|
||||
if [ "$user_cmd" == "y" ]; then
|
||||
echo -e "copying ./Tools/pre-commit -> .git/hooks/pre-commit"
|
||||
cp $DIR/pre-commit $HOOK_FILE
|
||||
echo -e "\033[94mGreat, hook installed!\033[0m (checking style now)"
|
||||
else
|
||||
echo -e "\033[94mOk, I will remind you again later!\033[0m (checking style now)"
|
||||
fi
|
||||
fi
|
||||
|
||||
${DIR}/files_to_check_code_style.sh | xargs -n 1 -P 8 -I % ${DIR}/check_code_style.sh %
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Format checks passed"
|
||||
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
while getopts "b:t:" opt; do
|
||||
case "${opt}" in
|
||||
b)
|
||||
builddir=$OPTARG
|
||||
;;
|
||||
t)
|
||||
tool=$OPTARG
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "builddir = ${builddir}, tool = ${tool}"
|
||||
|
||||
case "${builddir}" in
|
||||
"build_posix_rpi_cross")
|
||||
CXX_INC=$(cd ${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include/c++/*; pwd)
|
||||
EXTRA_ARG1=-I${CXX_INC}
|
||||
EXTRA_ARG2=-I${CXX_INC}/arm-linux-gnueabihf
|
||||
EXTRA_ARG3=-I${CXX_INC}/backward
|
||||
extra_args="--extra-arg=-I${CXX_INC} --extra-arg=-I${CXX_INC}/arm-linux-gnueabihf --extra-arg=-I${CXX_INC}/backward"
|
||||
;;
|
||||
"build_posix_sitl_default")
|
||||
;;
|
||||
*)
|
||||
echo "unknown build dir: ${builddir}"
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPILE_DB=$(/bin/pwd)/${builddir}
|
||||
if [[ ! -f ${COMPILE_DB}/compile_commands.json ]]; then
|
||||
echo "compile_commands.json not found in ${COMPILE_DB}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${tool}" in
|
||||
"clang-check")
|
||||
command=clang-check;
|
||||
option=-analyze;
|
||||
;;
|
||||
"clang-tidy")
|
||||
command=clang-tidy
|
||||
;;
|
||||
esac
|
||||
|
||||
grep file ${COMPILE_DB}/compile_commands.json |
|
||||
awk '{ print $2; }' |
|
||||
sed 's/\"//g' |
|
||||
while read FILE; do
|
||||
(cd $(dirname ${FILE});
|
||||
${command} ${option} -p ${COMPILE_DB} ${extra_args} $(basename ${FILE})
|
||||
);
|
||||
done
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
PATTERN="-e ."
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
PATTERN="$1"
|
||||
fi
|
||||
|
||||
exec find src \
|
||||
-path src/examples/attitude_estimator_ekf -prune -o \
|
||||
-path src/examples/ekf_att_pos_estimator -prune -o \
|
||||
-path src/lib/DriverFramework -prune -o \
|
||||
-path src/lib/ecl -prune -o \
|
||||
-path src/lib/external_lgpl -prune -o \
|
||||
-path src/lib/mathlib -prune -o \
|
||||
-path src/lib/matrix -prune -o \
|
||||
-path src/modules/attitude_estimator_ekf -prune -o \
|
||||
-path src/modules/commander -prune -o \
|
||||
-path src/modules/mavlink -prune -o \
|
||||
-path src/modules/navigator -prune -o \
|
||||
-path src/modules/sdlog2 -prune -o \
|
||||
-path src/modules/systemlib/uthash -prune -o \
|
||||
-path src/modules/uavcan -prune -o \
|
||||
-path src/modules/uavcan/libuavcan -prune -o \
|
||||
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
ASTYLE_VER=`astyle --version`
|
||||
ASTYLE_VER_REQUIRED="Artistic Style Version 2.05.1"
|
||||
|
||||
if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED" ]; then
|
||||
echo "Error: you're using ${ASTYLE_VER}, but PX4 requires ${ASTYLE_VER_REQUIRED}"
|
||||
echo "You can get the correct version here: https://github.com/PX4/astyle/releases/tag/2.05.1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Executable
+901
@@ -0,0 +1,901 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Written by Carlo Wood, September/October 2016.
|
||||
|
||||
function fatal
|
||||
{
|
||||
echo "$0: ERROR: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Make sure we're not having a broken gawk.
|
||||
AWK_VERSION=$(awk -V | head -n 1)
|
||||
if [[ $AWK_VERSION =~ ^GNU\ Awk\ 4\.[0-9]+\.[0-9]+ ]]; then
|
||||
AWK_VERSION=$(echo $AWK_VERSION | sed -e 's/GNU Awk \(4\.[0-9]*\.[0-9]*\).*/\1/')
|
||||
if [[ $AWK_VERSION =~ ^4\.0*([2-9]+|1\.0*[2-9]+) ]]; then
|
||||
fatal "Your version of awk ($AWK_VERSION) is broken. Please use version 4.1.1 or lower."
|
||||
fi
|
||||
fi
|
||||
echo "AWK_VERSION=$AWK_VERSION"
|
||||
|
||||
# Find out what the base directory is.
|
||||
BASEDIR="$(dirname $(dirname $(readlink -en "$0")))"
|
||||
echo "BASEDIR=\"$BASEDIR\""
|
||||
striplen=$((${#BASEDIR} + 2))
|
||||
|
||||
# BASEDIR may not contain a space, that's just too hard to get to work.
|
||||
expr index "$BASEDIR" " " >/dev/null && fatal "it is not supported that BASEDIR contains a space."
|
||||
|
||||
# Make sure that worked.
|
||||
test -f $BASEDIR/cmake/posix/px4_impl_posix.cmake || fatal "Failed to determine BASEDIR: '\$BASEDIR/cmake/posix/px4_impl_posix.cmake' is not a regular file."
|
||||
|
||||
# Parse command line parameters.
|
||||
debug=0 # Set to non-zero to enable debugging.
|
||||
force=0 # Set to 1 to force running of script even when there are uncommitted changes.
|
||||
merge=0 # Set to 1 when merging a branch that didn't run this script into master that did already run this script.
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
case $1 in
|
||||
--debug)
|
||||
debug=1
|
||||
;;
|
||||
--force)
|
||||
force=1
|
||||
;;
|
||||
--merge)
|
||||
force=1
|
||||
merge=1
|
||||
fatal "--merge is not implemented yet."
|
||||
;;
|
||||
-*)
|
||||
fatal "Unknown option $1"
|
||||
;;
|
||||
--|*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
non_option_arguments=$#
|
||||
if [ $non_option_arguments -eq 0 -a $debug -ne 0 ]; then
|
||||
fatal "--debug screws up the source files with debug output! You must provide a single filename to run on."
|
||||
fi
|
||||
|
||||
# Better not run this script with changes that still need to be committed.
|
||||
cd "$BASEDIR" || fatal "Could not change directory to \"$BASEDIR\""
|
||||
if ! git diff-index --quiet HEAD --; then
|
||||
if [ $non_option_arguments -ne 0 -o $force -eq 1 ]; then
|
||||
if [ $force -eq 1 ]; then
|
||||
echo "Uncommitted changes, but running anyway because --force is used."
|
||||
else
|
||||
echo -n "WARNING: You have uncommitted changes (use --force to remove this warning). Run anyway? [y/N] "
|
||||
read answer
|
||||
if [ "x$answer" != "xy" -a "x$answer" != "xY" ]; then exit 0; fi
|
||||
fi
|
||||
else
|
||||
fatal "Your working directory has uncommitted changes (see 'git status')! Bailing out."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Find a reasonable tmp directory.
|
||||
# First make a list of all build directories by looking for a CMakeCache.txt in them. Sort them so the most recent one is first.
|
||||
CMAKECACHE_FILES=$(find "$BASEDIR" -mindepth 2 -maxdepth 2 -type f -name CMakeCache.txt -wholename "$BASEDIR/build_*/CMakeCache.txt" | xargs /bin/ls -td)
|
||||
# Make a list of all candidate tmp directories.
|
||||
TMPDIRS=
|
||||
for f in $CMAKECACHE_FILES; do
|
||||
if [ -d $(dirname $f)/tmp ]; then
|
||||
TMPDIRS+=" $(dirname $f)/tmp"
|
||||
fi
|
||||
done
|
||||
# Put BASEDIR first in case there are no build directories because /tmp is probably on a different file system.
|
||||
TMPDIRS+=" $BASEDIR /tmp ."
|
||||
# Pick the first one that is actually writable.
|
||||
for tmp in $TMPDIRS; do
|
||||
TMPDIR="$tmp"
|
||||
if [ -w "$TMPDIR" ]; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
test -n "$TMPDIR" || fatal "Can not find a writable tmp directory."
|
||||
echo "TMPDIR=\"$TMPDIR\""
|
||||
|
||||
# Make a list of all source and header files that we need to fix.
|
||||
# List of directories that we don't want to touch.
|
||||
EXCLUDE_FOLDERS=".git unittests Tools"
|
||||
EXCLUDE_PATTERNS="examples matlab/scripts tests test unit_test *_test *_tests test_* apps/test_* UnitTests"
|
||||
# A regular expression for the exclude patterns.
|
||||
EXCLUDE_PATTERNS_RE="($(echo $EXCLUDE_PATTERNS | sed -e 's/\*/[^\/]*/g;s/ /|/g'))"
|
||||
# Extensions of files that we do want to change (leaving out .y and .py for now).
|
||||
C_EXTENSIONS=".c .c_in .c_shipped"
|
||||
H_EXTENSIONS=".h .h.in .h_template"
|
||||
CXX_EXTENSIONS=".cc .cpp .cpp.in .cxx .cpp_template"
|
||||
HXX_EXTENSIONS=".hh .hpp .hxx"
|
||||
# The regular expression that we consider to be an #include.
|
||||
INCLUDE_RE='^[[:space:]]*#[[:space:]]*include[[:space:]]*[<"]'
|
||||
# Regular expression for empty lines.
|
||||
EMPTY_LINE_RE='^[[:space:]]*$'
|
||||
# Regular expression for one-line comments.
|
||||
COMMENT_LINE_RE='^[[:space:]]*(\/\/.*|\/\*([^*]|\*+[^\/*])*\*+\/[[:space:]]*)$'
|
||||
# Regular expression for a #define (on one line).
|
||||
DEFINE_RE='^[[:space:]]*#[[:space:]]*define[[:space:]].*[^\\]$'
|
||||
# Regular expression for an #if[[n]def].
|
||||
IF_RE='^[[:space:]]*#[[:space:]]*if(n?def)?[[:space:]]'
|
||||
# Regular expression for an #endif.
|
||||
ENDIF_RE='^[[:space:]]*#[[:space:]]*endif($|[^[:alnum:]])'
|
||||
# Regular expression for header file extension.
|
||||
HEADER_RE="($(echo $H_EXTENSIONS $HXX_EXTENSIONS | sed -e 's/\./\\./g;s/ /|/g'))"
|
||||
# Regular expression for C++ source and header files.
|
||||
CXXSRC_RE="($(echo $CXX_EXTENSIONS $HXX_EXTENSIONS | sed -e 's/\./\\./g;s/ /|/g'))"
|
||||
# List of standard C header files. Note that cfcntl, cshed and cunistd are NOT standard header files, even though they are in NuttX/nuttx/include/cxx.
|
||||
REAL_STDC_HEADERS_RE='(cassert|ccomplex|cctype|cerrno|cfenv|cfloat|cinttypes|ciso646|climits|clocale|cmath|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype)'
|
||||
STDC_HEADERS=$(find "$BASEDIR/NuttX/nuttx/include/cxx" -mindepth 1 -maxdepth 1 -type f | xargs basename -a | grep -E "$REAL_STDC_HEADERS_RE" | xargs echo)
|
||||
# Regular expression of standard C header files, but with the leading 'c' stripped.
|
||||
STDC_HEADERS_RE="($(echo $STDC_HEADERS | sed -e 's/^c//;s/ c/|/g'))"
|
||||
# Actual list of standard C header files.
|
||||
# List of standard C++ header files.
|
||||
REAL_STDCXX_HEADERS_RE='(algorithm|any|array|atomic|bitset|cassert|ccomplex|cctype|cerrno|cfenv|cfloat|chrono|cinttypes|ciso646|climits|clocale|cmath|codecvt|complex|condition_variable|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype|deque|exception|execution|filesystem|forward_list|fstream|functional|future|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|limits|list|locale|map|memory|memory_resource|mutex|new|numeric|optional|ostream|queue|random|ratio|regex|scoped_allocator|set|shared_mutex|sstream|stack|stdexcept|streambuf|string|string_view|strstream|system_error|thread|tuple|typeindex|typeinfo|type_traits|unordered_map|unordered_set|utility|valarray|variant|vector)'
|
||||
STDCXX_HEADERS=$(find "$BASEDIR/NuttX/misc/uClibc++/include/uClibc++" -mindepth 1 -maxdepth 1 -type f | xargs basename -a | grep -E "$REAL_STDCXX_HEADERS_RE" | grep -E -v "$REAL_STDC_HEADERS_RE" | xargs echo)
|
||||
# Regular expression of C++ header files.
|
||||
STDCXX_HEADERS_RE="($(echo $STDCXX_HEADERS | sed -e 's/ /|/g'))"
|
||||
# Regular expression for #pragma once.
|
||||
PRAGMA_ONCE_RE='^#pragma once'
|
||||
# Regular expression to recognize the start of a C-comment block.
|
||||
COMMENT_BEGIN_RE='(^|[^\/])\/\*([^*]|\*+($|[^\/*]))*$'
|
||||
# Regular expression to recognize the end of a C-comment block.
|
||||
COMMENT_END_RE='\*\/'
|
||||
# Regular expression to match C++ unsafe headers. We currently don't have any C++ unsafe headers, do we?
|
||||
# v2.0/standard/mavlink.h is not unsafe, but this way the script will leave it alone and not
|
||||
# move it above function declarations that need to be declared before including it.
|
||||
UNSAFE_HEADERS_RE='(v2\.0\/standard\/mavlink\.h)'
|
||||
#UNSAFE_HEADERS_RE='(stm32\.h|arch\/board\/board\.h)'
|
||||
|
||||
# Find all submodules.
|
||||
test -f $BASEDIR/.gitmodules || fatal "No such file: $BASEDIR/.gitmodules"
|
||||
SUBMODULES=$(grep -A 1 '^\[submodule' $BASEDIR/.gitmodules | grep '^[[:space:]]*path = ' | sed -r -e 's/^[[:space:]]*path = //' | xargs echo)
|
||||
echo "SUBMODULES=\"$SUBMODULES\""
|
||||
SUBMODULES_RE="($(echo $SUBMODULES | sed -e 's/ /|/g'))"
|
||||
|
||||
# Disable path name expansion (otherwise the find patterns will be expanded against the files in the current working directory).
|
||||
set -f
|
||||
|
||||
EXCLUDE_ARGS=
|
||||
for excl in $EXCLUDE_FOLDERS; do
|
||||
if [ -z "$EXCLUDE_ARGS" ]; then
|
||||
EXCLUDE_ARGS="-wholename $BASEDIR/$excl/*"
|
||||
else
|
||||
EXCLUDE_ARGS+=" -o -wholename $BASEDIR/$excl/*"
|
||||
fi
|
||||
done
|
||||
for excl in $EXCLUDE_PATTERNS; do
|
||||
EXCLUDE_ARGS+=" -o -wholename */$excl/*"
|
||||
done
|
||||
INCLUDE_H_ARGS=
|
||||
for ext in $H_EXTENSIONS $HXX_EXTENSIONS; do
|
||||
if [ -z "$INCLUDE_H_ARGS" ]; then
|
||||
INCLUDE_H_ARGS="-name *$ext"
|
||||
else
|
||||
INCLUDE_H_ARGS+=" -o -name *$ext"
|
||||
fi
|
||||
done
|
||||
INCLUDE_C_ARGS=
|
||||
for ext in $C_EXTENSIONS $CXX_EXTENSIONS; do
|
||||
if [ -z "$INCLUDE_C_ARGS" ]; then
|
||||
INCLUDE_C_ARGS="-name *$ext"
|
||||
else
|
||||
INCLUDE_C_ARGS+=" -o -name *$ext"
|
||||
fi
|
||||
done
|
||||
# Also exclude all submodules -- because we don't maintain those (are we?).
|
||||
for subm in $SUBMODULES; do
|
||||
if [ -z "$SUBMODULES_ARGS" ]; then
|
||||
SUBMODULES_ARGS="-wholename $BASEDIR/$subm/*"
|
||||
else
|
||||
SUBMODULES_ARGS+=" -o -wholename $BASEDIR/$subm/*"
|
||||
fi
|
||||
done
|
||||
|
||||
echo -n "Finding all source files with #include's (excluding submodules and build directory)... "
|
||||
find $BASEDIR -mindepth 2 -type f ! \( -wholename $BASEDIR/build_* -o $EXCLUDE_ARGS -o $SUBMODULES_ARGS \) \( $INCLUDE_C_ARGS -o $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_sources
|
||||
cat "$TMPDIR/fix_headers_sources" | xargs grep -l "$INCLUDE_RE" > $TMPDIR/fix_headers_sources_with_includes
|
||||
echo "done"
|
||||
number_of_files=$(sed -n '$=' "$TMPDIR/fix_headers_sources_with_includes")
|
||||
count=0
|
||||
|
||||
echo -n "Finding all submodule header files (excluding stdc++ headers)... "
|
||||
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) \( $SUBMODULES_ARGS \) \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_SUBMODULE_HEADERS
|
||||
echo "done"
|
||||
|
||||
echo -n "Finding all header files (excluding stdc++ headers)... "
|
||||
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) -wholename $BASEDIR/build_* \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_HEADERS
|
||||
grep -E "$HEADER_RE" $TMPDIR/fix_headers_sources >> $TMPDIR/fix_headers_HEADERS
|
||||
cat $TMPDIR/fix_headers_SUBMODULE_HEADERS >> $TMPDIR/fix_headers_HEADERS
|
||||
echo "done"
|
||||
|
||||
echo -n "Finding all include paths... "
|
||||
for f in `cat $TMPDIR/fix_headers_sources_with_includes`; do grep -E "$INCLUDE_RE" $f | sed -r -e "s%$INCLUDE_RE%%"';s/[">].*//'; done | sort -u | grep -E -v "(/|^)$EXCLUDE_PATTERNS_RE/" > $TMPDIR/fix_headers_include_paths
|
||||
echo "done"
|
||||
|
||||
function include_path()
|
||||
{
|
||||
# If the include path starts with a '.', then it is a local header.
|
||||
if [[ $1 =~ ^\. ]]; then return 1; fi
|
||||
# If the include path starts with 'platforms/' then it is a local header;
|
||||
# added this exception here because not everyone has all build_ directories for all targets installed.
|
||||
if [[ $1 =~ platforms/ ]]; then return 1; fi
|
||||
# apps.h is generated from apps.h.in.
|
||||
if [ $1 = "apps.h" ]; then return 1; fi
|
||||
# Treat the following headers from src/platforms/*/include as system header because they replace what is found in nuttx (for posix and qurt).
|
||||
if [ $1 = "arch/board/board.h" -o $1 = "crc32.h" -o $1 = "i2c.h" -o $1 = "queue.h" -o $1 = "poll.h" -o $1 = "sys/ioctl.h" ]; then return 2; fi
|
||||
# Escape the path for reg.exp. matching.
|
||||
PATH_RE=$(echo $1 | sed -e 's/\([+.]\)/\\\1/')
|
||||
issubmodule=0;
|
||||
islocal=0;
|
||||
foo=0
|
||||
for includedir in $(grep "/$PATH_RE\$" $TMPDIR/fix_headers_HEADERS | cut -c $striplen-); do
|
||||
# If the include directory is NuttX header that was copied to the build directory, then it's still a system file.
|
||||
if [[ $includedir/ =~ ^build_.*/NuttX/ ]]; then
|
||||
issubmodule=1
|
||||
# If the include directory is a submodule, then treat it as a system file.
|
||||
elif [[ $includedir/ =~ ^$SUBMODULES_RE/ ]]; then
|
||||
issubmodule=1;
|
||||
else
|
||||
islocal=1
|
||||
fi
|
||||
done
|
||||
if [ $islocal -eq 0 ]; then
|
||||
if [ $issubmodule -eq 0 ]; then
|
||||
# If an include path can't be found then usually it will be a real system header,
|
||||
# however, there are a few (ros related?) files that start with px4... In that
|
||||
# case just leave the quotes alone ("px4muorb.h" and several <px4/...>).
|
||||
if [[ $1 =~ ^px4 ]]; then return 0; fi
|
||||
# While if the include path starts with uORB/topics or topics, and it isn't found,
|
||||
# then likely we just don't have a build directory. These should be local though.
|
||||
# Same for the generated files mixer_multirotor.generated.h and build_git_version.h.
|
||||
if [[ $1 =~ ((/|^)topics/|mixer_multirotor\.generated\.h|build_git_version\.h) ]]; then return 1; fi
|
||||
fi
|
||||
return 2;
|
||||
fi # Submodule or system header.
|
||||
if [ $issubmodule -eq 0 ]; then return 1; fi # Local.
|
||||
# Files that are both local and submodule are simply left alone.
|
||||
# These are (at this moment): "battery.h" "common.h" "Matrix.hpp" "mavlink.h" "protocol.h" "pwm.h" "spi.h" "Vector.hpp".
|
||||
return 0;
|
||||
}
|
||||
|
||||
# Run the include_path function for each of the files in $TMPDIR/fix_headers_include_paths
|
||||
echo -n "Determining which headers need to be included with double quotes... "
|
||||
echo -n > $TMPDIR/fix_headers_quotes
|
||||
for arg in $(cat "$TMPDIR/fix_headers_include_paths"); do
|
||||
include_path $arg
|
||||
localsystem=$?
|
||||
if [ $localsystem -eq 1 ]; then
|
||||
echo "$arg \"$arg\"" >> $TMPDIR/fix_headers_quotes
|
||||
elif [ $localsystem -eq 2 ]; then
|
||||
echo "$arg <$arg>" >> $TMPDIR/fix_headers_quotes
|
||||
fi
|
||||
done
|
||||
echo "done"
|
||||
|
||||
# Truncate the error log.
|
||||
echo -n > $TMPDIR/fix_headers_ERROR.log
|
||||
|
||||
function print_error
|
||||
{
|
||||
echo
|
||||
echo -n " ";
|
||||
echo "*** $1" | tee -a "$TMPDIR/fix_headers_ERROR.log"
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ $debug -ne 0 ]; then
|
||||
# Debug Line.
|
||||
DL='if (cdbl != NR) { printf "\n%u. \"%s\"", NR, $0; cdbl = NR }'
|
||||
# Debug Begin.
|
||||
DB='if (cdbl != NR) { printf "\n%u. \"%s\" ---> ", NR, $0; cdbl = NR } else printf "; "; printf'
|
||||
# Debug End.
|
||||
DE=''
|
||||
else
|
||||
DL='#'
|
||||
DB='#'
|
||||
DE=''
|
||||
fi
|
||||
# Error Prefix.
|
||||
EP='###'
|
||||
|
||||
# The main function that is called for each source file.
|
||||
function fixup_header
|
||||
{
|
||||
count=$((count + 1))
|
||||
echo -n "[$((100 * count / number_of_files))%] Fixing headers of $1... "
|
||||
|
||||
# Is this a header?
|
||||
echo "$1" | sed -e 's/\.in$/;in/;s/.*\././;s/;in$/.in/' | grep -v -E "$HEADER_RE\$" >/dev/null; is_header=$?
|
||||
if [ $debug -ne 0 ]; then echo "is_header = \"$is_header\""; fi
|
||||
|
||||
# Is this C++ source?
|
||||
echo "$1" | sed -e 's/.*\././' | grep -v -E $CXXSRC_RE >/dev/null; is_cxxsrc=$?
|
||||
if [ $debug -ne 0 ]; then echo "is_cxxsrc = \"$is_cxxsrc\""; fi
|
||||
dont_make_cxxsrc=1
|
||||
if [ $is_cxxsrc -eq 0 -a $is_header -ne 0 ]; then
|
||||
grep -m 1 -q -E "^[[:space:]]*(#[[:space:]]*include[[:space:]]*<$STDCXX_HEADERS_RE>|(template|namespace|class)(\$|[^[:alnum:]_]))" "$1"
|
||||
dont_make_cxxsrc=$?
|
||||
fi
|
||||
if [ $dont_make_cxxsrc -eq 0 ]; then
|
||||
is_cxxsrc=1
|
||||
fi
|
||||
|
||||
# Current directory.
|
||||
curdir=$(dirname "$BASEDIR/$1")
|
||||
|
||||
# Parse the file.
|
||||
#
|
||||
# Returns an array of line[]'s. The first line is either the first #include, when it is outside
|
||||
# any #if*...#endif constructs not counting the header guard if the file is a header. For example:
|
||||
#
|
||||
# // Anything here except #include lines.
|
||||
# #include <first_include.h> // <-- first line.
|
||||
#
|
||||
# Or, the first #if* that contains the first #include line. For example:
|
||||
# // Anything here except #include lines.
|
||||
# #ifndef FOO_H // header guard.
|
||||
# #define FOO_H
|
||||
# int global = 1; // Anything unknown.
|
||||
# #ifdef SOMETHING // <-- first line.
|
||||
# #if maybe_more
|
||||
# // anything except #include lines.
|
||||
# #else
|
||||
# // anything except #include lines.
|
||||
# #include <first_include.h>
|
||||
#
|
||||
# Subsequent line[]'s mark the beginning of a new block, where we have the following blocks:
|
||||
# type[] Description
|
||||
type_include=0 # An #include, outside #if*...#endif constructs except a possible header guard.
|
||||
type_ifincludeendif=1 # #if*...#endif constructs with #include's.
|
||||
type_ifendif=2 # #if*...#endif constructs without #include's.
|
||||
type_decls=3 # __BEGIN_DECLS ... __END_DECLS block.
|
||||
type_macro=4 # Contiguous #define block.
|
||||
type_comment=5 #(Multi-line) comments.
|
||||
type_emptyline=6 # Empty lines.
|
||||
type_pragmaonce=7 # #pragma once (must be outside any #if*...#endif constructs).
|
||||
type_end=8 # The first line of the remainder of the file.
|
||||
#
|
||||
# However, any block NOT containing one or more #include's (all types > 1) will
|
||||
# cause subsequent blocks that do not contain #include's to be ignored,
|
||||
# with as result that those blocks will be treated as contiguous code blocks.
|
||||
# A comment that is followed by a type that is not to be ignored as such
|
||||
# is given the type that follows (which itself is then ignored).
|
||||
# Empty lines are ignored unless they appear directly in front of a type
|
||||
# that is not to be ignored according to the above rules, where 'previous
|
||||
# types' then are the types before the empty line.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# > #include <first_header.h> # type_include
|
||||
# > #include <second_header.h> # type_include
|
||||
# > # type_emptyline
|
||||
# > #include <third_header.h> # type_include
|
||||
# ^ #ifdef FOO # type_ifendif
|
||||
# | #define BAR 1
|
||||
# | #endif # (detected here)
|
||||
# | <-- ignored because:
|
||||
# v #define BAZ(x) x // Do baz <-- ignored (prev and this type in {type_ifendif, type_macro})
|
||||
# > # type_emptyline
|
||||
# ^ // This include is important: # type_comment, but then replaced by type_ifincludeendif
|
||||
# | <-- ignored because:
|
||||
# | // more here. <-- ignored same type
|
||||
# | #ifdef BAR <-- "ignored": type_ifincludeendif, but put 3 lines higher.
|
||||
# | #include <bar.h>
|
||||
# v #endif # (detected here)
|
||||
# > # type_emptyline
|
||||
# > #include <another.h> # type_include
|
||||
#
|
||||
# This script stops parsing at the first not recognized line outside #if*...#endif constructs
|
||||
# unless no first line was found yet. It does not attempt overly hard to decode rare constructs,
|
||||
# most notably anything with a leading C comment is not recognized and will thus lead to an abort.
|
||||
# For example the following lines are not recognized:
|
||||
#
|
||||
# /* Some comment */ #include <header.h>
|
||||
# /* Some comment */ // Another comment.
|
||||
#
|
||||
# Lines that have a trailing comment are recognized (by ignoring the comment).
|
||||
|
||||
result=$(awk "\
|
||||
function add(l, t) {
|
||||
# First add always succeeds.
|
||||
if (ptr > 0) {
|
||||
# An empty line is always added, at first, unless the immediate preceding type is an empty line.
|
||||
if (t == $type_emptyline && type[ptr - 1] == $type_emptyline) {
|
||||
return; $DB \"ignored because line %d is also empty.\", line[ptr - 1] $DE
|
||||
}
|
||||
# A comment is always, added at first, unless the preceding non-empty line type is a comment.
|
||||
# Same for #include's.
|
||||
if (t == $type_comment && last_none_type == t) {
|
||||
$DB \"ignoring because same type as last_none_type (%s)\", type_name[t] $DE
|
||||
# Gobble up preceding empty lines.
|
||||
if (type[ptr - 1] == $type_emptyline) {
|
||||
--ptr; $DB \"ptr = %d; [43mRemoved type_emptyline @ line %d[0m\", ptr, line[ptr] $DE
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
# {ifendif, macro}'s are collapsed too.
|
||||
if ((t == $type_ifendif || t == $type_macro) && (last_nonws_type == $type_ifendif || last_nonws_type == $type_macro)) {
|
||||
# Gobble up preceding comments and empty lines.
|
||||
while (ptr > 0 && (type[ptr - 1] == $type_emptyline || type[ptr - 1] == $type_comment)) {
|
||||
--ptr; $DB \"ptr = %d; [43mRemoved %s @ line %d[0m\", ptr, type_name[type[ptr]], line[ptr] $DE
|
||||
}
|
||||
# ptr > 0 here because the first add is never for an empty line or comment.
|
||||
last_none_type = type[ptr - 1]; $DB \"last_none_type = %s\", type_name[last_none_type] $DE
|
||||
return;
|
||||
}
|
||||
# type_include and type_pragmaonce and higher are always added.
|
||||
}
|
||||
if (t == $type_end) {
|
||||
# Remove drag.
|
||||
while(ptr > 0 && line[ptr - 1] >= l) --ptr;
|
||||
}
|
||||
# If this type is not an empty line and it was preceded by a comment, then melt it together with that comment.
|
||||
else if (t != $type_emptyline && last_none_type == $type_comment) {
|
||||
# In this case t cannot be type_comment.
|
||||
# Gobble up preceding empty lines.
|
||||
if (type[ptr - 1] == $type_emptyline) {
|
||||
--ptr; $DB \"ptr = %d; [43mRemoved type_emptyline @ line %d[0m\", ptr, line[ptr] $DE
|
||||
}
|
||||
# And replace the comment type.
|
||||
--ptr; $DB \"ptr = %d; [45mreplacing the %s @ line %d[0m\", ptr, type_name[type[ptr]], line[ptr] $DE
|
||||
l = line[ptr];
|
||||
|
||||
}
|
||||
line[ptr] = l; $DB \"ptr = %d; [42m%s @ line %d[0m\", ptr, type_name[t], l $DE;
|
||||
type[ptr++] = t;
|
||||
if (t != $type_emptyline) {
|
||||
last_none_type = t; $DB \"last_none_type = %s\", type_name[last_none_type] $DE
|
||||
if (t != $type_comment)
|
||||
last_nonws_type = t;
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
debug = $debug; # 0: no debug output; non-zero: print debug output.
|
||||
header = $is_header; # 0: do not look for a header guard; 1: treat first #ifndef as header guard.
|
||||
in_if = 0; # The number of nested levels inside #if, #ifdef or #ifndef ... #endif constructs.
|
||||
in_if_base = 0; # 0: no header guard was found (or #pragma once); 1: an #ifndef header guard was found.
|
||||
in_decl = 0; # 0: not inside a __BEGIN_DECLS ... __END_DECLS block; 1: inside such a block.
|
||||
found_guard = 0; # 0: no header guard was found; 1: a header guard was found (including #pragma once).
|
||||
base_if = 0; # The current base-level #if that we are scanning.
|
||||
drag = 0; # The number of lines since the last certainly relevant line (a base-level #include or a base-level #endif containing one of more #includes).
|
||||
skipped = 0; # 0: No #include was encountered in the current (base-level) #if block; 1: one or more #include's encountered in the current base-level #if block.
|
||||
in_comment = 0; # 0: not in a multi-line C comment; 1: in a multi-line C comment.
|
||||
cdbl = 0; # Current debug line.
|
||||
error = 0; # 0: no error occured; 1: an error occured.
|
||||
ptr = 0; # Current pointer into line[] and type[].
|
||||
found_comment_end = 0; # The last line (possibly the current line) that is/was a multi-line C comment termination.
|
||||
last_none_type = -1; # The last non-emptyline type that was added.
|
||||
last_nonws_type = -1; # The last non-whitespace type that was added.
|
||||
# For debug purposes:
|
||||
type_name[$type_ifendif] = \"type_ifendif\";
|
||||
type_name[$type_ifincludeendif] = \"type_ifincludeendif\";
|
||||
type_name[$type_decls] = \"type_decls\";
|
||||
type_name[$type_comment] = \"type_comment\";
|
||||
type_name[$type_emptyline] = \"type_emptyline\";
|
||||
type_name[$type_include] = \"type_include\";
|
||||
type_name[$type_macro] = \"type_macro\";
|
||||
type_name[$type_pragmaonce] = \"type_pragmaonce\";
|
||||
type_name[$type_end] = \"type_end\";
|
||||
}
|
||||
|
||||
END {
|
||||
last_line = NR - drag;
|
||||
add(last_line + 1, $type_end); $DB \"\n\" $DE;
|
||||
# Print output.
|
||||
if (error || ptr == 0 || last_line < line[0]) {
|
||||
print \"error=1\";
|
||||
exit
|
||||
}
|
||||
printf \"lines=\\\"\";
|
||||
for (i = 0; i < ptr - 1; ++i)
|
||||
printf \"%d \", line[i];
|
||||
printf \"%d\\\"; \", line[ptr - 1];
|
||||
printf \"types=\\\"\";
|
||||
for (i = 0; i < ptr - 1; ++i)
|
||||
printf \"%d \", type[i];
|
||||
printf \"%d\\\"; \", type[ptr - 1];
|
||||
print \"error=0; first_line=\" line[0] \"; last_line=\" last_line
|
||||
}
|
||||
|
||||
#======================================================================================================
|
||||
# Handle multi-line C comments.
|
||||
|
||||
/$COMMENT_END_RE/ {
|
||||
if (in_comment) {
|
||||
in_comment = 0; $DB \"comment end\" $DE;
|
||||
found_comment_end = NR;
|
||||
sub(/^([^*]|\*+[^*\/])*\*+\//, \"\") # Remove the tail of the comment.
|
||||
}
|
||||
# FALL-THROUGH
|
||||
}
|
||||
|
||||
{
|
||||
if (in_comment) {
|
||||
++drag; $DB \"in comment; drag = %d\", drag $DE;
|
||||
next
|
||||
}
|
||||
found_comment_begin = 0;
|
||||
# FALL-THROUGH
|
||||
}
|
||||
|
||||
/$COMMENT_BEGIN_RE/ {
|
||||
in_comment = 1; $DB \"comment begin\" $DE;
|
||||
found_comment_begin = 1;
|
||||
sub(/\/\*([^*]|\*+($|[^*\/]))*$/, \"\") # Remove the head of the comment so that we'll recognize this as an empty line if it is.
|
||||
# FALL-THROUGH
|
||||
}
|
||||
|
||||
#======================================================================================================
|
||||
# Detect and handle header guard.
|
||||
|
||||
/$PRAGMA_ONCE_RE/ {
|
||||
++drag; $DB \"drag = %d\", drag $DE;
|
||||
if (header && found_guard == 0 && in_if == 0) {
|
||||
found_guard = NR; $DB \"found_guard = %d\", found_guard $DE;
|
||||
if (ptr > 0)
|
||||
add(NR, $type_pragmaonce)
|
||||
next
|
||||
}
|
||||
print \"\\n$EP $1:\" NR \": unexpected #pragma once\";
|
||||
error = 1;
|
||||
exit
|
||||
}
|
||||
|
||||
/^#ifndef / {
|
||||
if (ptr == 0 && header && found_guard == 0 && in_if == 0) {
|
||||
found_guard = NR; $DB \"found_guard = %d\", found_guard $DE;
|
||||
in_if = 1; $DB \"in_if = %d\", in_if $DE;
|
||||
in_if_base = 1; $DB \"in_if_base = %d\", in_if_base $DE;
|
||||
next
|
||||
}
|
||||
# FALL-THROUGH
|
||||
}
|
||||
|
||||
#======================================================================================================
|
||||
# Detect and handle __BEGIN_DECLS ... __END_DECLS blocks.
|
||||
|
||||
/^[[:space:]]*__BEGIN_DECLS/ {
|
||||
++drag; $DB \"drag = %d\", drag $DE;
|
||||
if (in_decl == 0) {
|
||||
in_decl = 1; $DB \"in_decl = 1\" $DE
|
||||
add(NR, $type_decls);
|
||||
next
|
||||
}
|
||||
print \"\\n$EP $1:\" NR \": Nested __BEGIN_DECLS!\";
|
||||
error = 1;
|
||||
exit
|
||||
}
|
||||
|
||||
/^[[:space:]]*__END_DECLS/ {
|
||||
++drag; $DB \"drag = %d\", drag $DE;
|
||||
if (in_decl == 1) {
|
||||
in_decl = 0; $DB \"in_decl = 0\" $DE
|
||||
if (skipped) {
|
||||
drag = 0;
|
||||
} else if (ptr == 1) {
|
||||
ptr = 0; $DB \"erase DECLS block\" $DE
|
||||
last_none_type = -1;
|
||||
}
|
||||
next
|
||||
}
|
||||
print \"\\n$EP $1:\" NR \": __END_DECLS without matching __BEGIN_DECLS!\";
|
||||
error = 1;
|
||||
exit
|
||||
}
|
||||
|
||||
#======================================================================================================
|
||||
# Detect and handle #if ... #endif blocks.
|
||||
|
||||
/$IF_RE/ {
|
||||
++drag; $DB \"drag = %d\", drag $DE;
|
||||
if (in_if == in_if_base && in_decl == 0) {
|
||||
skipped = 0; $DB \"skipped = 0\" $DE;
|
||||
base_if = NR; $DB \"base_if = %d\", NR $DE;
|
||||
}
|
||||
++in_if; $DB \"in_if = %d\", in_if $DE;
|
||||
next
|
||||
}
|
||||
|
||||
/$ENDIF_RE/ {
|
||||
--in_if; $DB \"in_if = %d\", in_if $DE;
|
||||
if (in_if < 0) {
|
||||
print \"\\n$EP $1:\" NR \": #endif without matching #if!\";
|
||||
error = 1;
|
||||
exit
|
||||
}
|
||||
++drag;
|
||||
if (in_if == in_if_base && in_decl == 0) {
|
||||
if (skipped) {
|
||||
drag = 0;
|
||||
add(base_if, $type_ifincludeendif);
|
||||
} else if (ptr > 0)
|
||||
add(base_if, $type_ifendif);
|
||||
} $DB \"drag = %d\", drag $DE;
|
||||
# Left header guard?
|
||||
if (in_if < in_if_base) { $DB \"left header guard:\" $DE;
|
||||
# assert(in_if == 0 && in_if_base == 1 && header && found_guard)
|
||||
exit
|
||||
}
|
||||
next
|
||||
}
|
||||
|
||||
#======================================================================================================
|
||||
# Handle #include lines.
|
||||
|
||||
/$INCLUDE_RE/ {
|
||||
if (!/\"(\.\/)?mavlink_msg/) {
|
||||
# If we're inside a __BEGIN_DECLS ... __END_DECLS block then only certain headers may be included.
|
||||
hname = gensub(/^[[:space:]]*#[[:space:]]*include[[:space:]]*[<\"]([^>\"]*)[>\"].*/, \"\\\1\", \"1\");
|
||||
cpp_safe = !(hname ~ /$UNSAFE_HEADERS_RE/);
|
||||
$DB \"hname = \\\"\" hname \"\\\"; cpp_safe = \" cpp_safe \"; in_decl = \" in_decl \"; is_cxxsrc = $is_cxxsrc\" $DE
|
||||
if (in_decl && cpp_safe) {
|
||||
print \"\\n$EP $1:\" NR \": including \" hname \" inside a __BEGIN_DECLS ... __END_DECLS block.\";
|
||||
error = 1;
|
||||
exit
|
||||
} else if (!in_decl && !cpp_safe && $is_cxxsrc) {
|
||||
print \"\\n$EP $1:\" NR \": including \" hname \" outside a __BEGIN_DECLS ... __END_DECLS block!\";
|
||||
error = 1;
|
||||
exit
|
||||
}
|
||||
if (in_if > in_if_base || in_decl) {
|
||||
skipped = 1; $DB \"skipped = 1\" $DE;
|
||||
} else {
|
||||
drag = 0; $DB \"drag = 0\" $DE;
|
||||
add(NR, $type_include); $DB \"first_line = %d\", NR $DE;
|
||||
}
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
#======================================================================================================
|
||||
# Ignore #define's, empty lines and lines with just comments.
|
||||
|
||||
/$DEFINE_RE/ {
|
||||
++drag; $DB \"drag = %d\", drag $DE;
|
||||
if (ptr > 0 && in_if == in_if_base && in_decl == 0) {
|
||||
add(NR, $type_macro);
|
||||
}
|
||||
next
|
||||
}
|
||||
|
||||
/$EMPTY_LINE_RE/ {
|
||||
++drag; $DB \"drag = %d\", drag $DE;
|
||||
if (ptr > 0 && in_if == in_if_base && in_decl == 0) {
|
||||
if (found_comment_begin)
|
||||
add(NR, $type_comment);
|
||||
else if (found_comment_end != NR)
|
||||
add(NR, $type_emptyline);
|
||||
}
|
||||
next
|
||||
}
|
||||
|
||||
/$COMMENT_LINE_RE/ {
|
||||
++drag; $DB \"drag = %d\", drag $DE;
|
||||
if (ptr > 0 && in_if == in_if_base && in_decl == 0 && type[ptr - 1] != $type_comment) {
|
||||
add(NR, $type_comment);
|
||||
}
|
||||
next
|
||||
}
|
||||
|
||||
#======================================================================================================
|
||||
# Handle everything else (unrecognized lines).
|
||||
|
||||
{
|
||||
++drag; $DB \"unknown; drag = %d\", drag $DE;
|
||||
if (ptr > 0 && in_if <= in_if_base && in_decl == 0) {
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
" "$BASEDIR/$1")
|
||||
|
||||
# Decode the result.
|
||||
vars=$(echo "$result" | tail -n 1)
|
||||
error_msg=$(echo "$result" | grep "^$EP " | sed -e 's/^....//')
|
||||
if [ $debug -ne 0 ]; then
|
||||
len=$(echo "$result" | wc --lines)
|
||||
echo "$result" | head -n $((len - 1)) | grep -v "^$EP " # Debug messages
|
||||
echo "vars: $vars"
|
||||
fi
|
||||
# Evaluate the last line printed in END.
|
||||
error=1; eval $vars
|
||||
test -z "$error_msg" || print_error "$error_msg" || return
|
||||
test $error -eq 0 -a $first_line -gt 0 || print_error "FAILED to find an #include in $1?!" || return
|
||||
test $last_line -ge $first_line || print_error "FAILED to find a sensible last line in $1?!" || return
|
||||
|
||||
# Calculate the number of lines starting from the current line.
|
||||
# Use sed to count lines, because wc --lines doesn't report the last line when that doesn't end on a new-line, contrary to the fact that tail treats such lines as lines.
|
||||
total_lines=$(sed -n '$=' "$BASEDIR/$1")
|
||||
if [ $debug -ne 0 ]; then echo "total_lines = \"$total_lines\""; fi
|
||||
|
||||
# Edit the first_line...last_line block.
|
||||
# Header files are ordered as follows (lowest value first):
|
||||
cat_winsock=0; # Winsock2.h
|
||||
cat_posix_sys=1; # posix_sys.h or one of the px4_ headers that include it.
|
||||
cat_px4=2; # Other px4_*.h
|
||||
cat_local=3; # "*.h"
|
||||
cat_cxx=4; # <std c++ header>, ie <iostream>
|
||||
cat_c=5; # <c std c++ header>, ie <cstdio>
|
||||
cat_system=6; # <*.h>
|
||||
|
||||
head -n $last_line "$BASEDIR/$1" | tail -n $((last_line - first_line + 1)) | awk "
|
||||
|
||||
function sort_by_type_line_header_type_hname(blk2, v2, blk1, v1) {
|
||||
# Return true if blk1 comes before blk2.
|
||||
# Move type_include before the rest. Keep the same line order for the rest.
|
||||
return (type[blk2] != $type_include && (type[blk1] == $type_include || line[blk1] < line[blk2])) ||
|
||||
(type[blk2] == $type_include && type[blk1] == $type_include &&
|
||||
# If both are include's then put include with a lower header_type first; sort alphabetically for the same header type.
|
||||
(header_type[blk1] < header_type[blk2] || (header_type[blk1] == header_type[blk2] && hname[blk1] < hname[blk2])));
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
first_line = $first_line;
|
||||
split(\"$lines\", line);
|
||||
split(\"$types\", type);
|
||||
i = 0;
|
||||
do {
|
||||
line[++i] -= first_line - 1;
|
||||
} while(type[i] != $type_end)
|
||||
for(b = 0; b < i; ++b) header_type[b] = 100;
|
||||
blk = 1;
|
||||
n = 0;
|
||||
is_cxxsrc = $is_cxxsrc;
|
||||
# px4_posix.h includes px4_defines.h includes px4_log.h includes posix_sys.h which must be the first header included.
|
||||
sys_val[\"px4_posix.h\"] = 1;
|
||||
sys_val[\"px4_defines.h\"] = 2;
|
||||
sys_val[\"px4_log.h\"] = 3;
|
||||
sys_val[\"posix_sys.h\"] = 4;
|
||||
saw_sys_val = 5; # Didn't see any of the above; otherwise the lowest value of the header seen.
|
||||
for(b = 0; b < i; ++b) saw_sys[b] = saw_sys_val;
|
||||
}
|
||||
|
||||
END {
|
||||
l = asorti(txt, k, \"sort_by_type_line_header_type_hname\");
|
||||
for (b = 1; b <= l; ++b) {
|
||||
if (type[k[b]] == $type_include && header_type[k[b]] == $cat_posix_sys && saw_sys[k[b]] > saw_sys_val) continue;
|
||||
len = length(txt[k[b]]);
|
||||
for (n = 0; n < len; ++n) print txt[k[b]][n];
|
||||
if (b < l && type[k[b]] == $type_include && type[k[b+1]] != $type_emptyline &&
|
||||
(type[k[b+1]] != $type_include || (header_type[k[b]] != header_type[k[b+1]] && header_type[k[b+1]] != $cat_px4))) {
|
||||
printf \"\n\";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (NR == line[blk + 1]) {
|
||||
++blk;
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/$INCLUDE_RE/ {
|
||||
# Don't use double quotes around standard header names.
|
||||
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)\\\"$STDC_HEADERS_RE\\.h\\\"/, \"\\\1<\\\2.h>\", \"1\");
|
||||
if (is_cxxsrc) {
|
||||
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)\\\"$STDCXX_HEADERS_RE\\\"/, \"\\\1<\\\2>\", \"1\");
|
||||
# Change deprecated C header names to standard C++ header names in C++ source files.
|
||||
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*<)$STDC_HEADERS_RE\\.h>/, \"\\\1c\\\2>\", \"1\");
|
||||
}
|
||||
# Don't include \"./foo.h\", that is implied, so just include \"foo.h\".
|
||||
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*\\\")\.\//, \"\\\1\", \"1\");
|
||||
# Extract the header filename.
|
||||
hname[blk] = gensub(/^[[:space:]]*#[[:space:]]*include[[:space:]]*[<\"]([^>\"]*)[>\"].*/, \"\\\1\", \"1\");
|
||||
# If the header exists in the directory of the including file, then it is a local header.
|
||||
command = sprintf(\"test -e %s/%s\", \"$curdir\", hname[blk]);
|
||||
if (system(command) == 0) {
|
||||
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)[\"<]([^\">]*)[\">]/, \"\\\1\\\"\\\2\\\"\", \"1\");
|
||||
} else {
|
||||
# Do we know if this is a local file, or a submodule / system header?
|
||||
# The grep reg.exp needs \\ (for backslah) and \1 for back reference, thus: \\\1.
|
||||
# However we print the grep command using sprintf, so each backslash needs to be escaped once more: \\\\\\1.
|
||||
# Finally, this is a bash string and we need to escape each backslash once more to pass it corrently to awk, hence we need twelve backslahes:
|
||||
command = sprintf(\"grep '^%s ' '%s' 2>/dev/null\", gensub(/([.+])/, \"\\\\\\\\\\\\1\", \"g\", hname[blk]), \"$TMPDIR/fix_headers_quotes\");
|
||||
ret = command | getline result;
|
||||
if (ret != 0) {
|
||||
result = substr(result, index(result, \" \") + 1);
|
||||
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)[\"<][^\">]*[\">]/, \"\\\1\" result, \"1\");
|
||||
}
|
||||
}
|
||||
# Categorise the header.
|
||||
if (hname[blk] == \"Winsock2.h\") {
|
||||
if (header_type[blk] > $cat_winsock)
|
||||
header_type[blk] = $cat_winsock;
|
||||
}
|
||||
else if (hname[blk] in sys_val) {
|
||||
if (header_type[blk] > $cat_posix_sys)
|
||||
header_type[blk] = $cat_posix_sys;
|
||||
# posix_sys.h is sometimes included within #ifdef __PX4_POSIX ... #endif. The other headers should not be conditional.
|
||||
if ((hname[blk] == \"posix_sys.h\" || type[blk] == $type_include)) {
|
||||
type[blk] = $type_include; # Treat #ifdef __PX4_POSIX #include \"posix_sys.h\" #endif as an include for sorting purposes.
|
||||
saw_sys[blk] = sys_val[hname[blk]]; # There will be only one include (header name) for this block.
|
||||
if (sys_val[hname[blk]] < saw_sys_val)
|
||||
saw_sys_val = sys_val[hname[blk]];
|
||||
}
|
||||
# Use double quotes for these headers.
|
||||
\$0 = gensub(/<([[:alnum:]_\/.]*)>/, \"\\\"\\\1\\\"\", \"1\");
|
||||
}
|
||||
else if (hname[blk] ~ /^(platforms\/px4_|px4_)/) {
|
||||
if (header_type[blk] > $cat_px4)
|
||||
header_type[blk] = $cat_px4;
|
||||
# Use double quotes for these headers.
|
||||
\$0 = gensub(/<([[:alnum:]_\/.]*)>/, \"\\\"\\\1\\\"\", \"1\");
|
||||
}
|
||||
else if (\$0 ~ /^[[:space:]]*#[[:space:]]*include[[:space:]]*\"/) {
|
||||
if (header_type[blk] > $cat_local)
|
||||
header_type[blk] = $cat_local;
|
||||
}
|
||||
else if (hname[blk] ~ /^$STDCXX_HEADERS_RE\$/) {
|
||||
if (header_type[blk] > $cat_cxx)
|
||||
header_type[blk] = $cat_cxx;
|
||||
}
|
||||
else if (hname[blk] ~ /^c$STDC_HEADERS_RE\$/) {
|
||||
if (header_type[blk] > $cat_c)
|
||||
header_type[blk] = $cat_c;
|
||||
}
|
||||
else if (hname[blk] ~ /^$STDC_HEADERS_RE\.h\$/) {
|
||||
if (header_type[blk] > $cat_system)
|
||||
header_type[blk] = $cat_system;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
# Remove empty lines before #include's.
|
||||
if (type[blk] == $type_include) {
|
||||
for (i = 1; blk > i && type[blk - i] == $type_emptyline; ++i)
|
||||
delete txt[blk - i]
|
||||
}
|
||||
txt[blk][n++] = \$0;
|
||||
}
|
||||
|
||||
" > $TMPDIR/fix_headers_current_block
|
||||
|
||||
# Construct a new file in TMPDIR.
|
||||
head -n $((first_line - 1)) "$BASEDIR/$1" > $TMPDIR/fix_headers_current_file
|
||||
|
||||
# Append the editted block.
|
||||
cat $TMPDIR/fix_headers_current_block >> $TMPDIR/fix_headers_current_file
|
||||
|
||||
# Append the rest.
|
||||
tail -n $((total_lines - last_line)) "$BASEDIR/$1" >> $TMPDIR/fix_headers_current_file
|
||||
|
||||
# Compare original with result.
|
||||
if cmp --quiet "$BASEDIR/$1" $TMPDIR/fix_headers_current_file; then
|
||||
echo "No change"
|
||||
else
|
||||
echo "Fixed lines $first_line-$last_line"
|
||||
mv $TMPDIR/fix_headers_current_file "$BASEDIR/$1" || fatal "Failed to move $TMPDIR/fix_headers_current_file to $BASEDIR/$1 !?!"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $non_option_arguments -ne 0 ]; then
|
||||
fixup_header $1
|
||||
exit
|
||||
fi
|
||||
|
||||
# Run the fixup function for each of the files in $TMPDIR/fix_headers_sources_with_includes.
|
||||
# Strip BASEDIR because we don't know how long that is and it might too much for bash.
|
||||
for arg in $(cat "$TMPDIR/fix_headers_sources_with_includes" | cut -c $striplen-); do
|
||||
fixup_header $arg
|
||||
done
|
||||
|
||||
# Clean up.
|
||||
if [ $debug -eq 0 -o $# -eq 0 ]; then
|
||||
rm "$TMPDIR/fix_headers_sources" "$TMPDIR/fix_headers_sources_with_includes" "$TMPDIR/fix_headers_SUBMODULE_HEADERS" "$TMPDIR/fix_headers_HEADERS" \
|
||||
"$TMPDIR/fix_headers_include_paths" "$TMPDIR/fix_headers_quotes" "$TMPDIR/fix_headers_current_block"
|
||||
fi
|
||||
|
||||
# Print all error messages again at the end.
|
||||
if [ -s "$TMPDIR/fix_headers_ERROR.log" ]; then
|
||||
echo "$0 finished with errors:"
|
||||
cat "$TMPDIR/fix_headers_ERROR.log"
|
||||
else
|
||||
echo "SUCCESS"
|
||||
rm "$TMPDIR/fix_headers_ERROR.log"
|
||||
fi
|
||||
+34
-31
@@ -3,6 +3,7 @@
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
|
||||
# This script is run from Build/<target>_default.build/$(PX4_BASE)/Firmware/src/systemcmds/topic_listener
|
||||
|
||||
@@ -21,37 +22,39 @@ for index,m in enumerate(raw_messages):
|
||||
temp_list = []
|
||||
f = open(m,'r')
|
||||
for line in f.readlines():
|
||||
if ('float32[' in line.split(' ')[0]):
|
||||
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
|
||||
temp_list.append(("float_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
|
||||
elif ('float64[' in line.split(' ')[0]):
|
||||
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
|
||||
temp_list.append(("double_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
|
||||
elif ('uint64[' in line.split(' ')[0]):
|
||||
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
|
||||
temp_list.append(("uint64_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
|
||||
elif(line.split(' ')[0] == "float32"):
|
||||
temp_list.append(("float",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif(line.split(' ')[0] == "float64"):
|
||||
temp_list.append(("double",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif(line.split(' ')[0] == "uint64") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint64",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif(line.split(' ')[0] == "uint32") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint32",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif(line.split(' ')[0] == "uint16") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint16",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif(line.split(' ')[0] == "int64") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int64",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif(line.split(' ')[0] == "int32") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int32",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif(line.split(' ')[0] == "int16") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int16",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif (line.split(' ')[0] == "bool") and len(line.split('=')) == 1:
|
||||
temp_list.append(("bool",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif (line.split(' ')[0] == "uint8") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint8",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
elif (line.split(' ')[0] == "int8") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int8",line.split(' ')[1].split('\t')[0].split('\n')[0]))
|
||||
items = re.split('\s+', line.strip())
|
||||
|
||||
if ('float32[' in items[0]):
|
||||
num_floats = int(items[0].split("[")[1].split("]")[0])
|
||||
temp_list.append(("float_array",items[1],num_floats))
|
||||
elif ('float64[' in items[0]):
|
||||
num_floats = int(items[0].split("[")[1].split("]")[0])
|
||||
temp_list.append(("double_array",items[1],num_floats))
|
||||
elif ('uint64[' in items[0]):
|
||||
num_floats = int(items[0].split("[")[1].split("]")[0])
|
||||
temp_list.append(("uint64_array",items[1],num_floats))
|
||||
elif(items[0] == "float32"):
|
||||
temp_list.append(("float",items[1]))
|
||||
elif(items[0] == "float64"):
|
||||
temp_list.append(("double",items[1]))
|
||||
elif(items[0] == "uint64") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint64",items[1]))
|
||||
elif(items[0] == "uint32") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint32",items[1]))
|
||||
elif(items[0] == "uint16") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint16",items[1]))
|
||||
elif(items[0] == "int64") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int64",items[1]))
|
||||
elif(items[0] == "int32") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int32",items[1]))
|
||||
elif(items[0] == "int16") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int16",items[1]))
|
||||
elif (items[0] == "bool") and len(line.split('=')) == 1:
|
||||
temp_list.append(("bool",items[1]))
|
||||
elif (items[0] == "uint8") and len(line.split('=')) == 1:
|
||||
temp_list.append(("uint8",items[1]))
|
||||
elif (items[0] == "int8") and len(line.split('=')) == 1:
|
||||
temp_list.append(("int8",items[1]))
|
||||
|
||||
f.close()
|
||||
(m_head, m_tail) = os.path.split(m)
|
||||
|
||||
+1
-1
Submodule Tools/jMAVSim updated: a5b0f1f089...aca1ddf309
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#! /bin/bash
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd "$SCRIPT_DIR/jMAVSim"
|
||||
|
||||
udp_port=14560
|
||||
extra_args=
|
||||
baudrate=921600
|
||||
device=
|
||||
while getopts ":b:d:p:q" opt; do
|
||||
case $opt in
|
||||
b)
|
||||
baudrate=$OPTARG
|
||||
;;
|
||||
d)
|
||||
device="$OPTARG"
|
||||
;;
|
||||
p)
|
||||
udp_port=$OPTARG
|
||||
;;
|
||||
q)
|
||||
extra_args="$extra_args -qgc"
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$device" == "" ]; then
|
||||
device="-udp 127.0.0.1:$udp_port"
|
||||
else
|
||||
device="-serial $device $baudrate"
|
||||
fi
|
||||
|
||||
ant create_run_jar copy_res
|
||||
cd out/production
|
||||
java -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args
|
||||
+28
-14
@@ -10,6 +10,7 @@ Open a shell over MAVLink.
|
||||
from __future__ import print_function
|
||||
import sys, select
|
||||
import termios
|
||||
from timeit import default_timer as timer
|
||||
|
||||
try:
|
||||
from pymavlink import mavutil
|
||||
@@ -17,7 +18,8 @@ try:
|
||||
except:
|
||||
print("Failed to import pymavlink.")
|
||||
print("You may need to install it with 'pip install pymavlink pyserial'")
|
||||
exit(-1)
|
||||
print("")
|
||||
raise
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
||||
@@ -94,24 +96,27 @@ def main():
|
||||
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)
|
||||
help="Mavlink port baud rate (default=57600)", default=57600)
|
||||
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 sys.platform == "darwin":
|
||||
args.port = "/dev/tty.usbmodem1"
|
||||
else:
|
||||
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) == 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
|
||||
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...")
|
||||
@@ -138,6 +143,8 @@ def main():
|
||||
ERASE_END_LINE = '\x1b[K'
|
||||
sys.stdout.write(CURSOR_BACK_N + ERASE_END_LINE)
|
||||
|
||||
next_heartbeat_time = timer()
|
||||
|
||||
while True:
|
||||
while True:
|
||||
i, o, e = select.select([sys.stdin], [], [], 0)
|
||||
@@ -163,7 +170,7 @@ def main():
|
||||
erase_last_n_chars(1)
|
||||
cur_line = cur_line[:-1]
|
||||
sys.stdout.write(ch)
|
||||
elif ord(ch) == 033:
|
||||
elif ord(ch) == 27:
|
||||
ch = sys.stdin.read(1) # skip one
|
||||
ch = sys.stdin.read(1)
|
||||
if ch == 'A': # arrow up
|
||||
@@ -191,6 +198,13 @@ def main():
|
||||
sys.stdout.write(data)
|
||||
sys.stdout.flush()
|
||||
|
||||
# handle heartbeat sending
|
||||
heartbeat_time = timer()
|
||||
if heartbeat_time > next_heartbeat_time:
|
||||
mav_serialport.mav.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_GCS,
|
||||
mavutil.mavlink.MAV_AUTOPILOT_GENERIC, 0, 0, 0)
|
||||
next_heartbeat_time = heartbeat_time + 1
|
||||
|
||||
except serial.serialutil.SerialException as e:
|
||||
print(e)
|
||||
|
||||
|
||||
Executable
+268
@@ -0,0 +1,268 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Stream ULog data over MAVLink.
|
||||
|
||||
@author: Beat Kueng (beat-kueng@gmx.net)
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
import sys, select, os
|
||||
import datetime
|
||||
from timeit import default_timer as timer
|
||||
os.environ['MAVLINK20'] = '1' # The commands require mavlink 2
|
||||
|
||||
try:
|
||||
from pymavlink import mavutil
|
||||
except:
|
||||
print("Failed to import pymavlink.")
|
||||
print("You may need to install it with 'pip install pymavlink pyserial'")
|
||||
print("")
|
||||
raise
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
||||
class MavlinkLogStreaming():
|
||||
'''Streams log data via MAVLink.
|
||||
Assumptions:
|
||||
- the sender only sends one acked message at a time
|
||||
- the data is in the ULog format '''
|
||||
def __init__(self, portname, baudrate, output_filename, debug=0):
|
||||
self.baudrate = 0
|
||||
self._debug = debug
|
||||
self.buf = ''
|
||||
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")
|
||||
|
||||
self.got_ulog_header = False
|
||||
self.got_header_section = False
|
||||
self.ulog_message = []
|
||||
self.file = open(output_filename,'wb')
|
||||
self.start_time = timer()
|
||||
self.last_sequence = -1
|
||||
self.logging_started = False
|
||||
self.num_dropouts = 0
|
||||
self.target_component = 1
|
||||
|
||||
def debug(self, s, level=1):
|
||||
'''write some debug text'''
|
||||
if self._debug >= level:
|
||||
print(s)
|
||||
|
||||
def start_log(self):
|
||||
self.mav.mav.command_long_send(self.mav.target_system,
|
||||
self.target_component,
|
||||
mavutil.mavlink.MAV_CMD_LOGGING_START, 0,
|
||||
0, 0, 0, 0, 0, 0, 0)
|
||||
|
||||
def stop_log(self):
|
||||
self.mav.mav.command_long_send(self.mav.target_system,
|
||||
self.target_component,
|
||||
mavutil.mavlink.MAV_CMD_LOGGING_STOP, 0,
|
||||
0, 0, 0, 0, 0, 0, 0)
|
||||
|
||||
def read_messages(self):
|
||||
''' main loop reading messages '''
|
||||
measure_time_start = timer()
|
||||
measured_data = 0
|
||||
|
||||
next_heartbeat_time = timer()
|
||||
while True:
|
||||
|
||||
# handle heartbeat sending
|
||||
heartbeat_time = timer()
|
||||
if heartbeat_time > next_heartbeat_time:
|
||||
self.debug('sending heartbeat')
|
||||
self.mav.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_GCS,
|
||||
mavutil.mavlink.MAV_AUTOPILOT_GENERIC, 0, 0, 0)
|
||||
next_heartbeat_time = heartbeat_time + 1
|
||||
|
||||
m, first_msg_start, num_drops = self.read_message()
|
||||
if m is not None:
|
||||
self.process_streamed_ulog_data(m, first_msg_start, num_drops)
|
||||
|
||||
# status output
|
||||
if self.logging_started:
|
||||
measured_data += len(m)
|
||||
measure_time_cur = timer()
|
||||
dt = measure_time_cur - measure_time_start
|
||||
if dt > 1:
|
||||
sys.stdout.write('\rData Rate: {:0.1f} KB/s Drops: {:} \033[K'.format(
|
||||
measured_data / dt / 1024, self.num_dropouts))
|
||||
sys.stdout.flush()
|
||||
measure_time_start = measure_time_cur
|
||||
measured_data = 0
|
||||
|
||||
if not self.logging_started and timer()-self.start_time > 4:
|
||||
raise Exception('Start timed out. Is the logger running in MAVLink mode?')
|
||||
|
||||
|
||||
def read_message(self):
|
||||
''' read a single mavlink message, handle ACK & return a tuple of (data, first
|
||||
message start, num dropouts) '''
|
||||
m = self.mav.recv_match(type=['LOGGING_DATA_ACKED',
|
||||
'LOGGING_DATA', 'COMMAND_ACK'], blocking=True,
|
||||
timeout=0.05)
|
||||
if m is not None:
|
||||
self.debug(m, 3)
|
||||
|
||||
if m.get_type() == 'COMMAND_ACK':
|
||||
if m.command == mavutil.mavlink.MAV_CMD_LOGGING_START and \
|
||||
not self.got_header_section:
|
||||
if m.result == 0:
|
||||
self.logging_started = True
|
||||
print('Logging started. Waiting for Header...')
|
||||
else:
|
||||
raise Exception('Logging start failed', m.result)
|
||||
return None, 0, 0
|
||||
|
||||
# m is either 'LOGGING_DATA_ACKED' or 'LOGGING_DATA':
|
||||
is_newer, num_drops = self.check_sequence(m.sequence)
|
||||
|
||||
# return an ack, even we already sent it for the same sequence,
|
||||
# because the ack could have been dropped
|
||||
if m.get_type() == 'LOGGING_DATA_ACKED':
|
||||
self.mav.mav.logging_ack_send(self.mav.target_system,
|
||||
self.target_component, m.sequence)
|
||||
|
||||
if is_newer:
|
||||
if num_drops > 0:
|
||||
self.num_dropouts += num_drops
|
||||
|
||||
if m.get_type() == 'LOGGING_DATA':
|
||||
if not self.got_header_section:
|
||||
print('Header received in {:0.2f}s'.format(timer()-self.start_time))
|
||||
self.logging_started = True
|
||||
self.got_header_section = True
|
||||
self.last_sequence = m.sequence
|
||||
return m.data[:m.length], m.first_message_offset, num_drops
|
||||
|
||||
else:
|
||||
self.debug('dup/reordered message '+str(m.sequence))
|
||||
|
||||
return None, 0, 0
|
||||
|
||||
|
||||
def check_sequence(self, seq):
|
||||
''' check if a sequence is newer than the previously received one & if
|
||||
there were dropped messages between the last and this '''
|
||||
if self.last_sequence == -1:
|
||||
return True, 0
|
||||
if seq == self.last_sequence: # duplicate
|
||||
return False, 0
|
||||
if seq > self.last_sequence:
|
||||
# account for wrap-arounds, sequence is 2 bytes
|
||||
if seq - self.last_sequence > (1<<15): # assume reordered
|
||||
return False, 0
|
||||
return True, seq - self.last_sequence - 1
|
||||
else:
|
||||
if self.last_sequence - seq > (1<<15):
|
||||
return True, (1<<16) - self.last_sequence - 1 + seq
|
||||
return False, 0
|
||||
|
||||
|
||||
def process_streamed_ulog_data(self, data, first_msg_start, num_drops):
|
||||
''' write streamed data to a file '''
|
||||
if not self.got_ulog_header: # the first 16 bytes need special treatment
|
||||
if len(data) < 16: # that's never the case anyway
|
||||
raise Exception('first received message too short')
|
||||
self.file.write(bytearray(data[0:16]))
|
||||
data = data[16:]
|
||||
self.got_ulog_header = True
|
||||
|
||||
if self.got_header_section and num_drops > 0:
|
||||
if num_drops > 25: num_drops = 25
|
||||
# write a dropout message. We don't really know the actual duration,
|
||||
# so just use the number of drops * 10 ms
|
||||
self.file.write(bytearray([ 2, 0, 79, num_drops*10, 0 ]))
|
||||
|
||||
if num_drops > 0:
|
||||
self.write_ulog_messages(self.ulog_message)
|
||||
self.ulog_message = []
|
||||
if first_msg_start == 255:
|
||||
return # no useful information in this message: drop it
|
||||
data = data[first_msg_start:]
|
||||
first_msg_start = 0
|
||||
|
||||
if first_msg_start == 255 and len(self.ulog_message) > 0:
|
||||
self.ulog_message.extend(data)
|
||||
return
|
||||
|
||||
if len(self.ulog_message) > 0:
|
||||
self.file.write(bytearray(self.ulog_message + data[:first_msg_start]))
|
||||
self.ulog_message = []
|
||||
|
||||
data = self.write_ulog_messages(data[first_msg_start:])
|
||||
self.ulog_message = data # store the rest for the next message
|
||||
|
||||
|
||||
def write_ulog_messages(self, data):
|
||||
''' write ulog data w/o integrity checking, assuming data starts with a
|
||||
valid ulog message. returns the remaining data at the end. '''
|
||||
while len(data) > 2:
|
||||
message_length = data[0] + data[1] * 256 + 3 # 3=ULog msg header
|
||||
if message_length > len(data):
|
||||
break
|
||||
self.file.write(bytearray(data[:message_length]))
|
||||
data = data[message_length:]
|
||||
return data
|
||||
|
||||
|
||||
|
||||
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)
|
||||
parser.add_argument("--output", "-o", dest="output", default = '.',
|
||||
help="output file or directory (default=CWD)")
|
||||
args = parser.parse_args()
|
||||
|
||||
if os.path.isdir(args.output):
|
||||
filename = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S.ulg")
|
||||
filename = os.path.join(args.output, filename)
|
||||
else:
|
||||
filename = args.output
|
||||
print('Output file name: {:}'.format(filename))
|
||||
|
||||
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_log_streaming = MavlinkLogStreaming(args.port, args.baudrate, filename)
|
||||
|
||||
try:
|
||||
print('Starting log...')
|
||||
mav_log_streaming.start_log()
|
||||
mav_log_streaming.read_messages()
|
||||
|
||||
print('Stopping log')
|
||||
mav_log_streaming.stop_log()
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print('Stopping log')
|
||||
mav_log_streaming.stop_log()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (C) 2015 Mark Charlebois. 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
import glob
|
||||
builtins = glob.glob("builtin_commands/COMMAND*")
|
||||
|
||||
apps = []
|
||||
for f in builtins:
|
||||
apps.append(f.split(".")[-1].split("_main")[0])
|
||||
|
||||
print("""
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#define __EXPORT
|
||||
|
||||
#include <px4_tasks.h>
|
||||
#include <px4_posix.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern void px4_show_devices(void);
|
||||
|
||||
extern "C" {
|
||||
""")
|
||||
for app in apps:
|
||||
print("extern int "+app+"_main(int argc, char *argv[]);")
|
||||
|
||||
print("""
|
||||
static int shutdown_main(int argc, char *argv[]);
|
||||
static int list_tasks_main(int argc, char *argv[]);
|
||||
static int list_files_main(int argc, char *argv[]);
|
||||
static int list_devices_main(int argc, char *argv[]);
|
||||
static int list_topics_main(int argc, char *argv[]);
|
||||
static int sleep_main(int argc, char *argv[]);
|
||||
}
|
||||
|
||||
|
||||
static map<string,px4_main_t> app_map(void);
|
||||
|
||||
static map<string,px4_main_t> app_map(void)
|
||||
{
|
||||
static map<string,px4_main_t> apps;
|
||||
""")
|
||||
for app in apps:
|
||||
print('\tapps["'+app+'"] = '+app+'_main;')
|
||||
|
||||
print('\tapps["shutdown"] = shutdown_main;')
|
||||
print('\tapps["list_tasks"] = list_tasks_main;')
|
||||
print('\tapps["list_files"] = list_files_main;')
|
||||
print('\tapps["list_devices"] = list_devices_main;')
|
||||
print('\tapps["list_topics"] = list_topics_main;')
|
||||
print('\tapps["sleep"] = sleep_main;')
|
||||
print("""
|
||||
return apps;
|
||||
}
|
||||
|
||||
map<string,px4_main_t> apps = app_map();
|
||||
|
||||
static void list_builtins(void)
|
||||
{
|
||||
cout << "Builtin Commands:" << endl;
|
||||
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
|
||||
cout << '\t' << it->first << endl;
|
||||
}
|
||||
|
||||
static int shutdown_main(int argc, char *argv[])
|
||||
{
|
||||
cout.flush();
|
||||
cout << endl << "Shutting down" << endl;
|
||||
cout.flush();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static int list_tasks_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_tasks();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_devices_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_devices();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_topics_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_topics();
|
||||
return 0;
|
||||
}
|
||||
static int list_files_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_files();
|
||||
return 0;
|
||||
}
|
||||
static int sleep_main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
cout << "Usage: sleep <seconds>" << endl;
|
||||
return 1;
|
||||
}
|
||||
sleep(atoi(argv[1]));
|
||||
return 0;
|
||||
}
|
||||
static int usleep_main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
cout << "Usage: usleep <microseconds>" << endl;
|
||||
return 1;
|
||||
}
|
||||
usleep(atoi(argv[1]));
|
||||
return 0;
|
||||
}
|
||||
""")
|
||||
|
||||
+54
-16
@@ -1,26 +1,64 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# An example hook script to verify what is about to be committed.
|
||||
# Called by "git commit" with no arguments. The hook should
|
||||
# exit with non-zero status after issuing an appropriate message if
|
||||
# it wants to stop the commit.
|
||||
#
|
||||
# To enable this hook, rename this file to "pre-commit".
|
||||
|
||||
if git rev-parse --verify HEAD >/dev/null 2>&1
|
||||
then
|
||||
against=HEAD
|
||||
against=HEAD
|
||||
else
|
||||
# Initial commit: diff against an empty tree object
|
||||
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||
# Initial commit: diff against an empty tree object
|
||||
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||
fi
|
||||
|
||||
# If you want to allow non-ascii filenames set this variable to true.
|
||||
allownonascii=$(git config hooks.allownonascii)
|
||||
|
||||
# Redirect output to stderr.
|
||||
exec 1>&2
|
||||
|
||||
CHANGED_FILES=`git diff --cached --name-only --diff-filter=ACM $against | grep '\.c\|\.cpp\|\.h\|\.hpp'`
|
||||
FAILED=0
|
||||
if [ ! -z "$CHANGED_FILES" -a "$CHANGED_FILES" != " " ]; then
|
||||
for FILE in $CHANGED_FILES; do
|
||||
./Tools/fix_code_style.sh --quiet < $FILE > $FILE.pretty
|
||||
diff -u $FILE $FILE.pretty || FAILED=1
|
||||
rm -f $FILE.pretty
|
||||
if [ $FAILED -ne 0 ]; then
|
||||
echo "There are code formatting errors. Please fix them by running ./Tools/fix_code_style.sh $FILE"
|
||||
exit $FAILED
|
||||
fi
|
||||
done
|
||||
# Cross platform projects tend to avoid non-ascii filenames; prevent
|
||||
# them from being added to the repository. We exploit the fact that the
|
||||
# printable range starts at the space character and ends with tilde.
|
||||
if [ "$allownonascii" != "true" ] &&
|
||||
# Note that the use of brackets around a tr range is ok here, (it's
|
||||
# even required, for portability to Solaris 10's /usr/bin/tr), since
|
||||
# the square bracket bytes happen to fall in the designated range.
|
||||
test $(git diff --cached --name-only --diff-filter=A -z $against |
|
||||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
||||
then
|
||||
echo "Error: Attempt to add a non-ascii file name."
|
||||
echo
|
||||
echo "This can cause problems if you want to work"
|
||||
echo "with people on other platforms."
|
||||
echo
|
||||
echo "To be portable it is advisable to rename the file ..."
|
||||
echo
|
||||
echo "If you know what you are doing you can disable this"
|
||||
echo "check using:"
|
||||
echo
|
||||
echo " git config hooks.allownonascii true"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
|
||||
# If there are whitespace errors, print the offending file names and fail.
|
||||
git diff-index --check --cached $against --
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for code style, only in changed files
|
||||
for i in `git diff --cached --name-only --diff-filter=ACM`
|
||||
do
|
||||
./Tools/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/check_code_style.sh %
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################################################################
|
||||
#
|
||||
# This script loads PX4 binaries to the Snapdragon Flight target and does a quick on-target sanity test.
|
||||
#
|
||||
# Pre-requisites:
|
||||
# - Snapdragon Flight board connected to the host computer via USB cable
|
||||
# - Snapdragon Flight board must have the latest platform BSP and flight controller addon installed"
|
||||
# - mini-dm installed on host computer (see https://github.com/ATLFlight/ATLFlightDocs/blob/master/UserGuide.md#adsp)
|
||||
# - PX4 software was built and binaries are in their usual locations in the Firmware tree.
|
||||
#
|
||||
# This script supports two modes:
|
||||
# - Default mode (supported by PX4 community)
|
||||
# - Legacy mode (uses proprietary drivers for ESC and RC Receiver, supported by Qualcomm)
|
||||
#
|
||||
# For help and cmd line options, run the script with the -h option
|
||||
#
|
||||
#################################################################################################
|
||||
|
||||
# Halt on error
|
||||
set -e
|
||||
|
||||
# Verbose mode
|
||||
## set -x
|
||||
|
||||
# Mode of operation
|
||||
readonly MODE_DEFAULT=0
|
||||
readonly MODE_LEGACY=1
|
||||
readonly MODE_MAX=$MODE_LEGACY
|
||||
|
||||
readonly RESULT_PASS=0
|
||||
readonly RESULT_FAIL=3
|
||||
readonly EXIT_ERROR=3
|
||||
|
||||
|
||||
# List of expected strings from the apps proc
|
||||
declare -a appsproc_strings_present=(
|
||||
"on udp port 14556 remote port 14550"
|
||||
)
|
||||
|
||||
# List of unexpected strings from the apps proc
|
||||
declare -a appsproc_strings_absent=(
|
||||
"ERROR"
|
||||
"Getting Bulk data from fastRPC link"
|
||||
"Segmentation fault"
|
||||
)
|
||||
|
||||
# List of expected strings from the DSP
|
||||
declare -a dsp_strings_present=(
|
||||
"EKF alignment complete"
|
||||
"AdspCoreSvc: Started successfully"
|
||||
"loading BLSP configuration"
|
||||
)
|
||||
|
||||
# List of unexpected strings from the DSP
|
||||
declare -a dsp_strings_absent=(
|
||||
"Segmentation fault"
|
||||
)
|
||||
|
||||
|
||||
install=0
|
||||
test=0
|
||||
mode=0
|
||||
result=$RESULT_PASS
|
||||
|
||||
# Default mini-dm path (needs to be installed in this location or overriden through cmd line
|
||||
minidmPath=~/Qualcomm/Hexagon_SDK/3.0/tools/debug/mini-dm/Linux_Debug
|
||||
# Default workspace path (parent directory of the script location)
|
||||
workspace=`pwd`/..
|
||||
|
||||
|
||||
verifypx4test() {
|
||||
|
||||
echo -e "Verifying test results..."
|
||||
|
||||
# verify the presence of expected stings in the apps proc console log
|
||||
for lineString in "${appsproc_strings_present[@]}"
|
||||
do
|
||||
if ! grep -Fq "$lineString" px4.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Missing expected string in apps proc log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
# verify the absence of unexpected stings in the apps proc console log
|
||||
for lineString in "${appsproc_strings_absent[@]}"
|
||||
do
|
||||
if grep -Fq "$lineString" px4.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Found unexpected string in apps proc log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
# verify the presence of expected stings in the DSP console log
|
||||
for lineString in "${dsp_strings_present[@]}"
|
||||
do
|
||||
if ! grep -Fq "$lineString" minidm.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Missing expected string in DSP log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
# verify the absence of unexpected stings in the DSP console log
|
||||
for lineString in "${dsp_strings_absent[@]}"
|
||||
do
|
||||
if grep -Fq "$lineString" minidm.log
|
||||
then
|
||||
# code if not found
|
||||
echo -e "[ERROR] Found unexpected string in DSP log: $lineString"
|
||||
result=$RESULT_FAIL
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "Verification complete."
|
||||
|
||||
if [ $result -eq $RESULT_FAIL ]; then
|
||||
echo -e "PX4 test result: FAIL"
|
||||
else
|
||||
echo -e "PX4 test result: PASS"
|
||||
fi
|
||||
}
|
||||
|
||||
installpx4() {
|
||||
|
||||
if [ $install -eq 0 ]; then
|
||||
echo -e "SKIPPING install"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Reboot the target before beginning the installation
|
||||
echo -e "Rebooting the target..."
|
||||
adb shell reboot
|
||||
sleep 45
|
||||
|
||||
echo -e "Now installing PX4 binaries..."
|
||||
# Copy binaries to the target
|
||||
if [ $mode == 0 ]; then
|
||||
# copy default binaries
|
||||
adb push $workspace/build_qurt_eagle_legacy_driver_default/src/firmware/qurt/libpx4.so /usr/share/data/adsp
|
||||
adb push $workspace/build_qurt_eagle_legacy_driver_default/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
|
||||
adb push $workspace/build_posix_eagle_legacy_driver_default/src/firmware/posix/px4 /home/linaro
|
||||
adb push $workspace/posix-configs/eagle/flight/px4.config /usr/share/data/adsp
|
||||
adb push $workspace/posix-configs/eagle/flight/mainapp.config /home/linaro
|
||||
else
|
||||
# copy legacy binaries
|
||||
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4.so /usr/share/data/adsp
|
||||
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
|
||||
adb push $workspace/build_posix_eagle_legacy_driver_default/src/firmware/posix/px4 /home/linaro
|
||||
adb push $workspace/posix-configs/eagle/200qx/px4.config /usr/share/data/adsp
|
||||
adb push $workspace/posix-configs/eagle/200qx/mainapp.config /home/linaro
|
||||
fi
|
||||
|
||||
echo -e "Installation complete."
|
||||
}
|
||||
|
||||
|
||||
testpx4() {
|
||||
|
||||
if [ $test -eq 0 ]; then
|
||||
echo -e "SKIPPING test"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
echo -e "Starting PX4 test..."
|
||||
|
||||
# Remove previous instances of the file
|
||||
rm px4.log | true
|
||||
rm minidm.log | true
|
||||
|
||||
# Start mini-dm
|
||||
${minidmPath}/mini-dm > minidm.log &
|
||||
sleep 5
|
||||
# Verify that mini-dm is running
|
||||
checkProc=$(ps -aef | grep mini-dm | grep -v grep)
|
||||
|
||||
if [ -z "${checkProc}" ]; then
|
||||
echo "[ERROR] Unable to start mini-dm from path: ${minidmPath}"
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
|
||||
|
||||
# Start PX4
|
||||
adb shell "/home/linaro/px4 /home/linaro/mainapp.config" > px4.log 2>&1 &
|
||||
sleep 20
|
||||
# Verify that PX4 is still running
|
||||
checkProc=$(adb shell "ps -aef | grep px4 | grep -v grep")
|
||||
if [ -z "${checkProc}" ]; then
|
||||
echo "[ERROR] PX4 is not running on target!"
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
|
||||
# Stop the PX4 process on target
|
||||
adb shell "ps -eaf | grep px4 | grep -v grep | awk '{print $2}' | tr -s ' ' | cut -d' ' -f2 | xargs kill"
|
||||
sleep 5
|
||||
|
||||
# Stop the mini-dm
|
||||
killall mini-dm
|
||||
|
||||
echo -e "PX4 test complete."
|
||||
|
||||
# Verify the results
|
||||
verifypx4test
|
||||
|
||||
echo -e "For more information, see px4.log and minidm.log."
|
||||
}
|
||||
|
||||
|
||||
usage() {
|
||||
echo -e "\nThis script can copy PX4 binaries to the Snapdragon Flight target and do a quick on-target sanity test.\n"
|
||||
echo -e "Pre-requisites:"
|
||||
echo -e "- Snapdragon Flight board must be connected to host computer via USB"
|
||||
echo -e "- Snapdragon Flight board must have the latest platform BSP and flight controller addon installed"
|
||||
echo -e "- mini-dm must be installed on host computer (see https://github.com/ATLFlight/ATLFlightDocs/blob/master/UserGuide.md#adsp)"
|
||||
echo -e "- PX4 software was built and binaries are in their usual locations in the tree\n"
|
||||
echo -e "USAGE:\n ${0} [-m mode] [-i] [-t] [-l <minidm-path>]"
|
||||
echo -e " -m --> Build mode (0 = default mode, 1 = legacy mode)"
|
||||
echo -e " -i --> Install the PX4 binaries"
|
||||
echo -e " -t --> Test PX4 on target"
|
||||
echo -e " -l --> location of the mini-dm executable (Default: ${minidmPath})"
|
||||
echo -e " -h --> Display this help information"
|
||||
}
|
||||
|
||||
# Parse the command line options
|
||||
while getopts "m:l:ith" opt;
|
||||
do
|
||||
case $opt in
|
||||
m)
|
||||
if [ $OPTARG -gt $MODE_MAX ]; then
|
||||
echo "Invalid mode: $OPTARG (max allowed is $MODE_MAX)"
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
mode=$OPTARG
|
||||
echo "Will run the script in mode $mode."
|
||||
;;
|
||||
i)
|
||||
install=1
|
||||
;;
|
||||
t)
|
||||
test=1
|
||||
;;
|
||||
l)
|
||||
minidmPath=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
:)
|
||||
echo "Option -$OPTARG requires an argument" >&2
|
||||
exit 1;;
|
||||
?)
|
||||
echo "Unknown arg $opt"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Install the PX4 binaries
|
||||
installpx4
|
||||
|
||||
# Run the sanity test
|
||||
testpx4
|
||||
|
||||
exit $result
|
||||
|
||||
@@ -129,8 +129,7 @@ class Parameter(object):
|
||||
Return list of existing bitmask codes in convenient order
|
||||
"""
|
||||
keys = self.bitmask.keys()
|
||||
keys.sort(key=float)
|
||||
return keys
|
||||
return sorted(keys, key=float)
|
||||
|
||||
def GetBitmaskBit(self, index):
|
||||
"""
|
||||
|
||||
@@ -47,6 +47,7 @@ import sys
|
||||
px4_tools_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.append(px4_tools_dir + "/genmsg/src")
|
||||
sys.path.append(px4_tools_dir + "/gencpp/src")
|
||||
px4_msg_dir = os.path.join(px4_tools_dir,"../msg")
|
||||
|
||||
try:
|
||||
import em
|
||||
@@ -78,7 +79,7 @@ __email__ = "thomasgubler@gmail.com"
|
||||
TEMPLATE_FILE = ['msg.h.template', 'msg.cpp.template']
|
||||
TOPICS_LIST_TEMPLATE_FILE = 'uORBTopics.cpp.template'
|
||||
OUTPUT_FILE_EXT = ['.h', '.cpp']
|
||||
INCL_DEFAULT = ['std_msgs:./msg/std_msgs']
|
||||
INCL_DEFAULT = ['std_msgs:./msg/std_msgs','px4:%s'%(px4_msg_dir)]
|
||||
PACKAGE = 'px4'
|
||||
TOPICS_TOKEN = '# TOPICS '
|
||||
|
||||
@@ -146,6 +147,11 @@ def generate_by_template(output_file, template_file, em_globals):
|
||||
Invokes empy intepreter to geneate output_file by the
|
||||
given template_file and predefined em_globals dict
|
||||
"""
|
||||
# check if folder exists:
|
||||
folder_name = os.path.dirname(output_file)
|
||||
if not os.path.exists(folder_name):
|
||||
os.makedirs(folder_name)
|
||||
|
||||
ofile = open(output_file, 'w')
|
||||
# todo, reuse interpreter
|
||||
interpreter = em.Interpreter(output=ofile, globals=em_globals, options={em.RAW_OPT:True,em.BUFFERED_OPT:True})
|
||||
@@ -171,7 +177,7 @@ def convert_dir(format_idx, inputdir, outputdir, templatedir):
|
||||
if os.path.isfile(fni):
|
||||
it = os.path.getmtime(fni)
|
||||
if it > maxinputtime:
|
||||
maxinputtime = it;
|
||||
maxinputtime = it
|
||||
|
||||
# Find the most recent modification time in output dir
|
||||
maxouttime = 0
|
||||
@@ -181,7 +187,7 @@ def convert_dir(format_idx, inputdir, outputdir, templatedir):
|
||||
if os.path.isfile(fni):
|
||||
it = os.path.getmtime(fni)
|
||||
if it > maxouttime:
|
||||
maxouttime = it;
|
||||
maxouttime = it
|
||||
|
||||
# Do not generate if nothing changed on the input
|
||||
if (maxinputtime != 0 and maxouttime != 0 and maxinputtime < maxouttime):
|
||||
@@ -253,11 +259,27 @@ def convert_dir_save(format_idx, inputdir, outputdir, templatedir, temporarydir,
|
||||
|
||||
def generate_topics_list_file(msgdir, outputdir, templatedir):
|
||||
# generate cpp file with topics list
|
||||
tl_globals = {"msgs" : get_msgs_list(msgdir)}
|
||||
msgs = get_msgs_list(msgdir)
|
||||
multi_topics = []
|
||||
for msg in msgs:
|
||||
msg_filename = os.path.join(msgdir, msg)
|
||||
multi_topics.extend(get_multi_topics(msg_filename))
|
||||
tl_globals = {"msgs" : msgs, "multi_topics" : multi_topics}
|
||||
tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE)
|
||||
tl_out_file = os.path.join(outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".template", ""))
|
||||
generate_by_template(tl_out_file, tl_template_file, tl_globals)
|
||||
|
||||
|
||||
def generate_topics_list_file_from_files(files, outputdir, templatedir):
|
||||
# generate cpp file with topics list
|
||||
filenames = [os.path.basename(p) for p in files if os.path.basename(p).endswith(".msg")]
|
||||
multi_topics = []
|
||||
for msg_filename in files:
|
||||
multi_topics.extend(get_multi_topics(msg_filename))
|
||||
tl_globals = {"msgs" : filenames, "multi_topics" : multi_topics}
|
||||
tl_template_file = os.path.join(templatedir, TOPICS_LIST_TEMPLATE_FILE)
|
||||
tl_out_file = os.path.join(outputdir, TOPICS_LIST_TEMPLATE_FILE.replace(".template", ""))
|
||||
generate_by_template(tl_out_file, tl_template_file, tl_globals)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Convert msg files to uorb headers/sources')
|
||||
@@ -290,12 +312,12 @@ if __name__ == "__main__":
|
||||
else:
|
||||
print('Error: either --headers or --sources must be specified')
|
||||
exit(-1)
|
||||
|
||||
if args.file is not None:
|
||||
for f in args.file:
|
||||
generate_output_from_file(generate_idx, f, args.outputdir, args.templatedir, INCL_DEFAULT)
|
||||
generate_output_from_file(generate_idx, f, args.temporarydir, args.templatedir, INCL_DEFAULT)
|
||||
if generate_idx == 1:
|
||||
generate_topics_list_file(args.dir, args.outputdir, args.templatedir)
|
||||
generate_topics_list_file_from_files(args.file, args.outputdir, args.templatedir)
|
||||
copy_changed(args.temporarydir, args.outputdir, args.prefix, args.quiet)
|
||||
elif args.dir is not None:
|
||||
convert_dir_save(
|
||||
generate_idx,
|
||||
|
||||
+1
-2
@@ -39,7 +39,6 @@
|
||||
# metadata fields and a zlib-compressed base64-encoded firmware image.
|
||||
#
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import json
|
||||
import base64
|
||||
@@ -108,7 +107,7 @@ if args.parameter_xml != None:
|
||||
bytes = f.read()
|
||||
desc['parameter_xml_size'] = len(bytes)
|
||||
desc['parameter_xml'] = base64.b64encode(zlib.compress(bytes,9)).decode('utf-8')
|
||||
desc['mav_autopilot'] = 12 # 12 = MAV_AUTOPILOT_PX4
|
||||
desc['mav_autopilot'] = 12 # 12 = MAV_AUTOPILOT_PX4
|
||||
if args.airframe_xml != None:
|
||||
f = open(args.airframe_xml, "rb")
|
||||
bytes = f.read()
|
||||
|
||||
+33
-23
@@ -167,7 +167,7 @@ class uploader(object):
|
||||
MAX_DES_LENGTH = 20
|
||||
|
||||
REBOOT = b'\x30'
|
||||
|
||||
|
||||
INFO_BL_REV = b'\x01' # bootloader protocol revision
|
||||
BL_REV_MIN = 2 # minimum supported bootloader protocol
|
||||
BL_REV_MAX = 5 # maximum supported bootloader protocol
|
||||
@@ -177,18 +177,20 @@ class uploader(object):
|
||||
|
||||
PROG_MULTI_MAX = 252 # protocol max is 255, must be multiple of 4
|
||||
READ_MULTI_MAX = 252 # protocol max is 255
|
||||
|
||||
|
||||
NSH_INIT = bytearray(b'\x0d\x0d\x0d')
|
||||
NSH_REBOOT_BL = b"reboot -b\n"
|
||||
NSH_REBOOT = b"reboot\n"
|
||||
MAVLINK_REBOOT_ID1 = bytearray(b'\xfe\x21\x72\xff\x00\x4c\x00\x00\x80\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x01\x00\x00\x48\xf0')
|
||||
MAVLINK_REBOOT_ID0 = bytearray(b'\xfe\x21\x45\xff\x00\x4c\x00\x00\x80\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x00\x00\x00\xd7\xac')
|
||||
MAVLINK_REBOOT_ID1 = bytearray(b'\xfe\x21\x72\xff\x00\x4c\x00\x00\x40\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x01\x00\x00\x53\x6b')
|
||||
MAVLINK_REBOOT_ID0 = bytearray(b'\xfe\x21\x45\xff\x00\x4c\x00\x00\x40\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x00\x00\x00\xcc\x37')
|
||||
|
||||
def __init__(self, portname, baudrate):
|
||||
def __init__(self, portname, baudrate_bootloader, baudrate_flightstack):
|
||||
# open the port, keep the default timeout short so we can poll quickly
|
||||
self.port = serial.Serial(portname, baudrate, timeout=0.5)
|
||||
self.port = serial.Serial(portname, baudrate_bootloader, timeout=0.5)
|
||||
self.otp = b''
|
||||
self.sn = b''
|
||||
self.baudrate_bootloader = baudrate_bootloader;
|
||||
self.baudrate_flightstack = baudrate_flightstack;
|
||||
|
||||
def close(self):
|
||||
if self.port is not None:
|
||||
@@ -328,12 +330,12 @@ class uploader(object):
|
||||
|
||||
# send a PROG_MULTI command to write a collection of bytes
|
||||
def __program_multi(self, data):
|
||||
|
||||
|
||||
if runningPython3 == True:
|
||||
length = len(data).to_bytes(1, byteorder='big')
|
||||
else:
|
||||
length = chr(len(data))
|
||||
|
||||
|
||||
self.__send(uploader.PROG_MULTI)
|
||||
self.__send(length)
|
||||
self.__send(data)
|
||||
@@ -342,12 +344,12 @@ class uploader(object):
|
||||
|
||||
# verify multiple bytes in flash
|
||||
def __verify_multi(self, data):
|
||||
|
||||
|
||||
if runningPython3 == True:
|
||||
length = len(data).to_bytes(1, byteorder='big')
|
||||
else:
|
||||
length = chr(len(data))
|
||||
|
||||
|
||||
self.__send(uploader.READ_MULTI)
|
||||
self.__send(length)
|
||||
self.__send(uploader.EOC)
|
||||
@@ -410,12 +412,11 @@ class uploader(object):
|
||||
def __verify_v3(self, label, fw):
|
||||
print("\n", end='')
|
||||
self.__drawProgressBar(label, 1, 100)
|
||||
expect_crc = fw.crc(self.fw_maxsize)
|
||||
expect_crc = fw.crc(self.fw_maxsize)
|
||||
self.__send(uploader.GET_CRC
|
||||
+ uploader.EOC)
|
||||
report_crc = self.__recv_int()
|
||||
self.__getSync()
|
||||
verifyProgress = 0
|
||||
if report_crc != expect_crc:
|
||||
print("Expected 0x%x" % expect_crc)
|
||||
print("Got 0x%x" % report_crc)
|
||||
@@ -493,7 +494,7 @@ class uploader(object):
|
||||
except Exception:
|
||||
# ignore bad character encodings
|
||||
pass
|
||||
|
||||
|
||||
self.__erase("Erase ")
|
||||
self.__program("Program", fw)
|
||||
|
||||
@@ -508,19 +509,27 @@ class uploader(object):
|
||||
print("\nRebooting.\n")
|
||||
self.__reboot()
|
||||
self.port.close()
|
||||
|
||||
|
||||
def send_reboot(self):
|
||||
try:
|
||||
# try reboot via NSH first
|
||||
# try MAVLINK command first
|
||||
self.port.flush()
|
||||
self.port.baudrate = self.baudrate_flightstack
|
||||
self.__send(uploader.MAVLINK_REBOOT_ID1)
|
||||
self.__send(uploader.MAVLINK_REBOOT_ID0)
|
||||
# then try reboot via NSH
|
||||
self.__send(uploader.NSH_INIT)
|
||||
self.__send(uploader.NSH_REBOOT_BL)
|
||||
self.__send(uploader.NSH_INIT)
|
||||
self.__send(uploader.NSH_REBOOT)
|
||||
# then try MAVLINK command
|
||||
self.__send(uploader.MAVLINK_REBOOT_ID1)
|
||||
self.__send(uploader.MAVLINK_REBOOT_ID0)
|
||||
self.port.flush()
|
||||
self.port.baudrate = self.baudrate_bootloader
|
||||
except:
|
||||
return
|
||||
try:
|
||||
self.port.flush()
|
||||
self.port.baudrate = self.baudrate_bootloader
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
# Detect python version
|
||||
@@ -532,7 +541,8 @@ else:
|
||||
# Parse commandline arguments
|
||||
parser = argparse.ArgumentParser(description="Firmware uploader for the PX autopilot system.")
|
||||
parser.add_argument('--port', action="store", required=True, help="Serial port(s) to which the FMU may be attached")
|
||||
parser.add_argument('--baud', action="store", type=int, default=115200, help="Baud rate of the serial port (default is 115200), only required for true serial ports.")
|
||||
parser.add_argument('--baud-bootloader', action="store", type=int, default=115200, help="Baud rate of the serial port (default is 115200) when communicating with bootloader, only required for true serial ports.")
|
||||
parser.add_argument('--baud-flightstack', action="store", type=int, default=57600, help="Baud rate of the serial port (default is 57600) when communicating with flight stack(Mavlink or NSH), only required for true serial ports.")
|
||||
parser.add_argument('--force', action='store_true', default=False, help='Override board type check and continue loading')
|
||||
parser.add_argument('--boot-delay', type=int, default=None, help='minimum boot delay to store in flash')
|
||||
parser.add_argument('firmware', action="store", help="Firmware file to be uploaded")
|
||||
@@ -573,15 +583,15 @@ try:
|
||||
if "linux" in _platform:
|
||||
# Linux, don't open Mac OS and Win ports
|
||||
if not "COM" in port and not "tty.usb" in port:
|
||||
up = uploader(port, args.baud)
|
||||
up = uploader(port, args.baud_bootloader, args.baud_flightstack)
|
||||
elif "darwin" in _platform:
|
||||
# OS X, don't open Windows and Linux ports
|
||||
if not "COM" in port and not "ACM" in port:
|
||||
up = uploader(port, args.baud)
|
||||
up = uploader(port, args.baud_bootloader, args.baud_flightstack)
|
||||
elif "win" in _platform:
|
||||
# Windows, don't open POSIX ports
|
||||
if not "/" in port:
|
||||
up = uploader(port, args.baud)
|
||||
up = uploader(port, args.baud_bootloader, args.baud_flightstack)
|
||||
except Exception:
|
||||
# open failed, rate-limit our attempts
|
||||
time.sleep(0.05)
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (C) 2015 Mark Charlebois. 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
import glob
|
||||
#builtins = glob.glob("../Build/linux_default.build/builtin_commands/COMMAND*")
|
||||
builtins = glob.glob("builtin_commands/COMMAND*")
|
||||
|
||||
apps = []
|
||||
for f in builtins:
|
||||
apps.append(f.split(".")[-1].split("_main")[0])
|
||||
|
||||
print
|
||||
print """
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <px4_tasks.h>
|
||||
#include <px4_posix.h>
|
||||
#include <px4_log.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern void px4_show_devices(void);
|
||||
|
||||
extern "C" {
|
||||
"""
|
||||
for app in apps:
|
||||
print "extern int "+app+"_main(int argc, char *argv[]);"
|
||||
|
||||
print """
|
||||
static int shutdown_main(int argc, char *argv[]);
|
||||
static int list_tasks_main(int argc, char *argv[]);
|
||||
static int list_files_main(int argc, char *argv[]);
|
||||
static int list_devices_main(int argc, char *argv[]);
|
||||
static int list_topics_main(int argc, char *argv[]);
|
||||
static int sleep_main(int argc, char *argv[]);
|
||||
}
|
||||
|
||||
|
||||
void init_app_map(map<string,px4_main_t> &apps)
|
||||
{
|
||||
"""
|
||||
for app in apps:
|
||||
print '\tapps["'+app+'"] = '+app+'_main;'
|
||||
|
||||
print '\tapps["shutdown"] = shutdown_main;'
|
||||
print '\tapps["list_tasks"] = list_tasks_main;'
|
||||
print '\tapps["list_files"] = list_files_main;'
|
||||
print '\tapps["list_devices"] = list_devices_main;'
|
||||
print '\tapps["list_topics"] = list_topics_main;'
|
||||
print '\tapps["sleep"] = sleep_main;'
|
||||
|
||||
print """
|
||||
}
|
||||
|
||||
void list_builtins(map<string,px4_main_t> &apps)
|
||||
{
|
||||
printf("Builtin Commands:\\n");
|
||||
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
|
||||
printf("\\t%s\\n", (it->first).c_str());
|
||||
}
|
||||
|
||||
static int shutdown_main(int argc, char *argv[])
|
||||
{
|
||||
printf("Shutting down\\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static int list_tasks_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_tasks();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_devices_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_devices();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_topics_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_topics();
|
||||
return 0;
|
||||
}
|
||||
static int list_files_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_files();
|
||||
return 0;
|
||||
}
|
||||
static int sleep_main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
PX4_WARN( "Usage: sleep <seconds>" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned long usecs = ( (unsigned long) atol( argv[1] ) ) * 1000 * 1000;
|
||||
PX4_WARN("Sleeping for %s, %ld",argv[1],usecs);
|
||||
usleep( usecs );
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
|
||||
+14
-13
@@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
# upload script for network-connected devices via scp (eg Raspberry Pi)
|
||||
|
||||
if [[ "$#" < 2 ]]; then
|
||||
echo "usage: scp_upload.sh SRC1 [SRC2 ...] DEST"
|
||||
@@ -13,20 +14,20 @@ else
|
||||
echo "\$AUTOPILOT_HOST is set to $host"
|
||||
fi
|
||||
|
||||
echo "Uploading..."
|
||||
user=pi
|
||||
if [ -n "${AUTOPILOT_USER}" ]; then
|
||||
user=${AUTOPILOT_USER}
|
||||
fi
|
||||
|
||||
# Get last argument
|
||||
for last; do true; done
|
||||
|
||||
# Go through source files and push them one by one.
|
||||
i=0
|
||||
for arg
|
||||
do
|
||||
if [[ $((i+1)) == "$#" ]]; then
|
||||
break
|
||||
fi
|
||||
# echo "Pushing $arg to $last"
|
||||
#adb push $arg $last
|
||||
scp $arg pi@$host:$last
|
||||
((i+=1))
|
||||
done
|
||||
# All except last argument
|
||||
length=$(($#-1))
|
||||
src_files=${@:1:$length}
|
||||
|
||||
echo "Uploading $src_files..."
|
||||
|
||||
# Upload files
|
||||
scp -r $src_files ${user}@${host}:$last
|
||||
|
||||
|
||||
@@ -8,14 +8,22 @@ 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 ""
|
||||
```
|
||||
|
||||
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.
|
||||
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. Can generate a KML file to view where the photos were taken in Google Earth (including height).
|
||||
|
||||
python geo_tag_images.py --logfile=mylog.bin --input=images/ --output=tagged/
|
||||
```sh
|
||||
python geo_tag_images.py --logfile=mylog.bin --input=images/ --output=tagged/ --kml -v
|
||||
|
||||
python geo_tag_images.py -l=mylog.bin -i=images/ -o=tagged/ --kml -v
|
||||
```
|
||||
|
||||
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/
|
||||
|
||||
```sh
|
||||
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.
|
||||
@@ -9,7 +9,7 @@
|
||||
# Example Syntax:
|
||||
# python geotag.py --logfile=log001.bin --input=images/ --output=imagesWithTag/ --offset=-0.4 -v
|
||||
#
|
||||
# Author: Hector Azpurua
|
||||
# Author: Hector Azpurua hector@azpurua.com
|
||||
# Based on the script of Andreas Bircher
|
||||
|
||||
import os
|
||||
@@ -22,6 +22,7 @@ import argparse
|
||||
from lxml import etree
|
||||
import datetime, calendar
|
||||
from shutil import copyfile
|
||||
from subprocess import check_output
|
||||
from pykml.factory import KML_ElementMaker as KML
|
||||
from pykml.factory import GX_ElementMaker as GX
|
||||
|
||||
@@ -50,7 +51,7 @@ class Main:
|
||||
self.logfile = args['logfile']
|
||||
self.input = args['input']
|
||||
self.output = args['output']
|
||||
self.klm = args['klm']
|
||||
self.kml = args['kml']
|
||||
self.verbose = args['verbose']
|
||||
self.offset = args['offset']
|
||||
self.time_tresh = args['treshold']
|
||||
@@ -58,6 +59,9 @@ class Main:
|
||||
self.tdiff_list = []
|
||||
self.non_processed_files = []
|
||||
self.tagged_gps = []
|
||||
|
||||
print '[INFO] Loading logs and images locations...'
|
||||
|
||||
self.gps_list = self.load_gps_from_log(self.logfile, self.offset)
|
||||
self.img_list = self.load_image_list(self.input)
|
||||
|
||||
@@ -73,11 +77,11 @@ class Main:
|
||||
|
||||
self.tag_images()
|
||||
|
||||
if self.klm and len(self.tdiff_list) > 0:
|
||||
self.gen_klm()
|
||||
if self.kml and len(self.tdiff_list) > 0:
|
||||
self.gen_kml()
|
||||
|
||||
if len(self.non_processed_files) > 0:
|
||||
print '[WARNING] Some images werent processed:'
|
||||
print '[WARNING] Some images werent processed (', len(self.non_processed_files), 'of', len(self.img_list), '):'
|
||||
for elem in self.non_processed_files:
|
||||
print '\t', elem
|
||||
|
||||
@@ -132,7 +136,7 @@ class Main:
|
||||
|
||||
return local_dt.replace(microsecond=utc_dt.microsecond)
|
||||
|
||||
def gen_klm(self):
|
||||
def gen_kml(self):
|
||||
"""
|
||||
Generate a KML file with keypoints on the locations of the pictures, including height
|
||||
:return:
|
||||
@@ -171,7 +175,7 @@ class Main:
|
||||
KML.styleUrl('#{0}'.format(style_dot)),
|
||||
KML.Point(
|
||||
KML.extrude(True),
|
||||
KML.altitudeMode('relativeToGround'),
|
||||
KML.altitudeMode('absolute'),
|
||||
KML.coordinates("{},{},{}".format(gps.lon, gps.lat, gps.alt))
|
||||
),
|
||||
KML.name(str(ii)) if ii % 5 == 0 or ii == 1 else KML.name()
|
||||
@@ -183,7 +187,7 @@ class Main:
|
||||
KML.Placemark(
|
||||
KML.styleUrl('#{0}'.format(style_path)),
|
||||
KML.LineString(
|
||||
KML.altitudeMode('relativeToGround'),
|
||||
KML.altitudeMode('absolute'),
|
||||
KML.coordinates(
|
||||
' '.join(["{},{},{}".format(gps.lon, gps.lat, gps.alt) for gps in self.tagged_gps])
|
||||
)
|
||||
@@ -207,9 +211,18 @@ class Main:
|
||||
:param elem:
|
||||
:return:
|
||||
"""
|
||||
dlist_len = len(datetime_list)
|
||||
|
||||
i = bisect.bisect_left(datetime_list, elem)
|
||||
|
||||
# Cleanup of the indices
|
||||
if i < 0:
|
||||
i = 0
|
||||
elif i >= dlist_len:
|
||||
i = dlist_len - 1
|
||||
|
||||
date = datetime_list[i]
|
||||
diff = (date - elem).total_seconds()
|
||||
diff = abs((date - elem).total_seconds())
|
||||
|
||||
if diff > self.time_tresh:
|
||||
return -1, diff
|
||||
@@ -258,32 +271,46 @@ class Main:
|
||||
: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])
|
||||
out = check_output(["python", "sdlog2_dump.py", log_file, "-m GPS", "-v"])
|
||||
|
||||
for line in out.splitlines():
|
||||
if not line.startswith("MSG GPS:"):
|
||||
continue
|
||||
|
||||
vdict = {}
|
||||
pairs = re.split(r'[;,:]\s*', line)
|
||||
for pair in pairs:
|
||||
e = pair.split('=')
|
||||
if len(e) == 2:
|
||||
vdict[e[0]] = float(e[1])
|
||||
|
||||
gps_time = vdict['TimeMS']
|
||||
gps_week = vdict['Week']
|
||||
gps_lat = vdict['Lat']
|
||||
gps_lon = vdict['Lng']
|
||||
gps_alt = vdict['Alt']
|
||||
|
||||
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 get_image_creation_date(self, filename):
|
||||
exiv_image = pyexiv2.ImageMetadata(filename)
|
||||
exiv_image.read()
|
||||
|
||||
# Prefer DateTime/Original over the other values
|
||||
if 'Exif.Photo.DateTimeOriginal' in exiv_image:
|
||||
cdate = exiv_image['Exif.Photo.DateTimeOriginal'].value
|
||||
return cdate
|
||||
elif 'Exif.Image.DateTime' in exiv_image:
|
||||
cdate = exiv_image['Exif.Image.DateTime'].value
|
||||
return cdate
|
||||
else:
|
||||
epoch = os.path.getmtime(filename)
|
||||
return datetime.datetime.fromtimestamp(epoch)
|
||||
|
||||
def load_image_list(self, input_folder, file_type='jpg'):
|
||||
"""
|
||||
Load image list from a folder given a file type
|
||||
@@ -304,15 +331,16 @@ class Main:
|
||||
tagged_gps = []
|
||||
img_size = len(self.img_list)
|
||||
print '[INFO] Number of images:', img_size
|
||||
print '[INFO] Number of gps logs:', len(self.gps_list)
|
||||
|
||||
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]))
|
||||
cdate = self.get_image_creation_date(self.img_list[i])
|
||||
gps_i, img_tdiff = self.get_closest_datetime_index(dt_list, cdate)
|
||||
base_path, filename = os.path.split(self.img_list[i])
|
||||
|
||||
if gps_i == -1:
|
||||
self.non_processed_files.append(filename)
|
||||
@@ -326,8 +354,9 @@ class Main:
|
||||
(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)
|
||||
output_filename = self.output + str(img_seq) + '_' + filename
|
||||
copyfile(self.img_list[i], output_filename)
|
||||
self.set_gps_location(output_filename, closest_gps.lat, closest_gps.lon, closest_gps.alt)
|
||||
self.tagged_gps.append(closest_gps)
|
||||
img_seq += 1
|
||||
|
||||
@@ -359,7 +388,7 @@ class Main:
|
||||
default=-17000, required=False, type=float
|
||||
)
|
||||
parser.add_argument(
|
||||
'-klm', '--klm', help='Save the in KML format the information of all tagged images.',
|
||||
'-kml', '--kml', help='Save the in KML format the information of all tagged images.',
|
||||
required=False, action='store_true'
|
||||
)
|
||||
parser.add_argument(
|
||||
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Setup environment to make PX4 visible to Gazebo.
|
||||
#
|
||||
# Note, this is not necessary if using a ROS catkin workspace with the px4
|
||||
# package as the paths are exported.
|
||||
#
|
||||
# License: according to LICENSE.md in the root directory of the PX4 Firmware repository
|
||||
|
||||
if [ "$#" != 2 ]
|
||||
then
|
||||
echo usage: source setup_gazebo.bash src_dir build_dir
|
||||
echo ""
|
||||
return 1
|
||||
fi
|
||||
|
||||
SRC_DIR=$1
|
||||
BUILD_DIR=$2
|
||||
|
||||
# setup Gazebo env and update package path
|
||||
export GAZEBO_PLUGIN_PATH=${BUILD_DIR}/build_gazebo:${GAZEBO_PLUGIN_PATH}
|
||||
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:${SRC_DIR}/Tools/sitl_gazebo/models
|
||||
# Disabling the remote model download seems only necessary with Gazebo 6
|
||||
#export GAZEBO_MODEL_DATABASE_URI=""
|
||||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SRC_DIR}/Tools/sitl_gazebo/Build/msgs/:${BUILD_DIR}/build_gazebo
|
||||
echo -e "GAZEBO_PLUGIN_PATH $GAZEBO_PLUGIN_PATH"
|
||||
echo -e "GAZEBO_MODEL_PATH $GAZEBO_MODEL_PATH"
|
||||
echo -e "LD_LIBRARY_PATH $LD_LIBRARY_PATH"
|
||||
+1
-1
Submodule Tools/sitl_gazebo updated: 00dcabb1c2...1cce197149
+28
-26
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
# run multiple instances of the 'px4' binary, but w/o starting the simulator.
|
||||
# It assumes px4 is already built, with 'make posix_sitl_default'
|
||||
|
||||
sitl_num=2
|
||||
|
||||
@@ -11,42 +13,42 @@ mav_oport2=15016
|
||||
|
||||
port_step=10
|
||||
|
||||
src_path=`pwd`
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
src_path="$SCRIPT_DIR/.."
|
||||
|
||||
rc_script="posix-configs/SITL/init/rcS_multiple"
|
||||
rc_script="posix-configs/SITL/init/ekf2/multiple_iris"
|
||||
build_path=${src_path}/build_posix_sitl_default
|
||||
|
||||
echo "killing running instances"
|
||||
pkill px4
|
||||
sleep 2
|
||||
sleep 1
|
||||
|
||||
cd $build_path/src/firmware/posix
|
||||
cd $build_path
|
||||
|
||||
user=`whoami`
|
||||
n=1
|
||||
while [ $n -le $sitl_num ]; do
|
||||
if [ ! -d $n ]; then
|
||||
mkdir -p $n
|
||||
cd $n
|
||||
working_dir="instance_$n"
|
||||
if [ ! -d $working_dir ]; then
|
||||
mkdir -p "$working_dir"
|
||||
pushd "$working_dir" &>/dev/null
|
||||
|
||||
mkdir -p rootfs/fs/microsd
|
||||
mkdir -p rootfs/eeprom
|
||||
touch rootfs/eeprom/parameters
|
||||
# replace template config with configured ports of current instance
|
||||
cat ${src_path}/${rc_script} | sed s/_SIMPORT_/${sim_port}/ | \
|
||||
sed s/_MAVPORT_/${mav_port}/g | sed s/_MAVOPORT_/${mav_oport}/ | \
|
||||
sed s/_MAVPORT2_/${mav_port2}/ | sed s/_MAVOPORT2_/${mav_oport2}/ > rcS
|
||||
popd &>/dev/null
|
||||
fi
|
||||
|
||||
cp ${src_path}/ROMFS/px4fmu_common/mixers/quad_w.main.mix ./
|
||||
cat ${src_path}/${rc_script}_gazebo_iris | sed s/_SIMPORT_/${sim_port}/ | sed s/_MAVPORT_/${mav_port}/g | sed s/_MAVOPORT_/${mav_oport}/ | sed s/_MAVPORT2_/${mav_port2}/ | sed s/_MAVOPORT2_/${mav_oport2}/ > rcS
|
||||
cd ../
|
||||
fi
|
||||
pushd "$working_dir" &>/dev/null
|
||||
echo "starting instance $n in $(pwd)"
|
||||
sudo -b -u $user ../src/firmware/posix/px4 -d "$src_path" rcS >out.log 2>err.log
|
||||
popd &>/dev/null
|
||||
|
||||
cd $n
|
||||
|
||||
sudo -b -u $user ../px4 -d rcS >out.log 2>err.log
|
||||
|
||||
cd ../
|
||||
|
||||
n=$(($n + 1))
|
||||
sim_port=$(($sim_port + $port_step))
|
||||
mav_port=$(($mav_port + $port_step))
|
||||
mav_port2=$(($mav_port2 + $port_step))
|
||||
mav_oport=$(($mav_oport + $port_step))
|
||||
mav_oport2=$(($mav_oport2 + $port_step))
|
||||
n=$(($n + 1))
|
||||
sim_port=$(($sim_port + $port_step))
|
||||
mav_port=$(($mav_port + $port_step))
|
||||
mav_port2=$(($mav_port2 + $port_step))
|
||||
mav_oport=$(($mav_oport + $port_step))
|
||||
mav_oport2=$(($mav_oport2 + $port_step))
|
||||
done
|
||||
|
||||
+50
-41
@@ -1,22 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
rc_script=$1
|
||||
debugger=$2
|
||||
program=$3
|
||||
model=$4
|
||||
build_path=$5
|
||||
curr_dir=`pwd`
|
||||
set -e
|
||||
|
||||
echo args: $@
|
||||
|
||||
sitl_bin=$1
|
||||
rcS_dir=$2
|
||||
debugger=$3
|
||||
program=$4
|
||||
model=$5
|
||||
src_path=$6
|
||||
build_path=$7
|
||||
|
||||
echo SITL ARGS
|
||||
echo rc_script: $rc_script
|
||||
|
||||
echo sitl_bin: $sitl_bin
|
||||
echo rcS_dir: $rcS_dir
|
||||
echo debugger: $debugger
|
||||
echo program: $program
|
||||
echo model: $model
|
||||
echo src_path: $src_path
|
||||
echo build_path: $build_path
|
||||
|
||||
mkdir -p $build_path/src/firmware/posix/rootfs/fs/microsd
|
||||
mkdir -p $build_path/src/firmware/posix/rootfs/eeprom
|
||||
touch $build_path/src/firmware/posix/rootfs/eeprom/parameters
|
||||
working_dir=`pwd`
|
||||
sitl_bin=$build_path/src/firmware/posix/px4
|
||||
rootfs=$build_path/tmp/rootfs
|
||||
|
||||
if [ "$chroot" == "1" ]
|
||||
then
|
||||
@@ -27,43 +35,44 @@ else
|
||||
sudo_enabled=""
|
||||
fi
|
||||
|
||||
# To disable user input
|
||||
if [[ -n "$NO_PXH" ]]; then
|
||||
no_pxh=-d
|
||||
else
|
||||
no_pxh=""
|
||||
fi
|
||||
|
||||
if [ "$model" == "" ] || [ "$model" == "none" ]
|
||||
then
|
||||
echo "empty model, setting iris as default"
|
||||
model="iris"
|
||||
fi
|
||||
|
||||
if [ "$#" -lt 5 ]
|
||||
if [ "$#" -lt 7 ]
|
||||
then
|
||||
echo usage: sitl_run.sh rc_script debugger program model build_path
|
||||
echo usage: sitl_run.sh rc_script rcS_dir debugger program model src_path build_path
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# kill process names that might stil
|
||||
# be running from last time
|
||||
pkill gazebo
|
||||
pkill px4
|
||||
jmavsim_pid=`jps | grep Simulator | cut -d" " -f1`
|
||||
pgrep gazebo && pkill gazebo
|
||||
pgrep px4 && pkill px4
|
||||
jmavsim_pid=`ps aux | grep java | grep Simulator | cut -d" " -f1`
|
||||
if [ -n "$jmavsim_pid" ]
|
||||
then
|
||||
kill $jmavsim_pid
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
cd $build_path/..
|
||||
cp Tools/posix_lldbinit $build_path/src/firmware/posix/.lldbinit
|
||||
cp Tools/posix.gdbinit $build_path/src/firmware/posix/.gdbinit
|
||||
cp $src_path/Tools/posix_lldbinit $working_dir/.lldbinit
|
||||
cp $src_path/Tools/posix.gdbinit $working_dir/.gdbinit
|
||||
|
||||
SIM_PID=0
|
||||
|
||||
if [ "$program" == "jmavsim" ] && [ ! -n "$no_sim" ]
|
||||
then
|
||||
cd Tools/jMAVSim
|
||||
ant create_run_jar copy_res
|
||||
cd out/production
|
||||
java -Djava.ext.dirs= -jar jmavsim_run.jar -udp 127.0.0.1:14560 &
|
||||
$src_path/Tools/jmavsim_run.sh &
|
||||
SIM_PID=`echo $!`
|
||||
cd ../..
|
||||
elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]
|
||||
@@ -71,15 +80,9 @@ then
|
||||
if [ -x "$(command -v gazebo)" ]
|
||||
then
|
||||
# Set the plugin path so Gazebo finds our model and sim
|
||||
export GAZEBO_PLUGIN_PATH=$curr_dir/build_gazebo:${GAZEBO_PLUGIN_PATH}
|
||||
# Set the model path so Gazebo finds the airframes
|
||||
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:$curr_dir/Tools/sitl_gazebo/models
|
||||
# The next line would disable online model lookup, can be commented in, in case of unstable behaviour.
|
||||
# export GAZEBO_MODEL_DATABASE_URI=""
|
||||
export SITL_GAZEBO_PATH=$curr_dir/Tools/sitl_gazebo
|
||||
make --no-print-directory gazebo_build
|
||||
source $src_path/Tools/setup_gazebo.bash ${src_path} ${build_path}
|
||||
|
||||
gzserver --verbose $curr_dir/Tools/sitl_gazebo/worlds/${model}.world &
|
||||
gzserver --verbose ${src_path}/Tools/sitl_gazebo/worlds/${model}.world &
|
||||
SIM_PID=`echo $!`
|
||||
|
||||
if [[ -n "$HEADLESS" ]]; then
|
||||
@@ -98,41 +101,47 @@ then
|
||||
# This is not a simulator, but a log file to replay
|
||||
|
||||
# Check if we need to creat a param file to allow user to change parameters
|
||||
if ! [ -f "${build_path}/src/firmware/posix/rootfs/replay_params.txt" ]
|
||||
if ! [ -f "$rootfs/replay_params.txt" ]
|
||||
then
|
||||
touch ${build_path}/src/firmware/posix/rootfs/replay_params.txt
|
||||
mkdir -p $rootfs
|
||||
touch $rootfs/replay_params.txt
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $build_path/src/firmware/posix
|
||||
cd $working_dir
|
||||
|
||||
if [ "$logfile" != "" ]
|
||||
then
|
||||
cp $logfile rootfs/replay.px4log
|
||||
cp $logfile $rootfs/replay.px4log
|
||||
fi
|
||||
|
||||
# Do not exit on failure now from here on because we want the complete cleanup
|
||||
set +e
|
||||
|
||||
sitl_command="$sudo_enabled $sitl_bin $no_pxh $chroot_enabled $src_path $src_path/${rcS_dir}/${model}"
|
||||
|
||||
echo SITL COMMAND: $sitl_command
|
||||
|
||||
# Start Java simulator
|
||||
if [ "$debugger" == "lldb" ]
|
||||
then
|
||||
lldb -- px4 ../../../../${rc_script}_${program}_${model}
|
||||
lldb -- $sitl_command
|
||||
elif [ "$debugger" == "gdb" ]
|
||||
then
|
||||
gdb --args px4 ../../../../${rc_script}_${program}_${model}
|
||||
gdb --args $sitl_command
|
||||
elif [ "$debugger" == "ddd" ]
|
||||
then
|
||||
ddd --debugger gdb --args px4 ../../../../${rc_script}_${program}_${model}
|
||||
ddd --debugger gdb --args $sitl_command
|
||||
elif [ "$debugger" == "valgrind" ]
|
||||
then
|
||||
valgrind ./px4 ../../../../${rc_script}_${program}_${model}
|
||||
valgrind $sitl_command
|
||||
else
|
||||
$sudo_enabled ./px4 $chroot_enabled ../../../../${rc_script}_${program}_${model}
|
||||
$sitl_command
|
||||
fi
|
||||
|
||||
if [ "$program" == "jmavsim" ]
|
||||
then
|
||||
pkill -9 -P $SIM_PID
|
||||
kill -9 $SIM_PID
|
||||
elif [ "$program" == "gazebo" ]
|
||||
then
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ fi
|
||||
|
||||
if [ $SYSTYPE = "Linux" ];
|
||||
then
|
||||
SERIAL_PORTS="/dev/serial/by-id/usb-3D_Robotics*,/dev/serial/by-id/usb-The_Autopilot*"
|
||||
SERIAL_PORTS="/dev/serial/by-id/*_PX4_*,/dev/serial/by-id/usb-3D_Robotics*,/dev/serial/by-id/usb-The_Autopilot*,/dev/serial/by-id/usb-Bitcraze*,/dev/serial/by-id/pci-Bitcraze*,"
|
||||
fi
|
||||
|
||||
if [ $SYSTYPE = "" ];
|
||||
|
||||
Executable
+109
@@ -0,0 +1,109 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Upload an ULog file to the logs.px4.io web server.
|
||||
|
||||
@author: Beat Kueng (beat-kueng@gmx.net)
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from argparse import ArgumentParser
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
try:
|
||||
import requests
|
||||
except:
|
||||
print("Failed to import requests.")
|
||||
print("You may need to install it with 'pip install requests'")
|
||||
print("")
|
||||
raise
|
||||
|
||||
|
||||
SERVER = 'http://logs.px4.io'
|
||||
#SERVER = 'http://localhost:5006' # for testing locally
|
||||
UPLOAD_URL = SERVER+'/upload'
|
||||
|
||||
quiet = False
|
||||
|
||||
def ask_value(text, default=None):
|
||||
""" ask the user to provide a certain value """
|
||||
if quiet:
|
||||
return ""
|
||||
|
||||
ask_string = 'Enter ' + text
|
||||
if default != None:
|
||||
ask_string += ' (Press ENTER to use ' + default + ')'
|
||||
ask_string += ': '
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
ret = raw_input(ask_string)
|
||||
else:
|
||||
ret = input(ask_string)
|
||||
|
||||
if ret == "" and default != None:
|
||||
return default
|
||||
return ret
|
||||
|
||||
def get_git_email():
|
||||
""" get (globally) configured git email """
|
||||
output = subprocess.check_output(["git", "config", "--global", "user.email"])
|
||||
return output.decode("utf-8").replace('\n', '')
|
||||
|
||||
|
||||
def main():
|
||||
global quiet
|
||||
parser = ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--quiet', '-q', dest='quiet', action='store_true', default=False,
|
||||
help='Quiet mode: do not ask for values which were not provided as parameters')
|
||||
parser.add_argument("--description", dest="description", type=str,
|
||||
help="Log description", default=None)
|
||||
parser.add_argument("--feedback", dest="feedback", type=str,
|
||||
help="Additional feedback", default=None)
|
||||
parser.add_argument("--source", dest="source", type=str,
|
||||
help="Log source (Eg. CI)", default="webui")
|
||||
parser.add_argument("--email", dest="email", type=str,
|
||||
help="Your e-mail (to send the upload link)", default=None)
|
||||
parser.add_argument("FILE", help="ULog file(s)", nargs="+")
|
||||
args = parser.parse_args()
|
||||
|
||||
# arguments
|
||||
quiet = args.quiet
|
||||
if args.description == None:
|
||||
description = ask_value('Log Description')
|
||||
else:
|
||||
description = args.description
|
||||
|
||||
if args.feedback == None:
|
||||
feedback = ask_value('Additional Feedback')
|
||||
else:
|
||||
feedback = args.feedback
|
||||
|
||||
if args.email == None:
|
||||
default_email = get_git_email()
|
||||
email = ask_value('Your e-mail', default_email)
|
||||
else:
|
||||
email = args.email
|
||||
|
||||
payload = {'type': 'personal', 'description': description,
|
||||
'feedback': feedback, 'email': email}
|
||||
|
||||
for file_name in args.FILE:
|
||||
print('Uploading '+file_name+'...')
|
||||
with open(file_name, 'rb') as f:
|
||||
r = requests.post(UPLOAD_URL, data=payload, files={'filearg': f},
|
||||
allow_redirects=False)
|
||||
if r.status_code == 302: # redirect
|
||||
if 'Location' in r.headers:
|
||||
plot_url = r.headers['Location']
|
||||
if len(plot_url) > 0 and plot_url[0] == '/':
|
||||
plot_url = SERVER + plot_url
|
||||
print('URL: '+plot_url)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
+12
-6
@@ -4,17 +4,23 @@ machine:
|
||||
|
||||
checkout:
|
||||
post:
|
||||
# workaround for known git bug where attempting to fetch a missing commit fails early on the first try
|
||||
- git submodule update --init --recursive || true
|
||||
- git submodule sync --recursive
|
||||
- git submodule update --init --recursive
|
||||
- git submodule deinit -f .
|
||||
- git submodule update --init --recursive --force
|
||||
|
||||
## Customize dependencies
|
||||
dependencies:
|
||||
cache_directories:
|
||||
- "~/.ccache"
|
||||
pre:
|
||||
- docker pull px4io/px4-dev-nuttx-gcc4.9
|
||||
- docker pull px4io/px4-dev-nuttx-gcc_next:2016-10-20
|
||||
|
||||
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"
|
||||
- docker run --rm -v `pwd`:`pwd`:rw -e CI=true -w=`pwd` --user=$UID -it px4io/px4-dev-nuttx-gcc_next:2016-10-20 /bin/bash -c "make quick_check"
|
||||
|
||||
general:
|
||||
artifacts:
|
||||
- "build_px4fmu-v2_default/parameters.xml"
|
||||
- "build_px4fmu-v2_default/airframes.xml"
|
||||
- "build_.*/src/firmware/nuttx/.*.px4"
|
||||
|
||||
|
||||
+1
-1
Submodule cmake/cmake_hexagon updated: eb1d242e57...75828c3218
+201
-68
@@ -45,6 +45,9 @@
|
||||
# * px4_generate_messages
|
||||
# * px4_add_upload
|
||||
# * px4_add_common_flags
|
||||
# * px4_add_optimization_flags_for_target
|
||||
# * px4_add_executable
|
||||
# * px4_add_library
|
||||
#
|
||||
|
||||
include(CMakeParseArguments)
|
||||
@@ -98,9 +101,6 @@ include(CMakeParseArguments)
|
||||
function(px4_parse_function_args)
|
||||
cmake_parse_arguments(IN "" "NAME" "OPTIONS;ONE_VALUE;MULTI_VALUE;REQUIRED;ARGN" "${ARGN}")
|
||||
cmake_parse_arguments(OUT "${IN_OPTIONS}" "${IN_ONE_VALUE}" "${IN_MULTI_VALUE}" "${IN_ARGN}")
|
||||
if (OUT_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "${IN_NAME}: unparsed ${OUT_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
foreach(arg ${IN_REQUIRED})
|
||||
if (NOT OUT_${arg})
|
||||
message(FATAL_ERROR "${IN_NAME} requires argument ${arg}\nARGN: ${IN_ARGN}")
|
||||
@@ -136,14 +136,14 @@ function(px4_add_git_submodule)
|
||||
REQUIRED TARGET PATH
|
||||
ARGN ${ARGN})
|
||||
string(REPLACE "/" "_" NAME ${PATH})
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND touch ${CMAKE_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/.gitmodules
|
||||
add_custom_command(OUTPUT ${PX4_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMAND touch ${PX4_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
DEPENDS ${PX4_SOURCE_DIR}/.gitmodules
|
||||
)
|
||||
add_custom_target(${TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
DEPENDS ${PX4_BINARY_DIR}/git_init_${NAME}.stamp
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@@ -231,6 +231,7 @@ endfunction()
|
||||
# [ COMPILE_FLAGS <list> ]
|
||||
# [ INCLUDES <list> ]
|
||||
# [ DEPENDS <string> ]
|
||||
# [ EXTERNAL ]
|
||||
# )
|
||||
#
|
||||
# Input:
|
||||
@@ -239,11 +240,12 @@ endfunction()
|
||||
# STACK : deprecated use stack main instead
|
||||
# STACK_MAIN : size of stack for main function
|
||||
# STACK_MAX : maximum stack size of any frame
|
||||
# COMPILE_FLAGS : compile flags
|
||||
# COMPILE_FLAGS : compile flags
|
||||
# LINK_FLAGS : link flags
|
||||
# SRCS : source files
|
||||
# INCLUDES : include directories
|
||||
# DEPENDS : targets which this module depends on
|
||||
# EXTERNAL : flag to indicate that this module is out-of-tree
|
||||
#
|
||||
# Output:
|
||||
# Static library with name matching MODULE.
|
||||
@@ -263,10 +265,15 @@ function(px4_add_module)
|
||||
NAME px4_add_module
|
||||
ONE_VALUE MODULE MAIN STACK STACK_MAIN STACK_MAX PRIORITY
|
||||
MULTI_VALUE COMPILE_FLAGS LINK_FLAGS SRCS INCLUDES DEPENDS
|
||||
OPTIONS EXTERNAL
|
||||
REQUIRED MODULE
|
||||
ARGN ${ARGN})
|
||||
|
||||
add_library(${MODULE} STATIC EXCLUDE_FROM_ALL ${SRCS})
|
||||
if(EXTERNAL)
|
||||
px4_mangle_name("${EXTERNAL_MODULES_LOCATION}/src/${MODULE}" MODULE)
|
||||
endif()
|
||||
|
||||
px4_add_library(${MODULE} STATIC EXCLUDE_FROM_ALL ${SRCS})
|
||||
|
||||
# set defaults if not set
|
||||
set(MAIN_DEFAULT MAIN-NOTFOUND)
|
||||
@@ -326,6 +333,9 @@ function(px4_add_module)
|
||||
# store module properties in target
|
||||
# COMPILE_FLAGS and LINK_FLAGS are passed to compiler/linker by cmake
|
||||
# STACK_MAIN, MAIN, PRIORITY are PX4 specific
|
||||
if(COMPILE_FLAGS AND ${_no_optimization_for_target})
|
||||
px4_strip_optimization(COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
endif()
|
||||
foreach (prop COMPILE_FLAGS LINK_FLAGS STACK_MAIN MAIN PRIORITY)
|
||||
if (${prop})
|
||||
set_target_properties(${MODULE} PROPERTIES ${prop} ${${prop}})
|
||||
@@ -371,7 +381,7 @@ function(px4_generate_messages)
|
||||
endif()
|
||||
|
||||
# headers
|
||||
set(msg_out_path ${CMAKE_BINARY_DIR}/src/modules/uORB/topics)
|
||||
set(msg_out_path ${PX4_BINARY_DIR}/src/modules/uORB/topics)
|
||||
set(msg_list)
|
||||
foreach(msg_file ${MSG_FILES})
|
||||
get_filename_component(msg ${msg_file} NAME_WE)
|
||||
@@ -386,18 +396,18 @@ function(px4_generate_messages)
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--headers
|
||||
${QUIET}
|
||||
-d msg
|
||||
-f ${MSG_FILES}
|
||||
-o ${msg_out_path}
|
||||
-e msg/templates/uorb
|
||||
-t ${CMAKE_BINARY_DIR}/topics_temporary_header
|
||||
-t ${PX4_BINARY_DIR}/topics_temporary_header
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic headers"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# !sources
|
||||
set(msg_source_out_path ${CMAKE_BINARY_DIR}/topics_sources)
|
||||
set(msg_source_out_path ${PX4_BINARY_DIR}/topics_sources)
|
||||
set(msg_source_files_out ${msg_source_out_path}/uORBTopics.cpp)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_source_files_out ${msg_source_out_path}/${msg}.cpp)
|
||||
@@ -407,12 +417,12 @@ function(px4_generate_messages)
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--sources
|
||||
${QUIET}
|
||||
-d msg
|
||||
-f ${MSG_FILES}
|
||||
-o ${msg_source_out_path}
|
||||
-e msg/templates/uorb
|
||||
-t ${CMAKE_BINARY_DIR}/topics_temporary_sources
|
||||
-t ${PX4_BINARY_DIR}/topics_temporary_sources
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic sources"
|
||||
VERBATIM
|
||||
)
|
||||
@@ -427,7 +437,7 @@ function(px4_generate_messages)
|
||||
|
||||
# multi messages for target OS
|
||||
set(msg_multi_out_path
|
||||
${CMAKE_BINARY_DIR}/src/platforms/${OS}/px4_messages)
|
||||
${PX4_BINARY_DIR}/src/platforms/${OS}/px4_messages)
|
||||
set(msg_multi_files_out)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_multi_files_out ${msg_multi_out_path}/px4_${msg}.h)
|
||||
@@ -437,18 +447,18 @@ function(px4_generate_messages)
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--headers
|
||||
${QUIET}
|
||||
-d msg
|
||||
-f ${MSG_FILES}
|
||||
-o ${msg_multi_out_path}
|
||||
-e msg/templates/px4/uorb
|
||||
-t ${CMAKE_BINARY_DIR}/multi_topics_temporary/${OS}
|
||||
-t ${PX4_BINARY_DIR}/multi_topics_temporary/${OS}
|
||||
-p "px4_"
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic multi headers for ${OS}"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_library(${TARGET}
|
||||
px4_add_library(${TARGET}
|
||||
${msg_source_files_out}
|
||||
${msg_multi_files_out}
|
||||
${msg_files_out}
|
||||
@@ -489,7 +499,9 @@ function(px4_add_upload)
|
||||
list(APPEND serial_ports
|
||||
/dev/serial/by-id/usb-3D_Robotics*
|
||||
/dev/serial/by-id/usb-The_Autopilot*
|
||||
/dev/serial/by-id/usb-Bitcraze*
|
||||
/dev/serial/by-id/pci-3D_Robotics*
|
||||
/dev/serial/by-id/pci-Bitcraze*
|
||||
)
|
||||
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
list(APPEND serial_ports
|
||||
@@ -504,9 +516,9 @@ function(px4_add_upload)
|
||||
px4_join(OUT serial_ports LIST "${serial_ports}" GLUE ",")
|
||||
add_custom_target(${OUT}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/Tools/px_uploader.py --port ${serial_ports} ${BUNDLE}
|
||||
${PX4_SOURCE_DIR}/Tools/px_uploader.py --port ${serial_ports} ${BUNDLE}
|
||||
DEPENDS ${BUNDLE}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
COMMENT "uploading ${BUNDLE}"
|
||||
VERBATIM
|
||||
USES_TERMINAL
|
||||
@@ -523,9 +535,9 @@ function(px4_add_adb_push)
|
||||
ARGN ${ARGN})
|
||||
|
||||
add_custom_target(${OUT}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Tools/adb_upload.sh ${FILES} ${DEST}
|
||||
COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload.sh ${FILES} ${DEST}
|
||||
DEPENDS ${DEPENDS}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
COMMENT "uploading ${BUNDLE}"
|
||||
VERBATIM
|
||||
USES_TERMINAL
|
||||
@@ -541,9 +553,9 @@ function(px4_add_adb_push_to_bebop)
|
||||
ARGN ${ARGN})
|
||||
|
||||
add_custom_target(${OUT}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Tools/adb_upload_to_bebop.sh ${FILES} ${DEST}
|
||||
COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload_to_bebop.sh ${FILES} ${DEST}
|
||||
DEPENDS ${DEPENDS}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
COMMENT "uploading ${BUNDLE}"
|
||||
VERBATIM
|
||||
USES_TERMINAL
|
||||
@@ -559,9 +571,26 @@ function(px4_add_scp_push)
|
||||
ARGN ${ARGN})
|
||||
|
||||
add_custom_target(${OUT}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Tools/scp_upload.sh ${FILES} ${DEST}
|
||||
COMMAND ${PX4_SOURCE_DIR}/Tools/scp_upload.sh ${FILES} ${DEST}
|
||||
DEPENDS ${DEPENDS}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
COMMENT "uploading ${BUNDLE}"
|
||||
VERBATIM
|
||||
USES_TERMINAL
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function(px4_add_upload_aero)
|
||||
px4_parse_function_args(
|
||||
NAME px4_add_upload_aero
|
||||
ONE_VALUE OS BOARD OUT BUNDLE
|
||||
REQUIRED OS BOARD OUT BUNDLE
|
||||
ARGN ${ARGN})
|
||||
|
||||
add_custom_target(${OUT}
|
||||
COMMAND ${PX4_SOURCE_DIR}/Tools/aero_upload.sh ${BUNDLE}
|
||||
DEPENDS ${BUNDLE}
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
COMMENT "uploading ${BUNDLE}"
|
||||
VERBATIM
|
||||
USES_TERMINAL
|
||||
@@ -573,13 +602,14 @@ endfunction()
|
||||
#
|
||||
# px4_add_common_flags
|
||||
#
|
||||
# Set ths default build flags.
|
||||
# Set the default build flags.
|
||||
#
|
||||
# Usage:
|
||||
# px4_add_common_flags(
|
||||
# BOARD <in-string>
|
||||
# C_FLAGS <inout-variable>
|
||||
# CXX_FLAGS <inout-variable>
|
||||
# OPTIMIZATION_FLAGS <inout-variable>
|
||||
# EXE_LINKER_FLAGS <inout-variable>
|
||||
# INCLUDE_DIRS <inout-variable>
|
||||
# LINK_DIRS <inout-variable>
|
||||
@@ -591,8 +621,9 @@ endfunction()
|
||||
# Input/Output: (appends to existing variable)
|
||||
# C_FLAGS : c compile flags variable
|
||||
# CXX_FLAGS : c++ compile flags variable
|
||||
# EXE_LINKER_FLAGS : executable linker flags variable
|
||||
# INCLUDE_DIRS : include directories
|
||||
# OPTIMIZATION_FLAGS : optimization compile flags variable
|
||||
# EXE_LINKER_FLAGS : executable linker flags variable
|
||||
# INCLUDE_DIRS : include directories
|
||||
# LINK_DIRS : link directories
|
||||
# DEFINITIONS : definitions
|
||||
#
|
||||
@@ -601,13 +632,14 @@ endfunction()
|
||||
# BOARD px4fmu-v2
|
||||
# C_FLAGS CMAKE_C_FLAGS
|
||||
# CXX_FLAGS CMAKE_CXX_FLAGS
|
||||
# OPTIMIZATION_FLAGS optimization_flags
|
||||
# EXE_LINKER_FLAG CMAKE_EXE_LINKER_FLAGS
|
||||
# INCLUDES <list>)
|
||||
#
|
||||
function(px4_add_common_flags)
|
||||
|
||||
set(inout_vars
|
||||
C_FLAGS CXX_FLAGS EXE_LINKER_FLAGS INCLUDE_DIRS LINK_DIRS DEFINITIONS)
|
||||
C_FLAGS CXX_FLAGS OPTIMIZATION_FLAGS EXE_LINKER_FLAGS INCLUDE_DIRS LINK_DIRS DEFINITIONS)
|
||||
|
||||
px4_parse_function_args(
|
||||
NAME px4_add_common_flags
|
||||
@@ -661,9 +693,14 @@ function(px4_add_common_flags)
|
||||
|
||||
if ($ENV{MEMORY_DEBUG} MATCHES "1")
|
||||
message(STATUS "address sanitizer enabled")
|
||||
set(max_optimization -Os)
|
||||
if ("${OS}" STREQUAL "nuttx")
|
||||
set(max_optimization -Os)
|
||||
elseif (${BOARD} STREQUAL "bebop")
|
||||
set(max_optimization -Os)
|
||||
endif()
|
||||
|
||||
set(optimization_flags
|
||||
# Do not use optimization_flags (without _) as that is already used.
|
||||
set(_optimization_flags
|
||||
-fno-strict-aliasing
|
||||
-fno-omit-frame-pointer
|
||||
-funsafe-math-optimizations
|
||||
@@ -672,12 +709,18 @@ function(px4_add_common_flags)
|
||||
-g3 -fsanitize=address
|
||||
)
|
||||
else()
|
||||
set(max_optimization -Os)
|
||||
if ("${OS}" STREQUAL "nuttx")
|
||||
set(max_optimization -Os)
|
||||
elseif (${BOARD} STREQUAL "bebop")
|
||||
set(max_optimization -Os)
|
||||
else()
|
||||
set(max_optimization -O2)
|
||||
endif()
|
||||
|
||||
if ("${OS}" STREQUAL "qurt")
|
||||
set(PIC_FLAG -fPIC)
|
||||
endif()
|
||||
set(optimization_flags
|
||||
set(_optimization_flags
|
||||
-fno-strict-aliasing
|
||||
-fomit-frame-pointer
|
||||
-funsafe-math-optimizations
|
||||
@@ -688,7 +731,7 @@ function(px4_add_common_flags)
|
||||
endif()
|
||||
|
||||
if (NOT ${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")
|
||||
list(APPEND optimization_flags
|
||||
list(APPEND _optimization_flags
|
||||
-fno-strength-reduce
|
||||
-fno-builtin-printf
|
||||
)
|
||||
@@ -746,8 +789,6 @@ function(px4_add_common_flags)
|
||||
${c_compile_flags}
|
||||
${warnings}
|
||||
${c_warnings}
|
||||
${max_optimization}
|
||||
${optimization_flags}
|
||||
${visibility_flags}
|
||||
)
|
||||
|
||||
@@ -755,27 +796,30 @@ function(px4_add_common_flags)
|
||||
${cxx_compile_flags}
|
||||
${warnings}
|
||||
${cxx_warnings}
|
||||
${max_optimization}
|
||||
${optimization_flags}
|
||||
${visibility_flags}
|
||||
)
|
||||
|
||||
set(added_optimization_flags
|
||||
${max_optimization}
|
||||
${_optimization_flags}
|
||||
)
|
||||
|
||||
set(added_include_dirs
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/modules
|
||||
${CMAKE_SOURCE_DIR}/src/include
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/platforms
|
||||
${PX4_SOURCE_DIR}/src
|
||||
${PX4_BINARY_DIR}
|
||||
${PX4_BINARY_DIR}/src
|
||||
${PX4_SOURCE_DIR}/src/modules
|
||||
${PX4_SOURCE_DIR}/src/include
|
||||
${PX4_SOURCE_DIR}/src/lib
|
||||
${PX4_SOURCE_DIR}/src/platforms
|
||||
# TODO Build/versioning was in Makefile,
|
||||
# do we need this, how does it work with cmake
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/boards/${BOARD}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}/src/modules/px4_messages
|
||||
${CMAKE_BINARY_DIR}/src/modules
|
||||
${CMAKE_SOURCE_DIR}/mavlink/include/mavlink
|
||||
${CMAKE_SOURCE_DIR}/src/lib/DriverFramework/framework/include
|
||||
${PX4_SOURCE_DIR}/src/drivers/boards/${BOARD}
|
||||
${PX4_BINARY_DIR}
|
||||
${PX4_BINARY_DIR}/src/modules/px4_messages
|
||||
${PX4_BINARY_DIR}/src/modules
|
||||
${PX4_SOURCE_DIR}/mavlink/include/mavlink
|
||||
${PX4_SOURCE_DIR}/src/lib/DriverFramework/framework/include
|
||||
)
|
||||
|
||||
list(APPEND added_include_dirs
|
||||
@@ -783,12 +827,18 @@ function(px4_add_common_flags)
|
||||
)
|
||||
|
||||
set(added_link_dirs) # none used currently
|
||||
set(added_exe_linker_flags)
|
||||
|
||||
string(TOUPPER ${BOARD} board_upper)
|
||||
string(REPLACE "-" "_" board_config ${board_upper})
|
||||
set (added_target_definitions)
|
||||
if (NOT ${target_definitions})
|
||||
px4_prepend_string(OUT added_target_definitions STR "-D" LIST ${target_definitions})
|
||||
endif()
|
||||
set(added_definitions
|
||||
-DCONFIG_ARCH_BOARD_${board_config}
|
||||
-D__STDC_FORMAT_MACROS
|
||||
${added_target_definitions}
|
||||
)
|
||||
|
||||
if (NOT (APPLE AND (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")))
|
||||
@@ -799,6 +849,20 @@ function(px4_add_common_flags)
|
||||
)
|
||||
endif()
|
||||
|
||||
# code coverage
|
||||
if ($ENV{PX4_CODE_COVERAGE} MATCHES "1")
|
||||
message(STATUS "Code coverage build flags enabled")
|
||||
list(APPEND added_cxx_flags
|
||||
-fprofile-arcs -ftest-coverage --coverage -g3 -O0 -fno-elide-constructors -Wno-invalid-offsetof -fno-default-inline -fno-inline
|
||||
)
|
||||
list(APPEND added_c_flags
|
||||
-fprofile-arcs -ftest-coverage --coverage -g3 -O0 -fno-default-inline -fno-inline
|
||||
)
|
||||
list(APPEND added_exe_linker_flags
|
||||
-ftest-coverage --coverage -lgcov
|
||||
)
|
||||
endif()
|
||||
|
||||
# output
|
||||
foreach(var ${inout_vars})
|
||||
string(TOLOWER ${var} lower_var)
|
||||
@@ -858,19 +922,20 @@ function(px4_create_git_hash_header)
|
||||
COMMAND git describe --always --tags
|
||||
OUTPUT_VARIABLE git_tag
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
message(STATUS "GIT_TAG = ${git_tag}")
|
||||
execute_process(
|
||||
COMMAND git rev-parse --verify HEAD
|
||||
OUTPUT_VARIABLE git_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
#message(STATUS "GIT_VERSION = ${git_version}")
|
||||
set(git_version_short)
|
||||
string(SUBSTRING ${git_version} 1 16 git_version_short)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY)
|
||||
# We use the first 16 chars, starting at index 0
|
||||
string(SUBSTRING ${git_version} 0 16 git_version_short)
|
||||
configure_file(${PX4_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY)
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
@@ -897,12 +962,12 @@ function(px4_generate_parameters_xml)
|
||||
ONE_VALUE OUT BOARD
|
||||
REQUIRED OUT BOARD
|
||||
ARGN ${ARGN})
|
||||
set(path ${CMAKE_SOURCE_DIR}/src)
|
||||
set(path ${PX4_SOURCE_DIR}/src)
|
||||
file(GLOB_RECURSE param_src_files
|
||||
${CMAKE_SOURCE_DIR}/src/*params.c
|
||||
${PX4_SOURCE_DIR}/src/*params.c
|
||||
)
|
||||
add_custom_command(OUTPUT ${OUT}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/px_process_params.py
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_params.py
|
||||
-s ${path} --board CONFIG_ARCH_${BOARD} --xml --inject-xml
|
||||
DEPENDS ${param_src_files}
|
||||
)
|
||||
@@ -944,7 +1009,7 @@ function(px4_generate_parameters_source)
|
||||
set(SCOPE "")
|
||||
endif()
|
||||
add_custom_command(OUTPUT ${generated_files}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/px_generate_params.py ${XML} ${SCOPE}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_generate_params.py ${XML} ${SCOPE}
|
||||
DEPENDS ${XML} ${DEPS} ${SCOPE}
|
||||
)
|
||||
set(${OUT} ${generated_files} PARENT_SCOPE)
|
||||
@@ -975,10 +1040,10 @@ function(px4_generate_airframes_xml)
|
||||
ONE_VALUE OUT BOARD
|
||||
REQUIRED OUT BOARD
|
||||
ARGN ${ARGN})
|
||||
set(process_airframes ${CMAKE_SOURCE_DIR}/Tools/px_process_airframes.py)
|
||||
set(process_airframes ${PX4_SOURCE_DIR}/Tools/px_process_airframes.py)
|
||||
add_custom_command(OUTPUT ${OUT}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${process_airframes}
|
||||
-a ${CMAKE_SOURCE_DIR}/ROMFS/px4fmu_common/init.d
|
||||
-a ${PX4_SOURCE_DIR}/ROMFS/px4fmu_common/init.d
|
||||
--board CONFIG_ARCH_BOARD_${BOARD} --xml
|
||||
)
|
||||
set(${OUT} ${${OUT}} PARENT_SCOPE)
|
||||
@@ -1033,5 +1098,73 @@ function(px4_copy_tracked)
|
||||
set(${OUT} ${_files_out} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
#
|
||||
# px4_strip_optimization
|
||||
#
|
||||
function(px4_strip_optimization name)
|
||||
set(_compile_flags)
|
||||
separate_arguments(_args UNIX_COMMAND ${ARGN})
|
||||
foreach(_flag ${_args})
|
||||
if(NOT "${_flag}" MATCHES "^-O")
|
||||
set(_compile_flags "${_compile_flags} ${_flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
string(STRIP "${_compile_flags}" _compile_flags)
|
||||
set(${name} "${_compile_flags}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
#
|
||||
# px4_add_optimization_flags_for_target
|
||||
#
|
||||
set(all_posix_cmake_targets "" CACHE INTERNAL "All cmake targets for which optimization can be suppressed")
|
||||
function(px4_add_optimization_flags_for_target target)
|
||||
set(_no_optimization_for_target FALSE)
|
||||
# If the current CONFIG is posix_sitl_* then suppress optimization for certain targets.
|
||||
if(CONFIG MATCHES "^posix_sitl_")
|
||||
foreach(_regexp $ENV{PX4_NO_OPTIMIZATION})
|
||||
if("${target}" MATCHES "${_regexp}")
|
||||
set(_no_optimization_for_target TRUE)
|
||||
set(_matched_regexp "${_regexp}")
|
||||
endif()
|
||||
endforeach()
|
||||
# Create a full list of targets that optimization can be suppressed for.
|
||||
list(APPEND all_posix_cmake_targets ${target})
|
||||
set(all_posix_cmake_targets ${all_posix_cmake_targets} CACHE INTERNAL "All cmake targets for which optimization can be suppressed")
|
||||
endif()
|
||||
if(NOT ${_no_optimization_for_target})
|
||||
target_compile_options(${target} PRIVATE ${optimization_flags})
|
||||
else()
|
||||
message(STATUS "Disabling optimization for target '${target}' because it matches the regexp '${_matched_regexp}' in env var PX4_NO_OPTIMIZATION")
|
||||
target_compile_options(${target} PRIVATE -O0)
|
||||
endif()
|
||||
# Pass variable to the parent px4_add_library.
|
||||
set(_no_optimization_for_target ${_no_optimization_for_target} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
#
|
||||
# px4_add_executable
|
||||
#
|
||||
# Like add_executable but with optimization flag fixup.
|
||||
#
|
||||
function(px4_add_executable target)
|
||||
add_executable(${target} ${ARGN})
|
||||
px4_add_optimization_flags_for_target(${target})
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
#
|
||||
# px4_add_library
|
||||
#
|
||||
# Like add_library but with optimization flag fixup.
|
||||
#
|
||||
function(px4_add_library target)
|
||||
add_library(${target} ${ARGN})
|
||||
px4_add_optimization_flags_for_target(${target})
|
||||
# Pass variable to the parent px4_add_module.
|
||||
set(_no_optimization_for_target ${_no_optimization_for_target} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# vim: set noet fenc=utf-8 ff=unix nowrap:
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
drivers/device
|
||||
drivers/stm32
|
||||
drivers/stm32/adc
|
||||
drivers/led
|
||||
drivers/px4fmu
|
||||
drivers/boards/aerofc-v1
|
||||
drivers/tap_esc
|
||||
drivers/mpu6500
|
||||
drivers/ms5611
|
||||
drivers/hmc5883
|
||||
drivers/gps
|
||||
drivers/ist8310
|
||||
modules/sensors
|
||||
# dummy tone alarm
|
||||
modules/dummy
|
||||
|
||||
#
|
||||
# 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/attitude_estimator_q
|
||||
modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
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
|
||||
lib/rc
|
||||
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")
|
||||
+45
-29
@@ -1,8 +1,8 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_uavcan_num_ifaces 2)
|
||||
set(config_uavcan_num_ifaces 1)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
@@ -15,60 +15,72 @@ set(config_module_list
|
||||
drivers/led
|
||||
drivers/px4fmu
|
||||
drivers/px4io
|
||||
drivers/boards/px4fmu-v2
|
||||
drivers/boards/auav-x21
|
||||
drivers/rgbled
|
||||
drivers/mpu6000
|
||||
drivers/mpu9250
|
||||
drivers/lsm303d
|
||||
drivers/l3gd20
|
||||
drivers/hmc5883
|
||||
drivers/ms5611
|
||||
#drivers/mb12xx
|
||||
drivers/mb12xx
|
||||
drivers/srf02
|
||||
drivers/sf0x
|
||||
drivers/sf1xx
|
||||
drivers/ll40ls
|
||||
drivers/trone
|
||||
drivers/gps
|
||||
drivers/pwm_out_sim
|
||||
#drivers/hott
|
||||
#drivers/hott/hott_telemetry
|
||||
#drivers/hott/hott_sensors
|
||||
drivers/hott
|
||||
drivers/hott/hott_telemetry
|
||||
drivers/hott/hott_sensors
|
||||
drivers/blinkm
|
||||
drivers/airspeed
|
||||
drivers/ets_airspeed
|
||||
drivers/meas_airspeed
|
||||
drivers/frsky_telemetry
|
||||
modules/sensors
|
||||
#drivers/mkblctrl
|
||||
drivers/mkblctrl
|
||||
drivers/px4flow
|
||||
#drivers/oreoled
|
||||
drivers/gimbal
|
||||
drivers/oreoled
|
||||
drivers/vmount
|
||||
drivers/pwm_input
|
||||
drivers/camera_trigger
|
||||
drivers/bst
|
||||
#drivers/snapdragon_rc_pwm
|
||||
#drivers/lis3mdl
|
||||
drivers/snapdragon_rc_pwm
|
||||
drivers/lis3mdl
|
||||
|
||||
#
|
||||
# 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
|
||||
systemcmds/motor_ramp
|
||||
|
||||
#
|
||||
# Testing
|
||||
#
|
||||
drivers/sf0x/sf0x_tests
|
||||
drivers/test_ppm
|
||||
#lib/rc/rc_tests
|
||||
modules/commander/commander_tests
|
||||
modules/controllib_test
|
||||
modules/mavlink/mavlink_tests
|
||||
modules/mc_pos_control/mc_pos_control_tests
|
||||
modules/unit_test
|
||||
modules/uORB/uORB_tests
|
||||
systemcmds/tests
|
||||
|
||||
#
|
||||
# General system control
|
||||
@@ -77,19 +89,21 @@ set(config_module_list
|
||||
modules/load_mon
|
||||
modules/navigator
|
||||
modules/mavlink
|
||||
#modules/gpio_led
|
||||
modules/gpio_led
|
||||
modules/uavcan
|
||||
modules/land_detector
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
# Estimation modules
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
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
|
||||
@@ -130,7 +144,7 @@ set(config_module_list
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
platforms/common
|
||||
platforms/common
|
||||
platforms/nuttx/px4_layer
|
||||
|
||||
#
|
||||
@@ -187,9 +201,11 @@ set(config_io_extra_libs
|
||||
add_custom_target(sercon)
|
||||
set_target_properties(sercon PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "sercon" STACK_MAIN "2048")
|
||||
MAIN "sercon" STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
add_custom_target(serdis)
|
||||
set_target_properties(serdis PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "serdis" STACK_MAIN "2048")
|
||||
MAIN "serdis" STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
@@ -0,0 +1,156 @@
|
||||
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/led
|
||||
drivers/px4fmu
|
||||
drivers/boards/crazyflie
|
||||
drivers/mpu9250
|
||||
drivers/lps25h
|
||||
drivers/gps
|
||||
modules/sensors
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
systemcmds/bl_update
|
||||
systemcmds/mixer
|
||||
systemcmds/param
|
||||
systemcmds/perf
|
||||
systemcmds/pwm
|
||||
systemcmds/esc_calib
|
||||
systemcmds/reboot
|
||||
systemcmds/top
|
||||
systemcmds/config
|
||||
systemcmds/nshterm
|
||||
systemcmds/mtd
|
||||
systemcmds/dumpfile
|
||||
systemcmds/ver
|
||||
|
||||
#
|
||||
# General system control
|
||||
#
|
||||
modules/commander
|
||||
modules/load_mon
|
||||
modules/navigator
|
||||
modules/mavlink
|
||||
#modules/gpio_led
|
||||
modules/land_detector
|
||||
|
||||
modules/dummy
|
||||
modules/syslink
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
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
|
||||
modules/mc_pos_control
|
||||
# modules/vtol_att_control
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
modules/sdlog2
|
||||
|
||||
#
|
||||
# Library modules
|
||||
#
|
||||
modules/param
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
modules/uORB
|
||||
modules/dataman
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
lib/controllib
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
lib/rc
|
||||
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
|
||||
|
||||
#
|
||||
# OBC challenge
|
||||
#
|
||||
modules/bottle_drop
|
||||
|
||||
#
|
||||
# Rover apps
|
||||
#
|
||||
examples/rover_steering_control
|
||||
|
||||
#
|
||||
# Demo apps
|
||||
#
|
||||
#examples/math_demo
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/px4_simple_app
|
||||
#examples/px4_simple_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/daemon
|
||||
#examples/px4_daemon_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/debug_values
|
||||
#examples/px4_mavlink_debug
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/example_fixedwing_control
|
||||
#examples/fixedwing_control
|
||||
|
||||
# Hardware test
|
||||
#examples/hwtest
|
||||
)
|
||||
|
||||
set(config_extra_builtin_cmds
|
||||
serdis
|
||||
sercon
|
||||
)
|
||||
|
||||
set(config_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")
|
||||
@@ -1,8 +1,8 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_uavcan_num_ifaces 2)
|
||||
set(config_uavcan_num_ifaces 1)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
@@ -14,11 +14,9 @@ set(config_module_list
|
||||
drivers/stm32/tone_alarm
|
||||
drivers/led
|
||||
drivers/px4fmu
|
||||
#drivers/px4io
|
||||
#drivers/test_ppm
|
||||
drivers/boards/mindpx-v2
|
||||
#drivers/rgbled
|
||||
drivers/rgbled_pwm
|
||||
drivers/rgbled
|
||||
#drivers/rgbled_pwm
|
||||
#drivers/mpu6000
|
||||
#drivers/mpu6050
|
||||
drivers/mpu6500
|
||||
@@ -27,13 +25,14 @@ set(config_module_list
|
||||
drivers/l3gd20
|
||||
drivers/hmc5883
|
||||
drivers/ms5611
|
||||
#drivers/mb12xx
|
||||
#drivers/srf02
|
||||
drivers/mb12xx
|
||||
drivers/srf02
|
||||
drivers/srf02_i2c
|
||||
drivers/hc_sr04
|
||||
#drivers/sf0x
|
||||
#drivers/ll40ls
|
||||
#drivers/trone
|
||||
#drivers/hc_sr04
|
||||
drivers/sf0x
|
||||
drivers/sf1xx
|
||||
drivers/ll40ls
|
||||
drivers/trone
|
||||
drivers/gps
|
||||
drivers/pwm_out_sim
|
||||
#drivers/hott
|
||||
@@ -48,7 +47,7 @@ set(config_module_list
|
||||
#drivers/mkblctrl
|
||||
drivers/px4flow
|
||||
#drivers/oreoled
|
||||
drivers/gimbal
|
||||
drivers/vmount
|
||||
drivers/pwm_input
|
||||
drivers/camera_trigger
|
||||
drivers/bst
|
||||
@@ -80,6 +79,7 @@ set(config_module_list
|
||||
drivers/sf0x/sf0x_tests
|
||||
drivers/test_ppm
|
||||
modules/commander/commander_tests
|
||||
modules/mc_pos_control/mc_pos_control_tests
|
||||
modules/controllib_test
|
||||
modules/mavlink/mavlink_tests
|
||||
modules/unit_test
|
||||
@@ -98,10 +98,9 @@ set(config_module_list
|
||||
modules/land_detector
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
# Estimation modules
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
modules/ekf2
|
||||
@@ -136,6 +135,7 @@ set(config_module_list
|
||||
lib/controllib
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
lib/rc
|
||||
lib/ecl
|
||||
lib/external_lgpl
|
||||
lib/geo
|
||||
@@ -184,6 +184,9 @@ set(config_module_list
|
||||
|
||||
# Hardware test
|
||||
#examples/hwtest
|
||||
|
||||
# EKF
|
||||
#examples/ekf_att_pos_estimator
|
||||
)
|
||||
|
||||
set(config_extra_builtin_cmds
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
@@ -23,7 +23,7 @@ set(config_module_list
|
||||
drivers/ms5611
|
||||
drivers/mb12xx
|
||||
drivers/sf0x
|
||||
drivers/ll40ls
|
||||
#drivers/ll40ls
|
||||
drivers/trone
|
||||
drivers/gps
|
||||
drivers/pwm_out_sim
|
||||
@@ -36,6 +36,7 @@ set(config_module_list
|
||||
drivers/meas_airspeed
|
||||
drivers/frsky_telemetry
|
||||
modules/sensors
|
||||
drivers/vmount
|
||||
drivers/camera_trigger
|
||||
drivers/mkblctrl
|
||||
drivers/px4flow
|
||||
@@ -68,13 +69,11 @@ set(config_module_list
|
||||
modules/land_detector
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
# Estimation modules
|
||||
#
|
||||
# Too high RAM usage due to static allocations
|
||||
# modules/attitude_estimator_ekf
|
||||
modules/attitude_estimator_q
|
||||
modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
#modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
modules/ekf2
|
||||
|
||||
#
|
||||
@@ -121,18 +120,18 @@ set(config_module_list
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
platforms/common
|
||||
platforms/common
|
||||
platforms/nuttx/px4_layer
|
||||
|
||||
#
|
||||
# OBC challenge
|
||||
#
|
||||
modules/bottle_drop
|
||||
# modules/bottle_drop
|
||||
|
||||
#
|
||||
# Rover apps
|
||||
#
|
||||
examples/rover_steering_control
|
||||
# examples/rover_steering_control
|
||||
|
||||
#
|
||||
# Demo apps
|
||||
@@ -177,10 +176,12 @@ add_custom_target(sercon)
|
||||
set_target_properties(sercon PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "sercon"
|
||||
STACK_MAIN "2048")
|
||||
STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
add_custom_target(serdis)
|
||||
set_target_properties(serdis PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "serdis"
|
||||
STACK_MAIN "2048")
|
||||
STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_uavcan_num_ifaces 2)
|
||||
|
||||
@@ -24,29 +24,29 @@ set(config_module_list
|
||||
drivers/hmc5883
|
||||
drivers/ms5611
|
||||
#drivers/mb12xx
|
||||
drivers/srf02
|
||||
#drivers/srf02
|
||||
drivers/sf0x
|
||||
drivers/ll40ls
|
||||
#drivers/ll40ls
|
||||
drivers/trone
|
||||
drivers/gps
|
||||
drivers/pwm_out_sim
|
||||
#drivers/hott
|
||||
#drivers/hott/hott_telemetry
|
||||
#drivers/hott/hott_sensors
|
||||
drivers/blinkm
|
||||
#drivers/blinkm
|
||||
drivers/airspeed
|
||||
drivers/ets_airspeed
|
||||
drivers/meas_airspeed
|
||||
drivers/frsky_telemetry
|
||||
#drivers/frsky_telemetry
|
||||
modules/sensors
|
||||
#drivers/mkblctrl
|
||||
drivers/px4flow
|
||||
#drivers/oreoled
|
||||
drivers/gimbal
|
||||
#drivers/vmount
|
||||
drivers/pwm_input
|
||||
drivers/camera_trigger
|
||||
drivers/bst
|
||||
drivers/snapdragon_rc_pwm
|
||||
#drivers/snapdragon_rc_pwm
|
||||
drivers/lis3mdl
|
||||
|
||||
#
|
||||
@@ -54,7 +54,7 @@ set(config_module_list
|
||||
#
|
||||
systemcmds/bl_update
|
||||
systemcmds/config
|
||||
systemcmds/dumpfile
|
||||
#systemcmds/dumpfile
|
||||
#systemcmds/esc_calib
|
||||
systemcmds/mixer
|
||||
#systemcmds/motor_ramp
|
||||
@@ -89,17 +89,16 @@ set(config_module_list
|
||||
modules/load_mon
|
||||
modules/navigator
|
||||
modules/mavlink
|
||||
#modules/gpio_led
|
||||
modules/gpio_led
|
||||
modules/uavcan
|
||||
modules/land_detector
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
# Estimation modules
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
#modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
#modules/attitude_estimator_q
|
||||
#modules/position_estimator_inav
|
||||
#modules/local_position_estimator
|
||||
modules/ekf2
|
||||
|
||||
#
|
||||
@@ -145,7 +144,7 @@ set(config_module_list
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
platforms/common
|
||||
platforms/common
|
||||
platforms/nuttx/px4_layer
|
||||
|
||||
#
|
||||
@@ -202,9 +201,11 @@ set(config_io_extra_libs
|
||||
add_custom_target(sercon)
|
||||
set_target_properties(sercon PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "sercon" STACK_MAIN "2048")
|
||||
MAIN "sercon" STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
add_custom_target(serdis)
|
||||
set_target_properties(serdis PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "serdis" STACK_MAIN "2048")
|
||||
MAIN "serdis" STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_uavcan_num_ifaces 2)
|
||||
|
||||
@@ -42,7 +42,7 @@ set(config_module_list
|
||||
#drivers/mkblctrl
|
||||
drivers/px4flow
|
||||
#drivers/oreoled
|
||||
drivers/gimbal
|
||||
#drivers/vmount
|
||||
drivers/pwm_input
|
||||
drivers/camera_trigger
|
||||
#drivers/bst
|
||||
@@ -76,6 +76,7 @@ set(config_module_list
|
||||
drivers/test_ppm
|
||||
#lib/rc/rc_tests
|
||||
modules/commander/commander_tests
|
||||
modules/mc_pos_control/mc_pos_control_tests
|
||||
modules/controllib_test
|
||||
modules/mavlink/mavlink_tests
|
||||
modules/unit_test
|
||||
@@ -94,11 +95,10 @@ set(config_module_list
|
||||
modules/land_detector
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
# Estimation modules
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
#modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
#modules/position_estimator_inav
|
||||
modules/local_position_estimator
|
||||
modules/ekf2
|
||||
|
||||
@@ -145,7 +145,7 @@ set(config_module_list
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
platforms/common
|
||||
platforms/common
|
||||
platforms/nuttx/px4_layer
|
||||
|
||||
#
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_uavcan_num_ifaces 2)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
drivers/airspeed
|
||||
drivers/blinkm
|
||||
drivers/bmi160
|
||||
drivers/bmp280
|
||||
drivers/boards/px4fmu-v2
|
||||
drivers/bst
|
||||
drivers/camera_trigger
|
||||
drivers/device
|
||||
drivers/ets_airspeed
|
||||
drivers/frsky_telemetry
|
||||
drivers/gps
|
||||
drivers/hmc5883
|
||||
drivers/hott
|
||||
drivers/hott/hott_sensors
|
||||
drivers/hott/hott_telemetry
|
||||
drivers/l3gd20
|
||||
drivers/led
|
||||
drivers/lis3mdl
|
||||
drivers/ll40ls
|
||||
drivers/lsm303d
|
||||
drivers/mb12xx
|
||||
drivers/meas_airspeed
|
||||
drivers/mkblctrl
|
||||
drivers/mpu6000
|
||||
drivers/mpu9250
|
||||
drivers/ms5611
|
||||
drivers/oreoled
|
||||
drivers/pwm_input
|
||||
drivers/pwm_out_sim
|
||||
drivers/px4flow
|
||||
drivers/px4fmu
|
||||
drivers/px4io
|
||||
drivers/rgbled
|
||||
drivers/sf0x
|
||||
drivers/sf1xx
|
||||
drivers/snapdragon_rc_pwm
|
||||
drivers/srf02
|
||||
drivers/stm32
|
||||
drivers/stm32/adc
|
||||
drivers/stm32/tone_alarm
|
||||
drivers/tap_esc
|
||||
drivers/trone
|
||||
drivers/vmount
|
||||
modules/sensors
|
||||
|
||||
#
|
||||
# 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/reboot
|
||||
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/mc_pos_control/mc_pos_control_tests
|
||||
modules/unit_test
|
||||
modules/uORB/uORB_tests
|
||||
systemcmds/tests
|
||||
|
||||
#
|
||||
# General system control
|
||||
#
|
||||
modules/commander
|
||||
modules/gpio_led
|
||||
modules/land_detector
|
||||
modules/load_mon
|
||||
modules/mavlink
|
||||
modules/navigator
|
||||
modules/uavcan
|
||||
|
||||
#
|
||||
# Estimation modules
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
modules/ekf2
|
||||
modules/local_position_estimator
|
||||
modules/position_estimator_inav
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
modules/fw_att_control
|
||||
modules/fw_pos_control_l1
|
||||
modules/mc_att_control
|
||||
modules/mc_pos_control
|
||||
modules/vtol_att_control
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
modules/logger
|
||||
modules/sdlog2
|
||||
|
||||
#
|
||||
# Library modules
|
||||
#
|
||||
modules/dataman
|
||||
modules/param
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
modules/uORB
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
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
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
platforms/common
|
||||
platforms/nuttx/px4_layer
|
||||
|
||||
#
|
||||
# OBC challenge
|
||||
#
|
||||
modules/bottle_drop
|
||||
|
||||
#
|
||||
# Rover apps
|
||||
#
|
||||
examples/rover_steering_control
|
||||
|
||||
#
|
||||
# Demo apps
|
||||
#
|
||||
#examples/math_demo
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/px4_simple_app
|
||||
examples/px4_simple_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/daemon
|
||||
#examples/px4_daemon_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/debug_values
|
||||
#examples/px4_mavlink_debug
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/example_fixedwing_control
|
||||
#examples/fixedwing_control
|
||||
|
||||
# Hardware test
|
||||
#examples/hwtest
|
||||
|
||||
# EKF
|
||||
examples/ekf_att_pos_estimator
|
||||
)
|
||||
|
||||
set(config_extra_builtin_cmds
|
||||
serdis
|
||||
sercon
|
||||
)
|
||||
|
||||
set(config_io_board
|
||||
px4io-v2
|
||||
)
|
||||
|
||||
set(config_extra_libs
|
||||
uavcan
|
||||
uavcan_stm32_driver
|
||||
)
|
||||
|
||||
set(config_io_extra_libs
|
||||
)
|
||||
|
||||
add_custom_target(sercon)
|
||||
set_target_properties(sercon PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "sercon" STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
add_custom_target(serdis)
|
||||
set_target_properties(serdis PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "serdis" STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
@@ -1,6 +1,6 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_uavcan_num_ifaces 1)
|
||||
|
||||
@@ -40,7 +40,7 @@ set(config_module_list
|
||||
drivers/mkblctrl
|
||||
drivers/px4flow
|
||||
drivers/oreoled
|
||||
drivers/gimbal
|
||||
drivers/vmount
|
||||
drivers/pwm_input
|
||||
drivers/camera_trigger
|
||||
drivers/bst
|
||||
@@ -77,6 +77,7 @@ set(config_module_list
|
||||
drivers/sf0x/sf0x_tests
|
||||
drivers/test_ppm
|
||||
modules/commander/commander_tests
|
||||
modules/mc_pos_control/mc_pos_control_tests
|
||||
modules/controllib_test
|
||||
modules/mavlink/mavlink_tests
|
||||
modules/unit_test
|
||||
@@ -98,7 +99,6 @@ set(config_module_list
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
modules/attitude_estimator_q
|
||||
modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
modules/ekf2
|
||||
modules/local_position_estimator
|
||||
@@ -183,6 +183,9 @@ set(config_module_list
|
||||
|
||||
# Hardware test
|
||||
#examples/hwtest
|
||||
|
||||
# EKF
|
||||
examples/ekf_att_pos_estimator
|
||||
)
|
||||
|
||||
set(config_extra_builtin_cmds
|
||||
@@ -202,10 +205,12 @@ add_custom_target(sercon)
|
||||
set_target_properties(sercon PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "sercon"
|
||||
STACK_MAIN "2048")
|
||||
STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
add_custom_target(serdis)
|
||||
set_target_properties(serdis PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "serdis"
|
||||
STACK_MAIN "2048")
|
||||
STACK_MAIN "2048"
|
||||
COMPILE_FLAGS "-Os")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(target_definitions MEMORY_CONSTRAINED_SYSTEM)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
@@ -15,13 +17,14 @@ set(config_module_list
|
||||
drivers/boards/tap-v1
|
||||
drivers/rgbled_pwm
|
||||
drivers/tap_esc
|
||||
#drivers/mpu6500
|
||||
drivers/mpu6000
|
||||
drivers/ms5611
|
||||
drivers/hmc5883
|
||||
drivers/gps
|
||||
drivers/airspeed
|
||||
drivers/meas_airspeed
|
||||
modules/sensors
|
||||
drivers/vmount
|
||||
drivers/camera_trigger
|
||||
|
||||
#
|
||||
@@ -95,6 +98,7 @@ set(config_module_list
|
||||
lib/runway_takeoff
|
||||
lib/tailsitter_recovery
|
||||
lib/DriverFramework/framework
|
||||
lib/rc
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user