Compare commits

...

382 Commits
v0.3 ... v0.9

Author SHA1 Message Date
Oleg Kalachev
8dc4e6e0b9 docs 2018-08-19 19:07:49 +03:00
Oleg Kalachev
360ce5c77b docs: little improvements 2018-08-19 19:05:34 +03:00
Oleg Kalachev
4b6d630f5c docs: little improvements 2018-08-19 19:01:39 +03:00
Oleg Kalachev
47d4b3d8a8 docs: little improvements 2018-08-19 18:58:12 +03:00
Oleg Kalachev
162d9d05cc rc: use web for statustext notifications 2018-08-18 00:41:12 +03:00
Oleg Kalachev
4f114184bf Improvements to selfcheck node 2018-08-17 18:03:51 +03:00
Oleg Kalachev
810e44563c docs: small fixes 2018-08-15 21:14:59 +03:00
Oleg Kalachev
704aaf163c docs: add mavlink packet structure example 2018-08-15 21:07:16 +03:00
Smirnov Artem
55988650a6 Fix links 2018-08-13 22:55:24 +03:00
Smirnov Artem
eb499512ee docs: Fix links 2018-08-13 22:45:02 +03:00
Smirnov Artem
794310550c Update README.md 2018-08-13 21:19:14 +03:00
Oleg Kalachev
280db083b4 image: build clever package in Release mode 2018-08-13 16:50:10 +03:00
Oleg Kalachev
d5353a5bef docs: small fix 2018-08-11 05:30:04 +03:00
Oleg Kalachev
fc428d45b9 Add pymavlink library 2018-08-11 05:16:01 +03:00
Oleg Kalachev
19181facdb docs: small fixes 2018-08-11 05:09:21 +03:00
Oleg Kalachev
8813fce63f docs: small fixes 2018-08-11 05:06:51 +03:00
Oleg Kalachev
ac8090ae8b docs: small improvement 2018-08-11 00:38:55 +03:00
Oleg Kalachev
53e644a5f7 docs: add some capitalization info to markdownlint config 2018-08-10 22:20:40 +03:00
Oleg Kalachev
a325156e71 docs: add markdownlint config 2018-08-10 22:10:04 +03:00
Oleg Kalachev
05e1875eec docs: small fix 2018-08-10 21:15:25 +03:00
Oleg Kalachev
98d1ad8494 docs: small changes to ros.md 2018-08-10 21:14:54 +03:00
Oleg Kalachev
ef6b8727b9 docs: add info on /etc/clever_version file 2018-08-10 19:19:25 +03:00
Andrei Korigodski
d7ced0f9c4 docs: fix typo in ros.md 2018-08-10 18:41:18 +03:00
Oleg Kalachev
d76ef207fe Rough attempt to disable glossary links 2018-08-10 18:27:55 +03:00
Oleg Kalachev
fdf6eadfcd docs: disable glossary (attempt #2) 2018-08-10 18:10:16 +03:00
Oleg Kalachev
4e4f02404f Disable glossary links 2018-08-10 17:50:39 +03:00
Oleg Kalachev
42c942514f docs: add glossary 2018-08-10 17:27:38 +03:00
Oleg Kalachev
a6b0ac43e9 docs: small fixes 2018-08-10 01:21:43 +03:00
Oleg Kalachev
0893eb85bc docs: add some info on ROS 2018-08-10 01:17:48 +03:00
Oleg Kalachev
e817e3c7a5 docs: add some links 2018-08-10 00:39:27 +03:00
Oleg Kalachev
32f98fa70e docs: small fixes 2018-08-09 23:25:44 +03:00
Oleg Kalachev
66bdffc747 docs: add some info about MAVLink protocol 2018-08-09 22:59:45 +03:00
Oleg Kalachev
5d353125d2 docs: add some useful snippets 2018-08-09 22:59:45 +03:00
Smirnov Artem
7f2d4344e3 image_builder: fix doc 2018-08-09 13:18:57 +03:00
Oleg Kalachev
4736871524 rc: todo 2018-08-09 03:48:38 +03:00
Oleg Kalachev
bcd88d6d4d rc: fix low battery notification throttling 2018-08-09 03:48:21 +03:00
Oleg Kalachev
8ffe74b772 selfcheck: some todos 2018-08-06 20:33:12 +03:00
Oleg Kalachev
57ae4c304f Add experimental selfcheck node 2018-08-06 20:28:46 +03:00
Smirnov Artem
8be77ab7d9 image_builder: don't remove build-dir in catkin_ws 2018-08-06 16:56:19 +03:00
Oleg Kalachev
8c193b913f docs: fix params files links 2018-08-06 14:36:13 +03:00
Oleg Kalachev
4fac517a1e rc: fake GCS heartbeats to make PX4 send STATUSTEXT messages 2018-08-06 01:59:14 +03:00
Oleg Kalachev
4f7061351f rc: update clever logo 2018-08-02 20:29:29 +03:00
Oleg Kalachev
decc5ecae6 Force gitbook update 2018-07-31 14:01:01 +03:00
Oleg Kalachev
f06fae6885 docs: add link to App Store (RC) 2018-07-31 13:52:44 +03:00
Artem Smirnov
8d46f51c66 image_builder: add service symlink to /lib/systemd/system 2018-07-27 13:23:02 +03:00
Oleg Kalachev
601ef0848d rc: use /mavros/statustext/recv topic for STATUSTEXT messages 2018-07-25 23:01:52 +03:00
Oleg Kalachev
3b0dd46ca6 Decrease conn/timeout to 8 seconds 2018-07-25 15:40:38 +03:00
Oleg Kalachev
16b2e1903a Fix udp and udp-b bridge settings 2018-07-25 15:40:38 +03:00
Smirnov Artem
36d7a95d34 Merge pull request #58 from urpylka/rm_mount_point
image_builder: fix pack 4
2018-07-25 14:33:11 +04:00
Artem Smirnov
1d82e195ec image_builder: add checkout to GWBT_REF 2018-07-25 12:55:18 +03:00
Artem Smirnov
78cae0c69a image_builder: fix vars syntax 2018-07-25 12:55:18 +03:00
Oleg Kalachev
2b46ee27f2 docs: small fix 2018-07-25 12:26:43 +03:00
Oleg Kalachev
de44400749 Merge branch 'master' of github.com:CopterExpress/clever 2018-07-25 12:01:47 +03:00
Oleg Kalachev
55e40bd6c3 docs: add mobile rc page [wip] 2018-07-25 12:01:38 +03:00
Artem Smirnov
124950d7e4 image_builder: remove MOUNT_POINT
I changed CONST-PATH to dynamic dir by mktemp
2018-07-24 19:05:04 +03:00
Smirnov Artem
199104ca83 Merge pull request #57 from urpylka/master
image_builder: fix pack
2018-07-24 16:33:19 +04:00
Artem Smirnov
e5552e0a4b image_builder: replace old archive 2018-07-24 15:16:56 +03:00
Oleg Kalachev
bfb0aa7961 Force gitbook update 2018-07-16 23:34:00 +03:00
Smirnov Artem
44d83bdcf8 Merge pull request #56 from Yuliya1404/master
added description of project and links to telegtam chats
2018-07-11 22:41:12 +03:00
Yuliya1404
d960e57cf9 docs: small fix 2018-07-11 15:47:38 +03:00
Yuliya1404
30ec03ef4d docs: added description of project and links on telegram chat 2018-07-11 15:28:34 +03:00
Smirnov Artem
c2c27b1577 docs: added build status icon 2018-07-08 15:09:51 +03:00
Oleg Kalachev
c0449ccf59 docs update 2018-07-07 17:58:33 +03:00
Oleg Kalachev
ea933ce3d1 docs: small fix 2018-07-07 17:57:02 +03:00
Oleg Kalachev
327666385b docs: small fix 2018-07-07 17:55:54 +03:00
Oleg Kalachev
8ea511b293 docs: firmware.md fixes 2018-07-07 17:54:09 +03:00
Oleg Kalachev
c510fe5cf0 Merge branch 'master' of github.com:CopterExpress/clever 2018-07-07 17:50:47 +03:00
Oleg Kalachev
dab70937f5 docs: add article about px4 firmware uploading 2018-07-07 17:50:42 +03:00
Smirnov Artem
fec4859cfe image_builder: enable the lirc-rpi module for uart 2018-07-06 22:10:58 +03:00
Oleg Kalachev
63ecc3b713 image: fix libpoco-dev version 2018-07-06 22:02:53 +03:00
Oleg Kalachev
d3a08c60d7 Merge pull request #54 from Yuliya1404/master
docs: changed metod materials
2018-07-06 17:25:51 +03:00
Oleg Kalachev
322eb1e255 image: add tcpdump and libpoco-dev 2018-07-06 04:37:00 +03:00
Oleg Kalachev
22d4f3c3e7 docs: small fixes 2018-07-05 03:07:52 +03:00
Oleg Kalachev
008750b1d9 docs: add systemd/roslaunch documentation 2018-07-05 03:03:16 +03:00
Oleg Kalachev
506767f32f docs: add some info to gps article 2018-07-05 02:50:45 +03:00
Oleg Kalachev
aaa673de92 simple_offboard: add global alt to get_telemetry service 2018-07-05 02:50:35 +03:00
Oleg Kalachev
43237d8ff4 GCS bridges config and documentation improvements 2018-07-05 02:10:53 +03:00
Oleg Kalachev
9681fc9a87 Merge branch 'master' of github.com:CopterExpress/clever 2018-07-04 20:29:45 +03:00
Oleg Kalachev
76c3e96f76 Enable mavros respawn by default 2018-07-04 20:26:47 +03:00
shish1404
1e66afa6a4 docs: changed test 2018-06-29 22:14:46 +03:00
shish1404
41c59e8e49 docs: added videos 2018-06-29 18:49:22 +03:00
shish1404
225e3d7936 docs: changed label 2018-06-29 18:48:53 +03:00
Artem Smirnov
204dd97b00 image_builder: remove date from image name 2018-06-26 19:49:42 +03:00
Artem Smirnov
27bfecc737 image_builder: add information about new partitions 2018-06-25 19:33:11 +03:00
Smirnov Artem
8cdb131a19 Merge pull request #53 from urpylka/master
image_builder: fix pack
2018-06-25 14:53:51 +03:00
Artem Smirnov
c9042588f0 image_builder: enable shrinker by default 2018-06-25 13:28:44 +03:00
Oleg Kalachev
342eaec49a gitbook: fix ya-metrika 2018-06-25 03:13:17 +03:00
Oleg Kalachev
77b3d28e3b gitbook: add ya-metrika 2018-06-25 03:00:04 +03:00
Smirnov Artem
357b38b5e7 image_builder: add text for /etc/fstab 2018-06-23 21:12:06 +03:00
Artem Smirnov
a99a1c7540 image_builder: change PARTUUID to /dev/mmcblk0p2 2018-06-23 20:44:30 +03:00
Artem Smirnov
6742ba332a image_builder: add fixed version for deb-packages 2018-06-22 15:31:26 +03:00
Smirnov Artem
c5916fea7c Merge pull request #52 from urpylka/master
image_builder fix-pack
2018-06-21 23:44:08 +03:00
Smirnov Artem
7a4958f8e9 Merge branch 'master' into master 2018-06-21 23:43:35 +03:00
Artem Smirnov
b71a96faee image_builder: add param for discover packages 2018-06-21 21:54:47 +03:00
Artem Smirnov
24e79f0169 image_builder: add autosizer.sh to build.Jenkinsfile 2018-06-21 18:24:02 +03:00
Artem Smirnov
76e887407a image_builder: add argument for set FREE SPACE 2018-06-21 18:24:02 +03:00
Artem Smirnov
0d0c8e54f4 image_builder: add image-shrinker 2018-06-21 18:24:02 +03:00
Artem Smirnov
06a01f7e32 image_builder: return devel dir to catkin_ws
needed for roscd
2018-06-21 18:24:02 +03:00
Artem Smirnov
f564d20c5b image_builder: add fixed rosinstall file 2018-06-21 18:24:02 +03:00
Artem Smirnov
85afded6b4 image_builder: move install mjpg-streamer to soft-install 2018-06-19 15:51:26 +03:00
Artem Smirnov
7e84853c37 image_builder: small echo fix 2018-06-19 13:39:37 +03:00
Artem Smirnov
c3c324158f image_builder: fix for add environment 2018-06-18 20:51:29 +03:00
Artem Smirnov
1e2fd40c05 image_builder: remove build & devel dirs 2018-06-18 20:42:47 +03:00
Artem Smirnov
6a7f78a218 image_builder: add "yes" flag 2018-06-18 20:42:47 +03:00
Smirnov Artem
0b637e56d7 image_builder: change param to const 2018-06-18 20:42:47 +03:00
Artem Smirnov
63f44a5a3f image_builder: remove unused code from image_config.sh 2018-06-18 20:42:47 +03:00
Artem Smirnov
83ce14e31b image_builder: merge arguments in resize_fs 2018-06-18 20:42:47 +03:00
Artem Smirnov
8162357ce6 image_builder: catkin_init_workspace not needed 2018-06-18 20:42:47 +03:00
Oleg Kalachev
ba0e9cf9c5 Change udp connection timeout to 10 2018-06-18 19:40:34 +03:00
Oleg Kalachev
8d1072d97d docs: add info about virtual joustick in qgroundcontrol 2018-06-14 02:04:22 +03:00
Oleg Kalachev
ffd4fdf2dc docs: add illustration to listener command usage 2018-06-14 01:01:17 +03:00
Oleg Kalachev
d279f04a1f docs: more 2018-06-13 16:39:48 +03:00
Oleg Kalachev
77e8c858a0 docs: another fixes 2018-06-13 16:34:57 +03:00
Oleg Kalachev
f6edf15011 docs: little fixes 2018-06-13 16:33:52 +03:00
Oleg Kalachev
b50c34b19c docs: add flight logs article 2018-06-13 16:29:55 +03:00
Oleg Kalachev
874f206e2a Somes fixes to iOS app 2018-06-09 20:33:40 +03:00
Oleg Kalachev
fd262fdb6a Add .editorconfig 2018-06-09 20:26:18 +03:00
Oleg Kalachev
2cb17985d4 Merge branch 'master' of github.com:CopterExpress/clever 2018-06-09 19:21:11 +03:00
Oleg Kalachev
2daa6f108a Update to iOS app 2018-06-09 16:12:57 +03:00
Oleg Kalachev
2e0d92c0d5 image: restore .vimrc 2018-06-09 03:41:41 +03:00
Oleg Kalachev
1a0d61af7c docs: small fixes 2018-06-09 02:28:45 +03:00
Oleg Kalachev
eb9fc6140b Merge branch 'master' of github.com:CopterExpress/clever 2018-06-08 20:14:43 +03:00
Oleg Kalachev
b0d72030fa docs: working on rc docs 2018-06-08 20:13:42 +03:00
Oleg Kalachev
db27d422ae docs: working on rc docs 2018-06-08 20:06:44 +03:00
Oleg Kalachev
d6ec597fe2 docs: working on rc docs 2018-06-08 00:52:12 +03:00
Oleg Kalachev
0fe319f430 Set udp bridge connection timeout to 20 2018-06-06 18:17:24 +03:00
Oleg Kalachev
2616b49e82 Merge branch 'master' of github.com:CopterExpress/clever 2018-06-06 18:09:47 +03:00
Oleg Kalachev
c2fd26db56 Support mavros udp-pb bridge 2018-06-06 18:09:38 +03:00
Artem Smirnov
71bd59fe3d image_builder: change "catkin init" to "catkin_init_workspace" 2018-06-05 17:41:38 +03:00
Oleg Kalachev
5b84fe63dd docs: remove disquss 2018-06-03 15:11:24 +03:00
Smirnov Artem
40782063c4 image_builder: Added GWBT_URL parameter
Added GWBT_URL parameter for automatic insert that to field on manual run of build
2018-06-02 14:55:53 +03:00
Smirnov Artem
580eb2400c docs: update wifi.md 2018-05-31 17:12:15 +03:00
Smirnov Artem
4666e443cb Update microsd_images.md 2018-05-31 16:54:41 +03:00
Smirnov Artem
d52c1701e4 Merge pull request #49 from urpylka/wifi_doc
docs: add network & wifi conf
2018-05-31 16:24:50 +03:00
Smirnov Artem
4a543c75f7 image_builder: use dnsmasq as default dhcp-server (#48) 2018-05-31 16:22:45 +03:00
Smirnov Artem
0b15f4ffd5 Update network.md 2018-05-31 16:16:06 +03:00
Oleg Kalachev
0f6e24d07f Changes to network.md 2018-05-31 16:15:51 +03:00
Artem Smirnov
7110ef1420 docs: add network & wifi conf 2018-05-31 16:04:35 +03:00
Oleg Kalachev
a56cef65d5 docs: modes changes 2018-05-30 16:35:09 +03:00
Oleg Kalachev
f58be1ff6f docs: small change 2018-05-30 16:11:07 +03:00
Oleg Kalachev
b1a788864c docs: some styling 2018-05-30 16:09:06 +03:00
Oleg Kalachev
fe468d911b docs: small change 2018-05-30 16:05:45 +03:00
Oleg Kalachev
ef8e1c0478 docs: some styling 2018-05-30 16:04:14 +03:00
Oleg Kalachev
710c4fb33e docs: add some units 2018-05-30 15:56:18 +03:00
Oleg Kalachev
3ef8656bcd docs: add link to px4 releases page 2018-05-30 15:50:53 +03:00
Oleg Kalachev
251e15f503 docs: add some units 2018-05-30 15:44:03 +03:00
Smirnov Artem
eb2f9d9c2b docs: add UDP support to GCS-bridge (#47) 2018-05-18 18:12:54 +03:00
Oleg Kalachev
dfcd3ea693 Merge branch 'master' of github.com:CopterExpress/clever 2018-05-13 23:01:14 +03:00
Oleg Kalachev
7260128dfd docs: note about yaw=NaN 2018-05-13 23:01:06 +03:00
Oleg Kalachev
d4e783c96f snippets: get_distance_global 2018-05-13 20:10:41 +03:00
Oleg Kalachev
c57a342053 Fix to readme 2018-05-12 17:03:25 +03:00
Oleg Kalachev
9ed9af2d04 Some fixes to readme 2018-05-12 17:02:48 +03:00
Oleg Kalachev
295b9c98d1 docs: rework images article 2018-05-12 16:58:54 +03:00
Oleg Kalachev
8f4de0e08f Merge branch 'master' of github.com:CopterExpress/clever 2018-05-10 22:33:16 +03:00
Oleg Kalachev
8f53301b79 simple_offboard: correct axes for calculating yaw for setpoints 2018-05-10 22:32:45 +03:00
Oleg Kalachev
6372ef8c22 simple_offboard: Tait-Bryan z-y-x angles for pitch, roll and yaw 2018-05-10 22:31:56 +03:00
Oleg Kalachev
a91f9e5a6b Change image size to from 8G to 7G 2018-05-10 16:40:05 +03:00
Oleg Kalachev
6b74f75616 Merge branch 'master' of github.com:CopterExpress/clever 2018-05-09 19:50:46 +03:00
Oleg Kalachev
9cd9babb83 simple_offboard: yaw_rate, pitch_rate, roll_rate in get_telemetry 2018-05-09 19:50:18 +03:00
Smirnov Artem
380c14da56 image_buider: enable hardware uart with raspi-config (#43)
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-05-05 20:36:22 +03:00
urpylka
32c1c18af2 image_builder: fix syntax
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-05-05 16:50:36 +03:00
urpylka
b7077339a1 image_builder: add sha256sum to release message
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-05-03 22:33:57 +03:00
urpylka
52fd505ffc image_builder: change spaces
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-05-03 22:33:57 +03:00
urpylka
b911b7a3dd image_builder: fix syntax
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-05-03 22:01:29 +03:00
Smirnov Artem
9b38d5135e image_builder: fix small mistake 2018-04-27 20:14:33 +03:00
Smirnov Artem
0346c48546 Merge pull request #39 from CopterExpress/image_builder_refactor_23042018
Image builder refactor 23042018
2018-04-27 13:49:16 +03:00
urpylka
212c6ca5ac image_config: fix output debug 2018-04-27 13:42:12 +03:00
urpylka
361c89d016 image_config: little fix & add more debug output 2018-04-27 13:35:32 +03:00
urpylka
b0cbc67799 image_config: add debug output 2018-04-27 13:26:28 +03:00
urpylka
18cfb08054 image_builder: fix comment 2018-04-26 23:43:55 +03:00
Smirnov Artem
66121e6d5d Rename jenkinsfile to Jenkinsfile 2018-04-26 23:41:30 +03:00
urpylka
a4841de17e image_builder: try fix with send big string as argument
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-26 23:37:37 +03:00
Oleg Kalachev
84aef97e37 docs: fixes 2018-04-26 00:11:20 +03:00
Oleg Kalachev
f14e1976e7 docs: fix 2018-04-26 00:10:20 +03:00
Oleg Kalachev
8c9acc98fb docs: qr example 2018-04-26 00:09:12 +03:00
Oleg Kalachev
bd36428bd4 docs: typo 2018-04-25 23:24:44 +03:00
urpylka
7f7276e34a image_builder: fix bug with GH credentials after parsing json
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 22:24:02 +03:00
urpylka
460761ef68 image_builder: fix small bug
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 21:27:12 +03:00
urpylka
9fefc6428e image_builder: fix small bugs
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 21:09:42 +03:00
urpylka
ffe4423c10 docs: remove duplicates after merge
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 20:46:16 +03:00
Smirnov Artem
3f02919cd9 Merge pull request #36 from Yuliya1404/master
Updated assemble and lessons
2018-04-24 20:19:48 +03:00
Yuliya1404
3075badf33 docs: update lessons & assemble article
* Update tb.md

* Update testConnection.md

* Update safety.md

* Delete brrc2205ondeck.png

* Add files via upload

* Create connectortypes.md

* Add files via upload

* Update connectortypes.md

* Update assemble.md

* Add files via upload

* Create metod.md

* Update metodmaterials.md

* Create tests.md

* Update SUMMARY.md

* Create lessons.md

* Update lessons.md
2018-04-24 20:06:20 +03:00
urpylka
29d66ee264 image_builder: add readme-file about builder
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
846ec3a430 image_builder: made absolute path in jenkinsfile
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
a65a50ffd3 image_builder: change ini to json in yadisk.py
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
c945bb9d03 image_builder: made var YA_SCRIPT
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
3dc9575c9e image_builder: refactor comment
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
f901167009 image_builder: replace ini to json, requests to curl
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
8519a6c6a4 image_builder: refactor path to execute-files
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
d8fc2c088f image_builder: fix bag with switch-case order in bash
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
679cd37ec6 image_builder: fix bag with IMAGE_VERSION
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
40be77f9c3 image_builder: refactor publish_image functions
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
1a0d762c4e image_builder: hardware configure by raspi-config
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
a7e0032225 image_builder: fix syntax
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
0b9df02faa image_builder: translate couple comments
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:03 +03:00
urpylka
0dcf7d1520 image_builder: remove not used code
Signed-off-by: Artem Smirnov <urpylka@gmail.com>
2018-04-24 19:02:02 +03:00
Smirnov Artem
b146057ca7 Merge pull request #35 from Svetk0/Svetk0-setup
docs: update
2018-04-24 19:01:01 +03:00
urpylka
2628d912cd image_builder: refactor 2018-04-16 21:24:03 +03:00
Oleg Kalachev
2e75d531a6 docs: small fix 2018-04-12 21:54:09 +03:00
Oleg Kalachev
be7607bc17 docs: small fix 2018-04-12 20:36:43 +03:00
Oleg Kalachev
5bd724141e docs: redice rc switch snippet + coding note 2018-04-12 20:34:46 +03:00
Oleg Kalachev
7b5538c104 docs: circle snippet 2018-04-12 20:20:26 +03:00
Oleg Kalachev
462e7d6ffe docs: angle to horizon 2018-04-12 18:38:34 +03:00
Svetk0
68a32e036e Rename calibratePID to calibratePID.md 2018-04-12 17:09:10 +03:00
Svetk0
dba5b63230 Update setup.md 2018-04-12 17:08:16 +03:00
Svetk0
26efccb110 Add files via upload 2018-04-12 17:06:10 +03:00
Svetk0
e0516663aa Create calibratePID 2018-04-12 17:05:45 +03:00
Svetk0
d737d91bc2 Update setup.md 2018-04-12 16:57:43 +03:00
Svetk0
1b10d59188 Add files via upload 2018-04-12 16:57:01 +03:00
Svetk0
a9ca13c55d Update setup.md 2018-04-12 16:34:45 +03:00
Svetk0
57fbe9cc09 Update setup.md 2018-04-12 14:57:35 +03:00
Svetk0
061b225690 Update setup.md 2018-04-12 14:55:20 +03:00
Svetk0
27189d559a Update setup.md 2018-04-12 12:52:56 +03:00
Oleg Kalachev
d9e0c94797 mavros.launch: change imu frame_id to fcu 2018-04-07 02:12:21 +03:00
Oleg Kalachev
e2e719a12e Merge branch 'master' of github.com:CopterExpress/clever 2018-04-06 22:44:56 +03:00
Oleg Kalachev
52ec97f11f mavros.launch: respawn argument 2018-04-06 22:43:28 +03:00
Arthur Golubtsov
d094386c4d Made some corrections 2018-04-06 18:57:26 +03:00
Arthur Golubtsov
515777bd96 Added pexample how to run program with remote control 2018-04-05 03:31:30 +03:00
Arthur Golubtsov
d56d0dfaaf Corrected picture names and minor changed the article 2018-04-04 21:58:32 +03:00
Svetk0
60b22d0df8 Create safety_assem.md 2018-03-28 12:45:55 +03:00
Svetk0
0072bf8330 Update SUMMARY.md 2018-03-28 12:45:49 +03:00
Svetk0
f36b4546a9 Create mount_antenna.md 2018-03-28 12:43:50 +03:00
Svetk0
c0a97fd263 Update SUMMARY.md 2018-03-28 12:42:22 +03:00
Svetk0
46932e4adf Rename mount_battcase.md to mount_batterycase.md 2018-03-28 12:41:55 +03:00
Svetk0
0c2675ec28 Update and rename mount_batterycase.md to prepare_batterycase.md 2018-03-28 12:40:22 +03:00
Svetk0
f4e5d7978a Update SUMMARY.md 2018-03-28 12:39:43 +03:00
Svetk0
cc7ba566c5 Create mount_battcase.md 2018-03-28 12:39:37 +03:00
Svetk0
d47e3f6bbf Create mount_frame.md 2018-03-28 12:37:56 +03:00
Svetk0
2335c74b55 Create mount_esc.md 2018-03-28 12:34:01 +03:00
Svetk0
ca4bab7bf8 Create mount_pixhawk.md 2018-03-28 12:32:56 +03:00
Svetk0
d4d84ea422 Update SUMMARY.md 2018-03-28 12:31:26 +03:00
Svetk0
f985e07be4 Create mount_receiver.md 2018-03-28 12:28:52 +03:00
Svetk0
bab62cf374 Update SUMMARY.md 2018-03-28 12:24:42 +03:00
Svetk0
4eb988c34d Create test_motors.md 2018-03-28 12:24:37 +03:00
Svetk0
3006d7e32e Create binding.md 2018-03-28 12:23:06 +03:00
Svetk0
3e9b7426bf Create soldering_power.md 2018-03-28 12:21:03 +03:00
Svetk0
e8f93782e0 Create mount_elements.md 2018-03-28 12:19:32 +03:00
Oleg Kalachev
839a8b4102 Fix link in readme 2018-03-28 03:54:36 +03:00
Oleg Kalachev
89a1b81ea2 docs: fix lessons file names 2018-03-27 19:49:52 +03:00
Oleg Kalachev
6306af3c4a Merge pull request #31 from Yuliya1404/master
Changed the numbers of lessons (#1)
2018-03-27 19:08:28 +03:00
Svetk0
910b24c460 Update SUMMARY.md 2018-03-27 17:55:22 +03:00
Svetk0
5dc580c76b Create mount_batterycase.md 2018-03-27 17:55:12 +03:00
Svetk0
c0705222f5 Create mount_connector.md 2018-03-27 17:54:06 +03:00
Svetk0
b51e8add55 Create mount_pdb.md 2018-03-27 17:53:24 +03:00
Yuliya1404
873785bb53 Changed the numbers of lessons (#1)
* Rename les1.md to lesson1.md

* Update lesson1.md

* Rename les2.md to lesson2.md

* Update and rename les4.md to lesson3.md

* Update and rename les7.md to lesson4.md

* Update and rename les8.md to lesson5.md

* Update and rename les11.md to lesson6.md

* Update and rename lesson6.md to lesson7.md

* Update and rename lesson5.md to lesson6.md

* Update and rename les9.md to lesson5.md

* Update and rename les13.md to lesson8.md

* Update and rename les15.md to lesson9.md

* Update and rename les16.md to lesson10.md
2018-03-27 17:48:55 +03:00
Svetk0
86211df4b3 Create kit.md 2018-03-27 17:18:19 +03:00
Svetk0
5ef5c6b641 Create mount_motors.md 2018-03-27 17:16:53 +03:00
Svetk0
5b96253146 Update SUMMARY.md 2018-03-27 17:14:30 +03:00
Svetk0
54111504ac Update SUMMARY.md 2018-03-27 17:05:53 +03:00
Oleg Kalachev
bc2a2895e0 docs: rename LED article filename 2018-03-27 02:15:07 +03:00
Oleg Kalachev
80833486cd Merge branch 'master' of github.com:CopterExpress/clever 2018-03-27 02:13:11 +03:00
Oleg Kalachev
e92c59bf25 docs: add info about inline aruco generator 2018-03-27 02:13:00 +03:00
goldarte
d511b2f65c Updates docs/rabota-so-svetodiodnoi-lentoi.md
Auto commit by GitBook Editor
2018-03-26 07:38:46 +00:00
Oleg Kalachev
921785c29d image: vim settings 2018-03-25 20:18:07 +03:00
Oleg Kalachev
1db42fd268 image: add tcpdump 2018-03-25 20:15:10 +03:00
Oleg Kalachev
6313cc8135 image: add libpoco 2018-03-25 19:54:30 +03:00
Oleg Kalachev
7abf7de71b docs: add info about yaw=nan 2018-03-23 15:55:04 +03:00
Oleg Kalachev
c5628cecc0 aruco_pose: publish debug image even where there is no board 2018-03-22 23:33:50 +03:00
Oleg Kalachev
5212d3bfe5 simple_offboard: PEP-8 + fixes 2018-03-19 23:27:44 +03:00
Oleg Kalachev
bed317a05b simple_offboard: warn no local position in /navigate 2018-03-19 23:06:40 +03:00
Oleg Kalachev
7644e29f71 docs: small fixes 2018-03-19 22:14:03 +03:00
Oleg Kalachev
3245d5fcf5 docs: fix example 2018-03-19 21:33:54 +03:00
Oleg Kalachev
9dbce4d08b docs: link to the reference of the old simple_offboard version 2018-03-19 21:25:29 +03:00
Oleg Kalachev
84a046ce82 gitbook: simple_offboard documentation improvements 2018-03-19 21:11:50 +03:00
Oleg Kalachev
d5c5a8723a Merge branch 'master' into simple-offboard-refactored 2018-03-19 20:45:20 +03:00
Oleg Kalachev
67051b21a0 Merge branch 'master' of github.com:CopterExpress/clever 2018-03-19 17:38:17 +03:00
Oleg Kalachev
f646f003c1 Update Clever 3 image 2018-03-19 17:37:55 +03:00
Andrei Korigodski
ad1a3925ff README: fix style 2018-03-19 15:13:44 +03:00
Oleg Kalachev
5ae686ac5f Clever 3 image 2018-03-19 14:47:13 +03:00
Oleg Kalachev
6a1429c2eb Fix readme 2018-03-19 14:37:08 +03:00
Oleg Kalachev
4645c0bc13 gitbook: transfer assets folder to /docs 2018-03-19 14:34:29 +03:00
Oleg Kalachev
51e5fa3b03 gitbook: fixing 2018-03-19 14:21:31 +03:00
Oleg Kalachev
c3ff38a310 gitbook: fix intro name 2018-03-19 14:18:16 +03:00
Oleg Kalachev
a547aacfa9 Transfer gitbook documentation to docs/ 2018-03-19 14:15:49 +03:00
Oleg Kalachev
06fc6ceeb6 Link to github 2018-03-19 14:04:34 +03:00
Oleg Kalachev
e8c3153ff5 Fix gitbook 2018-03-19 14:01:35 +03:00
Oleg Kalachev
84ac98cfe1 Merge pull request #28 from CopterExpress/english-readme
README: translate to English
2018-03-19 13:49:15 +03:00
Oleg Kalachev
9579342e95 Restore Russian intro 2018-03-19 13:48:35 +03:00
Andrei Korigodski
04ed4996e7 README: translate to English 2018-03-18 19:22:22 +03:00
Oleg Kalachev
f22b4cd39a docs: fix 2018-03-17 20:46:28 +03:00
Oleg Kalachev
4d2ea5478d Update docs 2018-03-15 21:56:03 +03:00
Oleg Kalachev
8ca722165a Add udp-b documentation 2018-03-15 21:53:41 +03:00
Oleg Kalachev
88a14a753e Add udp-b gcs type 2018-03-15 21:50:49 +03:00
urpylka
01bc387134 Fix: syntax
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-15 20:13:38 +03:00
urpylka
c692f4d393 Fix: 'echo -e' to 'echo' for execute in /bin/sh
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-15 19:09:23 +03:00
urpylka
fe9df2c34f Fix: syntax
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-15 19:09:14 +03:00
urpylka
a1968467de Add: zip & unzip to install
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-10 18:03:49 +04:00
urpylka
875698c926 Remove: assimp from install
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-10 18:03:33 +04:00
urpylka
f035d37243 Add: set -e
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-10 18:02:59 +04:00
urpylka
3f7dec4d79 Fix: change bash to sh
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-10 18:02:05 +04:00
urpylka
3d59c78ad8 Add: environment variables for sh scripts
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-10 17:59:15 +04:00
urpylka
d6b664e2f6 Add: united Jenkinsfile-release with image-config.sh functions
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-09 17:47:59 +04:00
urpylka
a387783287 Add: new structure of jobs Jenkins CI
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-09 17:47:59 +04:00
urpylka
a2d610133a Add: debug message of seven arg
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-09 17:47:59 +04:00
urpylka
62fb15e58f Add: debug message after uploads
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-09 17:47:59 +04:00
urpylka
05c22bb839 Fix: replace $JENKINS_HOME to $BUILD_DIRECTORY
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-09 17:47:59 +04:00
urpylka
08eae11f25 Fix: replace single quotes to double quotes
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-09 17:47:59 +04:00
urpylka
fb90bc8c1f Fix: remove duplicated agent
Signed-off-by: urpylka <urpylka@gmail.com>
2018-03-09 17:47:59 +04:00
urpylka
0c275dce98 Fix: change BUID to BUILD 2018-03-09 16:31:46 +04:00
Oleg Kalachev
97b8eb435a simple_offboard: refactor api, remove */yaw_rate services 2018-03-09 02:28:52 +03:00
goldarte
7ebc57b659 Updates docs/rabota-so-svetodiodnoi-lentoi.md
Auto commit by GitBook Editor
2018-03-06 20:54:13 +00:00
goldarte
2036e7e3ec Updates docs/rabota-so-svetodiodnoi-lentoi.md
Auto commit by GitBook Editor
2018-03-06 20:48:53 +00:00
Oleg Kalachev
bf054ef9f5 docs: comma 2018-03-06 04:05:07 +03:00
Oleg Kalachev
26e67edafe docs: small addition 2018-03-06 04:03:49 +03:00
Oleg Kalachev
5ab31f5133 gitbook: versions plugin added 2018-03-06 03:34:03 +03:00
Oleg Kalachev
2ec6930099 aruco_pose: undocumented possibility to set custom markers board
parameters:
~type=custom
~markers
2018-03-06 02:40:35 +03:00
Oleg Kalachev
4aa8f3f5dc docs fixes 2018-03-06 01:06:55 +03:00
Oleg Kalachev
2506c8420f simple_offboard: /navigate_global service 2018-03-06 01:01:59 +03:00
Oleg Kalachev
90a04c04d2 aruco_vpe/reset_timeout parameter added 2018-03-05 22:59:04 +03:00
Oleg Kalachev
48c800fd5a Fixes 2018-03-05 22:27:08 +03:00
Oleg Kalachev
dafce44c0a simple_offboard: /land service added (set copter’s mode to AUTO.LAND) 2018-03-05 22:24:56 +03:00
Oleg Kalachev
a70885ad18 Small fix 2018-03-05 22:04:18 +03:00
Oleg Kalachev
b5110d9df3 simple_offboard: rospy.sleep to some while’s added 2018-03-05 21:58:48 +03:00
Oleg Kalachev
1391ffa2a5 simple_offboard/local_frame parameter for configuring local origin frame name 2018-03-05 21:54:19 +03:00
Oleg Kalachev
ce8b52f684 Merge branch 'master' of github.com:CopterExpress/clever 2018-03-05 21:43:54 +03:00
Oleg Kalachev
0256deef66 Experimental simple_offboard/navigate_after_armed parameter
If this parameter is on, /navigate service waits until copter is armed, before starts to move the position setpoint
2018-03-05 21:42:48 +03:00
Oleg Kalachev
f05a47d636 Merge pull request #25 from CopterExpress/add-license-1
Create LICENSE.md
2018-03-03 14:13:47 +03:00
Oleg Kalachev
db4d84e1c0 Create LICENSE.md 2018-03-03 14:11:49 +03:00
Arthur Golubtsov
adfde391ab Merge 512b4c2e09 into master 2018-02-27 22:25:52 +03:00
goldarte
512b4c2e09 Updates docs/aruco.md
Auto commit by GitBook Editor
2018-02-27 19:34:50 +00:00
Arthur Golubtsov
e56143c508 Upload param file for Clever 2 with LPE 2018-02-27 22:25:52 +03:00
Arthur Golubtsov
f9aa441ce8 Upload param file for Clever 3 with LPE
for 1.7.0 firmware with LPE
2018-02-27 22:17:46 +03:00
Smirnov Artem
37e0185d25 Fix: Delete empty file 2018-02-27 19:04:03 +03:00
Smirnov Artem
29070efc06 Fix: Syntax 2018-02-27 19:02:39 +03:00
Oleg Kalachev
3ddd37b843 Updates docs/arduino.md
Auto commit by GitBook Editor
2018-02-27 16:55:00 +03:00
Oleg Kalachev
409b603530 Updates docs/arduino.md
Auto commit by GitBook Editor
2018-02-27 12:38:28 +03:00
Oleg Kalachev
0458de2fb0 Updates docs/arduino.md
Auto commit by GitBook Editor
2018-02-26 16:58:14 +03:00
Oleg Kalachev
7c74ce3212 Updates docs/arduino.md
Auto commit by GitBook Editor
2018-02-26 16:52:06 +03:00
Oleg Kalachev
624162a3ec Conflict resolution 2018-02-26 15:33:13 +03:00
Oleg Kalachev
612b222887 Updates docs/arduino.md
Auto commit by GitBook Editor
2018-02-26 15:32:15 +03:00
Oleg Kalachev
d4efa58388 Merge branch 'master' of github.com:CopterExpress/clever 2018-02-22 02:45:17 +03:00
Oleg Kalachev
04ba342542 Add disqus comments for gitbook 2018-02-22 02:45:03 +03:00
Oleg Kalachev
3105ce109c Track 4 files into repository.
- untracked assets/timing_with_thumbs.png
- untracked docs/rabota-so-svetodiodnoi-lentoi.md
- untracked drugoe.md
- modified SUMMARY.md

Auto commit by GitBook Editor
2018-02-22 02:42:33 +03:00
Oleg Kalachev
757b829a17 Updates book.json
Auto commit by GitBook Editor
2018-02-22 02:41:37 +03:00
goldarte
ea16ef847e Updates docs/rabota-so-svetodiodnoi-lentoi.md
Auto commit by GitBook Editor
2018-02-21 23:33:37 +00:00
goldarte
294ccfe3f9 Creates assets/timing_with_thumbs.png
Auto commit by GitBook Editor
2018-02-21 23:01:36 +00:00
Oleg Kalachev
6ef5298b8b Updates docs/aruco.md
Auto commit by GitBook Editor
2018-02-22 01:48:28 +03:00
Oleg Kalachev
d31b41ed9e Updates docs/aruco.md
Auto commit by GitBook Editor
2018-02-22 01:48:07 +03:00
Oleg Kalachev
2100ca222c Updates docs/aruco.md
Auto commit by GitBook Editor
2018-02-22 01:46:41 +03:00
Oleg Kalachev
2dcb929089 Merge branch 'master' of github.com:CopterExpress/clever 2018-02-21 22:48:07 +03:00
Oleg Kalachev
7a95cbdf62 Track 3 files into repository.
- modified apps/ios/cleverrc/telemetry.js
- modified clever/launch/clever.launch
- modified clever/src/rc.cpp

Auto commit by GitBook Editor
2018-02-21 22:47:52 +03:00
Oleg Kalachev
1ab251af6a Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 22:12:23 +03:00
Oleg Kalachev
d1c5e847da mobile rc: add DROPPED to notifications blacklist 2018-02-21 21:48:52 +03:00
Oleg Kalachev
dc501bb2e6 Merge branch 'master' of github.com:CopterExpress/clever 2018-02-21 21:43:26 +03:00
Oleg Kalachev
e3e722a972 rc argument in clever.launch 2018-02-21 21:40:59 +03:00
Oleg Kalachev
f7b47afae7 mobile rc: publish initial /state_latched 2018-02-21 21:40:40 +03:00
Oleg Kalachev
74d1eeca24 mobile rc: blacklist for /rosout messages 2018-02-21 21:40:25 +03:00
Oleg Kalachev
fa8f5ba41e Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:33:03 +03:00
Oleg Kalachev
1ee279bc5a Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:32:37 +03:00
Oleg Kalachev
d724f93e36 Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:32:31 +03:00
Oleg Kalachev
96783c1ee2 Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:32:12 +03:00
Oleg Kalachev
db5c6d0865 Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:31:56 +03:00
Oleg Kalachev
5f6df5569e Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:30:19 +03:00
Oleg Kalachev
661a121d6f Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:29:46 +03:00
Oleg Kalachev
25856e4675 Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:29:34 +03:00
Oleg Kalachev
cedf3f8364 Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:22:14 +03:00
Oleg Kalachev
0a66d3f3e3 Updates docs/rc.md
Auto commit by GitBook Editor
2018-02-21 21:14:04 +03:00
Oleg Kalachev
10251c3c43 Set udp interface for iOS rc 2018-02-21 00:33:17 +03:00
Oleg Kalachev
3cd9973fc1 Fixes for RC 2018-02-20 23:38:32 +03:00
Oleg Kalachev
2c68dd1a31 Merge branch 'master' of github.com:CopterExpress/clever 2018-02-20 04:11:22 +03:00
Oleg Kalachev
34cfb3548a Mode "UNKNOWN" in /state_latched, when state is timed out 2018-02-20 04:11:12 +03:00
Oleg Kalachev
fc3e98bdc6 Updates docs/snippets.md
Auto commit by GitBook Editor
2018-02-19 22:26:49 +03:00
Oleg Kalachev
bb6226f420 Updates docs/snippets.md
Auto commit by GitBook Editor
2018-02-19 22:24:27 +03:00
Oleg Kalachev
79c4d0d128 Merge branch 'master' of github.com:CopterExpress/clever 2018-02-19 22:22:41 +03:00
Oleg Kalachev
571c12061e Track 411 files into repository.
- untracked .gitattributes
- untracked .gitignore
- untracked apps/ios/.gitignore
- untracked apps/ios/cleverrc.xcodeproj/project.pbxproj
- untracked apps/ios/cleverrc.xcodeproj/project.xcworkspace/contents.xcworkspacedata
- untracked apps/ios/cleverrc.xcworkspace/contents.xcworkspacedata
- untracked apps/ios/cleverrc/AppDelegate.swift
- untracked apps/ios/cleverrc/Assets.xcassets/AppIcon.appiconset/cleverios180-1.png
- untracked apps/ios/cleverrc/Assets.xcassets/AppIcon.appiconset/cleverios180.png
- untracked apps/ios/cleverrc/Assets.xcassets/AppIcon.appiconset/Contents.json
- untracked apps/ios/cleverrc/Assets.xcassets/Contents.json
- untracked apps/ios/cleverrc/Assets.xcassets/Image.imageset/Contents.json
- untracked apps/ios/cleverrc/Base.lproj/LaunchScreen.storyboard
- untracked apps/ios/cleverrc/Base.lproj/Main.storyboard
- untracked apps/ios/cleverrc/BinUtils.swift
- untracked apps/ios/cleverrc/clever.svg
- untracked apps/ios/cleverrc/index.html
- untracked apps/ios/cleverrc/Info.plist
- untracked apps/ios/cleverrc/main.css
- untracked apps/ios/cleverrc/main.js
- untracked apps/ios/cleverrc/README.md
- untracked apps/ios/cleverrc/roslib.js
- untracked apps/ios/cleverrc/telemetry.js
- untracked apps/ios/cleverrc/ViewController.swift
- untracked apps/ios/Podfile
- untracked apps/ios/Podfile.lock
- untracked apps/ios/README.md
- untracked aruco_pose/CMakeLists.txt
- untracked aruco_pose/nodelet_plugins.xml
- untracked aruco_pose/package.xml
- untracked aruco_pose/src/aruco_pose.cpp
- untracked aruco_pose/src/fix.cpp
- untracked assets/11_1.png
- untracked assets/11_2.png
- untracked assets/11_3.png
- untracked assets/11_4.png
- untracked assets/11_5.png
- untracked assets/13_1.png
- untracked assets/13_10.png
- untracked assets/13_11.png
- untracked assets/13_2.png
- untracked assets/13_3.jpg
- untracked assets/13_4.png
- untracked assets/13_5.png
- untracked assets/13_6.png
- untracked assets/13_7.png
- untracked assets/13_8.png
- untracked assets/13_9.png
- untracked assets/15_1.png
- untracked assets/15_2.png
- untracked assets/15_3.png
- untracked assets/15_4.png
- untracked assets/15_5.png
- untracked assets/15_6.png
- untracked assets/15_7.png
- untracked assets/16_1.png
- untracked assets/16_2.png
- untracked assets/16_3.png
- untracked assets/16_4.png
- untracked assets/1_1.png
- untracked assets/1_10.png
- untracked assets/1_11.png
- untracked assets/1_12.png
- untracked assets/1_13.png
- untracked assets/1_2.png
- untracked assets/1_3.png
- untracked assets/1_4.png
- untracked assets/1_5.png
- untracked assets/1_6.png
- untracked assets/1_7.png
- untracked assets/1_8.png
- untracked assets/1_9.png
- untracked assets/2_1.png
- untracked assets/2_2.png
- untracked assets/2_3.png
- untracked assets/2_4.png
- untracked assets/2_5.png
- untracked assets/2_6.png
- untracked assets/2_7.png
- untracked assets/2_8.png
- untracked assets/2_9.png
- untracked assets/4_1.png
- untracked assets/4_2.png
- untracked assets/4_3.png
- untracked assets/4_4.png
- untracked assets/4_5.png
- untracked assets/4_6.png
- untracked assets/7_1.png
- untracked assets/7_2.png
- untracked assets/7_3.png
- untracked assets/7_4.png
- untracked assets/8_1.png
- untracked assets/8_2.png
- untracked assets/8_3.png
- untracked assets/8_4.png
- untracked assets/8_5.png
- untracked assets/8_6.png
- untracked assets/9_1.png
- untracked assets/9_2.png
- untracked assets/addEqipment.jpg
- untracked assets/airframeSetup.jpg
- untracked assets/allElements.png
- untracked assets/attentionSave.jpg
- untracked assets/brrc2205.png
- untracked assets/brrc2205on.png
- untracked assets/brrc2205ondeck.png
- untracked assets/calibrateaxcel.jpg
- untracked assets/calibrateaxcelstart.jpg
- untracked assets/calibratecompass.jpg
- untracked assets/calibrateESC.jpg
- untracked assets/calibrategyro.jpg
- untracked assets/calibratePIDparams.jpg
- untracked assets/calibrateView.jpg
- untracked assets/calibrateViewStart.jpg
- untracked assets/casebattery.png
- untracked assets/chooseSwitch.jpg
- untracked assets/Clever main.png
- untracked assets/clever.jpg
- untracked assets/Clevermain.png
- untracked assets/connectBattery.png
- untracked assets/connectingRadio.png
- untracked assets/connectionESCtoReceiver.png
- untracked assets/connectionLost.jpg
- untracked assets/connectionOK.jpg
- untracked assets/connectionPixhawk.png
- untracked assets/consistofTransmitter.jpg
- untracked assets/cutwire14AWG.jpg
- untracked assets/escDYSzap.png
- untracked assets/escWires.png
- untracked assets/explosion.png
- untracked assets/firmwarePX4.jpg
- untracked assets/flightModes.jpg
- untracked assets/helphand.jpg
- untracked assets/holderLegs.png
- untracked assets/isoViewmountHolder.png
- untracked assets/jumper.png
- untracked assets/keep.png
- untracked assets/lockradio.jpg
- untracked assets/lockradio.png
- untracked assets/lowsafeDeck.png
- untracked assets/mainWindow.jpg
- untracked assets/motorsTopview.png
- untracked assets/mount5vconnector.png
- untracked assets/mountAntenna.png
- untracked assets/mountBeams.png
- untracked assets/mountBottomDeck.png
- untracked assets/mountHolder.png
- untracked assets/mountPDB.png
- untracked assets/mountReceiverDeck.png
- untracked assets/mountReceiverStud.png
- untracked assets/mountxt60pinsocket.png
- untracked assets/notmoveslider.jpg
- untracked assets/pixhawk.png
- untracked assets/radioTransmitter.png
- untracked assets/readyBatteryholder.png
- untracked assets/receiver5V.png
- untracked assets/receiverPPM.png
- untracked assets/resolderingESC.png
- untracked assets/safehighRadial.png
- untracked assets/safeLegs.png
- untracked assets/safelowRadial.png
- untracked assets/safetybyassem.png
- untracked assets/safetyINflight.png
- untracked assets/safetyPower.png
- untracked assets/safetyPreflight.png
- untracked assets/soldering5VTOpdb.png
- untracked assets/solderingBrrc2205ondeckTOescDYSzap.png
- untracked assets/solderingPowerwires.png
- untracked assets/solderingxt60socketTOpdb.png
- untracked assets/stand.jpg
- untracked assets/startPDBtest.jpg
- untracked assets/testMotors.png
- untracked assets/topESCcaseview.png
- untracked assets/topPreview.png
- untracked assets/topviewmountPDB.png
- untracked assets/topviewpixhawk.png
- untracked assets/turnoffSafetyswitch.jpg
- untracked assets/xt60pinsocket.jpg
- untracked assets/zap.jpg
- untracked assets/zapPDBtest.jpg
- untracked clever/camera_info/fisheye_cam_320.yaml
- untracked clever/camera_info/fisheye_cam_640.yaml
- untracked clever/CMakeLists.txt
- untracked clever/launch/arduino.launch
- untracked clever/launch/aruco.launch
- untracked clever/launch/clever.launch
- untracked clever/launch/copter_visualization.launch
- untracked clever/launch/fpv_camera.launch
- untracked clever/launch/main_camera.launch
- untracked clever/launch/mavros.launch
- untracked clever/launch/sitl.launch
- untracked clever/launch/web_server.launch
- untracked clever/nodelet_plugins.xml
- untracked clever/package.xml
- untracked clever/requirements.txt
- untracked clever/src/aruco_vpe.cpp
- untracked clever/src/fcu_horiz.cpp
- untracked clever/src/fpv_camera
- untracked clever/src/global_local.py
- untracked clever/src/rc.cpp
- untracked clever/src/simple_offboard.py
- untracked clever/src/util.h
- untracked clever/src/util.py
- untracked clever/src/web_server.py
- untracked clever/srv/GetTelemetry.srv
- untracked clever/srv/Navigate.srv
- untracked clever/srv/SetAttitude.srv
- untracked clever/srv/SetAttitudeYawRate.srv
- untracked clever/srv/SetPosition.srv
- untracked clever/srv/SetPositionGlobal.srv
- untracked clever/srv/SetPositionGlobalYawRate.srv
- untracked clever/srv/SetPositionYawRate.srv
- untracked clever/srv/SetRates.srv
- untracked clever/srv/SetRatesYaw.srv
- untracked clever/srv/SetVelocity.srv
- untracked clever/srv/SetVelocityYawRate.srv
- untracked deploy/clever.service
- untracked deploy/clever_arudino.tar.gz
- untracked deploy/generate_ros_lib
- untracked deploy/roscore.env
- untracked deploy/roscore.service
- modified docs/3g.md
- modified docs/assemble.md
- untracked docs/deck.md
- modified docs/etcher.md
- modified docs/frames.md
- modified docs/les1.md
- modified docs/les11.md
- modified docs/les13.md
- modified docs/les15.md
- modified docs/les16.md
- modified docs/les2.md
- modified docs/les4.md
- modified docs/les7.md
- modified docs/les8.md
- modified docs/les9.md
- modified docs/modes.md
- untracked docs/powerConnection.md
- modified docs/radioerrors.md
- modified docs/radioerrors1.md
- modified docs/safety.md
- modified docs/setup.md
- modified docs/simple_offboard.md
- modified docs/tb.md
- untracked docs/testConnection.md
- modified docs/wifi.md
- untracked docs/zap.md
- removed gpsmd.md
- untracked image/apps.sh
- untracked image/git_release.py
- untracked image/iface.sh
- untracked image/image-config.sh
- untracked image/Jenkinsfile
- untracked image/ros.sh
- untracked image/yadisk.py
- removed img/11_1.png
- removed img/11_2.png
- removed img/11_3.png
- removed img/11_4.png
- removed img/11_5.png
- removed img/13_1.png
- removed img/13_10.png
- removed img/13_11.png
- removed img/13_2.png
- removed img/13_3.jpg
- removed img/13_4.png
- removed img/13_5.png
- removed img/13_6.png
- removed img/13_7.png
- removed img/13_8.png
- removed img/13_9.png
- removed img/15_1.png
- removed img/15_2.png
- removed img/15_3.png
- removed img/15_4.png
- removed img/15_5.png
- removed img/15_6.png
- removed img/15_7.png
- removed img/16_1.png
- removed img/16_2.png
- removed img/16_3.png
- removed img/16_4.png
- removed img/1_1.png
- removed img/1_10.png
- removed img/1_11.png
- removed img/1_12.png
- removed img/1_13.png
- removed img/1_2.png
- removed img/1_3.png
- removed img/1_4.png
- removed img/1_5.png
- removed img/1_6.png
- removed img/1_7.png
- removed img/1_8.png
- removed img/1_9.png
- removed img/2_1.png
- removed img/2_2.png
- removed img/2_3.png
- removed img/2_4.png
- removed img/2_5.png
- removed img/2_6.png
- removed img/2_7.png
- removed img/2_8.png
- removed img/2_9.png
- removed img/4_1.png
- removed img/4_2.png
- removed img/4_3.png
- removed img/4_4.png
- removed img/4_5.png
- removed img/4_6.png
- removed img/7_1.png
- removed img/7_2.png
- removed img/7_3.png
- removed img/7_4.png
- removed img/8_1.png
- removed img/8_2.png
- removed img/8_3.png
- removed img/8_4.png
- removed img/8_5.png
- removed img/8_6.png
- removed img/9_1.png
- removed img/9_2.png
- removed img/addEqipment.jpg
- removed img/airframeSetup.jpg
- removed img/allElements.png
- removed img/attentionSave.jpg
- removed img/brrc2205.png
- removed img/brrc2205on.png
- removed img/brrc2205ondeck.png
- removed img/calibrateaxcel.jpg
- removed img/calibrateaxcelstart.jpg
- removed img/calibratecompass.jpg
- removed img/calibrateESC.jpg
- removed img/calibrategyro.jpg
- removed img/calibratePIDparams.jpg
- removed img/calibrateView.jpg
- removed img/calibrateViewStart.jpg
- removed img/casebattery.png
- removed img/chooseSwitch.jpg
- removed img/Clever main.png
- removed img/clever.jpg
- removed img/Clevermain.png
- removed img/connectBattery.png
- removed img/connectingRadio.png
- removed img/connectionESCtoReceiver.png
- removed img/connectionLost.jpg
- removed img/connectionOK.jpg
- removed img/connectionPixhawk.png
- removed img/consistofTransmitter.jpg
- removed img/cutwire14AWG.jpg
- removed img/escDYSzap.png
- removed img/escWires.png
- removed img/explosion.png
- removed img/firmwarePX4.jpg
- removed img/flightModes.jpg
- removed img/helphand.jpg
- removed img/holderLegs.png
- removed img/isoViewmountHolder.png
- removed img/jumper.png
- removed img/keep.png
- removed img/lockradio.jpg
- removed img/lockradio.png
- removed img/lowsafeDeck.png
- removed img/mainWindow.jpg
- removed img/motorsTopview.png
- removed img/mount5vconnector.png
- removed img/mountAntenna.png
- removed img/mountBeams.png
- removed img/mountBottomDeck.png
- removed img/mountHolder.png
- removed img/mountPDB.png
- removed img/mountReceiverDeck.png
- removed img/mountReceiverStud.png
- removed img/mountxt60pinsocket.png
- removed img/notmoveslider.jpg
- removed img/pixhawk.png
- removed img/radioTransmitter.png
- removed img/readyBatteryholder.png
- removed img/receiver5V.png
- removed img/receiverPPM.png
- removed img/resolderingESC.png
- removed img/safehighRadial.png
- removed img/safeLegs.png
- removed img/safelowRadial.png
- removed img/safetybyassem.png
- removed img/safetyINflight.png
- removed img/safetyPower.png
- removed img/safetyPreflight.png
- removed img/soldering5VTOpdb.png
- removed img/solderingBrrc2205ondeckTOescDYSzap.png
- removed img/solderingPowerwires.png
- removed img/solderingxt60socketTOpdb.png
- removed img/stand.jpg
- removed img/startPDBtest.jpg
- removed img/testMotors.png
- removed img/topESCcaseview.png
- removed img/topPreview.png
- removed img/topviewmountPDB.png
- removed img/topviewpixhawk.png
- removed img/turnoffSafetyswitch.jpg
- removed img/xt60pinsocket.jpg
- removed img/zap.jpg
- removed img/zapPDBtest.jpg
- removed notes/deck.md
- removed notes/powerConnection.md
- removed notes/testConnection.md
- removed notes/zap.md
- removed primeri-programm.md
- modified README.md
- removed sborka.md
- removed sitl.md

Auto commit by GitBook Editor
2018-02-19 22:22:08 +03:00
Oleg Kalachev
786dd72b82 Updates SUMMARY.md
Auto commit by GitBook Editor
2018-02-19 22:21:26 +03:00
Oleg Kalachev
e53d318e22 Updates docs/snippets.md
Auto commit by GitBook Editor
2018-02-19 22:21:04 +03:00
Oleg Kalachev
2d0e06f22c Move .gitattributes file to the root 2018-02-19 15:47:31 +03:00
Oleg Kalachev
f544c32d6d Mark vendored files 2018-02-19 15:17:43 +03:00
Oleg Kalachev
c56b1040d4 Remove static submodule 2018-02-19 07:01:46 +03:00
Oleg Kalachev
51e4cbef32 Remove submodules 2018-02-19 07:00:57 +03:00
Oleg Kalachev
8a60e4e467 Merge branch 'master' of github.com:CopterExpress/clever 2018-02-19 06:46:16 +03:00
Oleg Kalachev
bb792206cc Add readme-file for ios-app 2018-02-19 06:45:45 +03:00
Oleg Kalachev
6448e6b928 Add readme-file for ios-app 2018-02-19 06:44:53 +03:00
Oleg Kalachev
7b7d53c97a Merge branch 'master' of github.com:CopterExpress/clever 2018-02-19 06:38:29 +03:00
Oleg Kalachev
431b97a011 Add mobile remote control for iOS 2018-02-19 06:38:24 +03:00
Oleg Kalachev
5ccf4fac48 Update README.md 2018-02-19 05:17:38 +03:00
Oleg Kalachev
ba21ed7cf9 Update README.md 2018-02-19 05:15:48 +03:00
Oleg Kalachev
1db6453fd2 Update simple_offboard.md 2018-02-19 01:19:54 +03:00
Oleg Kalachev
713b2fef0d Updates docs/simple_offboard.md
Auto commit by GitBook Editor
2018-02-19 01:18:27 +03:00
Oleg Kalachev
05aa5cc8c1 Add vim to apps 2018-02-19 01:10:17 +03:00
yuliya1404
9e5eec4e3b Updates docs/simple_offboard.md
Auto commit by GitBook Editor
2018-02-18 17:53:48 +00:00
394 changed files with 13161 additions and 1871 deletions

13
.editorconfig Normal file
View File

@@ -0,0 +1,13 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
[*.{py,cpp,h,swift,launch}]
indent_style = space
indent_size = 4
[*.{js,html}]
indent_style = tab

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
apps/ios/cleverrc/roslib.js linguist-vendored
apps/ios/cleverrc/BinUtils.swift linguist-vendored

4
.gitmodules vendored
View File

@@ -1,4 +0,0 @@
[submodule "clever/static"]
path = clever/static
url = https://github.com/CopterExpress/clever-rc.git
branch = build

22
.markdownlint.json Normal file
View File

@@ -0,0 +1,22 @@
{
"MD003": false,
"MD013": false,
"MD033": false,
"MD034": false,
"MD044": {
"names": [
"MAVLink",
"ROS",
"Python",
"C++",
"PX4",
"WireShark",
"Wi-Fi",
"Raspberry Pi",
"PixHawk",
"PixRacer",
"ArUco"
],
"code_blocks": false
}
}

21
LICENSE.md Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Copter Express
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,62 +1,69 @@
Клевер
======
# CLEVER
<img src="assets/clever.jpg" align="right" width="300px" alt="Клевер">
<img src="docs/assets/clever3.png" align="right" width="300px" alt="CLEVER drone">
«Клевер» — это учебный конструктор программируемого квадрокоптера, состоящего из популярных открытых компонентов, а также набор необходимой документации и библиотек для работы с ним.
CLEVER is an educational programmable drone kit consisting of an unassembled quadcopter, open source software and documentation. The kit includes Pixhawk/Pixracer autopilot running PX4 firmware, Raspberry Pi 3 as companion computer, a camera for computer vision navigation as well as additional sensors and peripheral devices.
Набор включает в себя полетный контроллер PixHawk/PixRacer с полетным стеком PX4, Raspberry Pi 3 в качестве управлящего бортового компьютера, модуль камеры для реализации полетов с использованием компьютерного зрения, а также набор различных датчиков и другой периферии.
Copter Express has implemented a large number of different autonomous drone projects using exactly the same platform: [automated pizza delivery](https://www.youtube.com/watch?v=hmkAoZOtF58) in Samara and Kazan, coffee delivery in Skolkovo Innovation Center, [autonomous quadcopter with charging station](https://www.youtube.com/watch?v=RjX6nUqw1mI) for site monitoring and security, winning drones on [Robocross-2016](https://www.youtube.com/watch?v=dGbDaz_VmYU) and [Robocross-2017](https://youtu.be/AQnd2CRczbQ) competitions and many others.
На базе точно такой же платформы были созданы многие «большие» проекты компании Copter Express, например, дроны для [пиар-акций по автономной доставке пиццы](https://www.youtube.com/watch?v=hmkAoZOtF58) (Самара, Казань); дрон-доставщик кофе в Сколково, мониторинговый дрон с зарядной станцией, дроны-победители на полевых испытаниях «[Робокросс-2016](https://www.youtube.com/watch?v=dGbDaz_VmYU)», «[Робокросс-2017](https://youtu.be/AQnd2CRczbQ)» и многие другие.
**The main documentation in Russian is available [on our Gitbook](https://clever.copterexpress.com/).**
Для того, чтобы научиться собирать, настраивать, пилотировать и программировать автономный дрон «Клевер», воспользуйтесь этим учебником.
Use it to learn how to assemble, configure, pilot and program autonomous CLEVER drone.
Основная документация
---------------------
## Preconfigured RPi 3 image
https://copterexpress.gitbooks.io/clever/content/
**Preconfigured image for Raspberry Pi 3 with installed and configured software, ready to fly, is available [in the Releases section](https://github.com/CopterExpress/clever/releases).**
**Готовый образ ОС** для RPi 3 с предустановленным и преднастроенным ПО можно скачать [здесь](https://copterexpress.gitbooks.io/clever/content/docs/microsd_images.html).
[![Build Status](http://builder.coex.space/job/CopterExpress---clever/badge/icon)](http://builder.coex.space/job/CopterExpress---clever/)
[Описание API](https://copterexpress.gitbooks.io/clever/content/docs/simple_offboard.html) для автономных полетов.
Image includes:
Ручная установка
---------
* Raspbian Stretch
* ROS Kinetic
* Configured networking
* OpenCV
* mavros
* CLEVER software bundle for autonomous drone control
Склонировать репозиторий в папку `/home/pi/catkin_ws/src/clever` (**важно**):
API description (in Russian) for autonomous flights is available [on GitBook](https://copterexpress.gitbooks.io/clever/simple_offboard.html).
## Manual installation
Install ROS Kinetic according to the [documentation](http://wiki.ros.org/kinetic/Installation).
Clone repo to directory `/home/pi/catkin_ws/src/clever`:
```bash
cd ~/catkin_ws/src
git clone https://github.com/CopterExpress/clever_bundle.git clever
git clone https://github.com/CopterExpress/clever.git clever
```
Пересобрать ROS-пакеты:
Build ROS packages:
```bash
cd ~/catkin_ws
catkin_make -j1
```
Включить сервис roscore (если он не включен):
Enable systemd service `roscore` (if not enabled):
```bash
sudo systemctl enable /home/pi/catkin_ws/src/clever/deploy/roscore.service
sudo systemctl start roscore
```
Включить сервис clever:
Enable systemd service `clever`:
```bash
sudo systemctl enable /home/pi/catkin_ws/src/clever/deploy/clever.service
sudo systemctl start clever
```
Зависимости
-----------
### Dependencies
[ROS Kinetic](http://wiki.ros.org/kinetic).
Необходимые для работы ROS-пакеты:
Necessary ROS packages:
* `opencv3`
* `mavros`
@@ -65,8 +72,6 @@ sudo systemctl start clever
* `cv_camera`
* `nodelet`
* `dynamic_reconfigure`
* `bondcpp`, ветка `master`
* `bondcpp`, branch `master`
* `roslint`
* `rosserial`
TODO: внести в package.xml

View File

@@ -1,44 +0,0 @@
# Summary
* [Введение](README.md)
* [Сборка](docs/assemble.md)
* [Первоначальная настройка](docs/setup.md)
* [Полетные режимы](docs/modes.md)
* [Raspberry Pi](docs/raspberry.md)
* [Образ операционной системы на RPi](docs/microsd_images.md)
* [Подключение Raspberry Pi к PixHawk](docs/connection.md)
* [Подключение по Wi-Fi](docs/wifi.md)
* [Работа с QGroundControl через Wi-Fi](docs/gcs_bridge.md)
* [SSH-доступ](docs/ssh.md)
* [Неисправности радиоаппаратуры](docs/radioerrors.md)
* [Безопасность](docs/safety.md)
* [Техника безопасности по пайке](docs/tb.md)
* [Просмотр видеострима с камер](docs/web_video_server.md)
* [Работа с ROS](docs/ros.md)
* [MAVROS](docs/mavros.md)
* [Автономный полет в OFFBOARD](docs/simple_offboard.md)
* [Навигация по ArUco-маркерам](docs/aruco.md)
* [Взаимодействие с Arduino](docs/arduino.md)
* [Системы координат](docs/frames.md)
* [Работа с камерой \(компьютерное зрение\)](docs/camera.md)
* [Ориентация камеры](docs/camera_frame.md)
* [Визуализация с помощью rviz](docs/rviz.md)
* [Работа с SITL](docs/sitl.md)
* [Подключение GPS](docs/gps.md)
* [Использование 3G-модема](docs/3g.md)
* [Примеры программ](primeri-programm.md)
* Учебник
* [Урок 1](docs/les1.md)
* [Урок 2](docs/les2.md)
* [Урок 7](docs/les7.md)
* [Урок 8](docs/les8.md)
* [Урок 9](docs/les9.md)
* [Урок 11](docs/les11.md)
* [Урок 13](docs/les13.md)
* [Урок 15](docs/les15.md)
* [Урок 16](docs/les16.md)
* Другое
* [CopterHack-2017](docs/copterhack2017.md)
* [Прошивка ESC контроллеров с помощью Arduino](docs/esc_firmware.md)
* [Полезные ссылки](docs/links.md)

17
apps/ios/.gitignore vendored Normal file
View File

@@ -0,0 +1,17 @@
# Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
Pods/

13
apps/ios/Podfile Normal file
View File

@@ -0,0 +1,13 @@
project 'cleverrc.xcodeproj/'
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'cleverrc' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for cleverrc
pod 'SwiftSocket', '~> 2.0'
end

21
apps/ios/Podfile.lock Normal file
View File

@@ -0,0 +1,21 @@
PODS:
- MarqueeLabel/Swift (3.1.4)
- NotificationBannerSwift (1.5.4):
- MarqueeLabel/Swift
- SnapKit (~> 4.0)
- SnapKit (4.0.0)
- SwiftSocket (2.0.2)
DEPENDENCIES:
- NotificationBannerSwift
- SwiftSocket (~> 2.0)
SPEC CHECKSUMS:
MarqueeLabel: bf768455fe88d427f71476ebb23f9092b660f40b
NotificationBannerSwift: 4f6666c8421dcf11be0812dd1093d932c15921af
SnapKit: a42d492c16e80209130a3379f73596c3454b7694
SwiftSocket: 6f4c9c63fbc5c1d61188936bb3c599fd546f40ae
PODFILE CHECKSUM: fd5199f69c3ee8c1fbc0dd582477d890c8b2a24f
COCOAPODS: 1.4.0

10
apps/ios/README.md Normal file
View File

@@ -0,0 +1,10 @@
iOS-приложение для управления Клевером
--------------------------------------
Для установки зависимостей необходим [CocoaPods](https://cocoapods.org):
```bash
pod install
```
Для разработки и сборки откройте в XCode файл `cleverrc.xcworkspace`.

View File

@@ -0,0 +1,450 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objects = {
/* Begin PBXBuildFile section */
7C0AB7AB202A744400BAED27 /* BinUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C0AB7AA202A744400BAED27 /* BinUtils.swift */; };
7C51654120139237004D1F4D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C51654020139237004D1F4D /* AppDelegate.swift */; };
7C51654320139237004D1F4D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C51654220139237004D1F4D /* ViewController.swift */; };
7C51654620139237004D1F4D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7C51654420139237004D1F4D /* Main.storyboard */; };
7C51654820139237004D1F4D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7C51654720139237004D1F4D /* Assets.xcassets */; };
7C51654B20139237004D1F4D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7C51654920139237004D1F4D /* LaunchScreen.storyboard */; };
7C516553201526BA004D1F4D /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 7C516552201526BA004D1F4D /* index.html */; };
7C51655520153180004D1F4D /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 7C51655420153180004D1F4D /* main.js */; };
7C7DECC2203CBCC4000C1C51 /* roslib.js in Resources */ = {isa = PBXBuildFile; fileRef = 7C45DCE9203A75A2009C73F5 /* roslib.js */; };
7CA401E22033CE17009FAA3B /* main.css in Resources */ = {isa = PBXBuildFile; fileRef = 7CA401E12033CE17009FAA3B /* main.css */; };
7CA401E42033FA34009FAA3B /* telemetry.js in Resources */ = {isa = PBXBuildFile; fileRef = 7CA401E32033FA34009FAA3B /* telemetry.js */; };
7CA401E6203471D9009FAA3B /* clever.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7CA401E5203471D8009FAA3B /* clever.svg */; };
C25141CAF1A7125F3CE29DDC /* Pods_cleverrc.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C38C04523251039FF13DDCD /* Pods_cleverrc.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
5C38C04523251039FF13DDCD /* Pods_cleverrc.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_cleverrc.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7C0AB7AA202A744400BAED27 /* BinUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BinUtils.swift; sourceTree = "<group>"; };
7C45DCE9203A75A2009C73F5 /* roslib.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = roslib.js; sourceTree = "<group>"; };
7C51653D20139237004D1F4D /* cleverrc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cleverrc.app; sourceTree = BUILT_PRODUCTS_DIR; };
7C51654020139237004D1F4D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7C51654220139237004D1F4D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
7C51654520139237004D1F4D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
7C51654720139237004D1F4D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
7C51654A20139237004D1F4D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
7C51654C20139237004D1F4D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7C516552201526BA004D1F4D /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = "<group>"; };
7C51655420153180004D1F4D /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.js; sourceTree = "<group>"; };
7CA401E12033CE17009FAA3B /* main.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = main.css; sourceTree = "<group>"; };
7CA401E32033FA34009FAA3B /* telemetry.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = telemetry.js; sourceTree = "<group>"; };
7CA401E5203471D8009FAA3B /* clever.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = clever.svg; sourceTree = "<group>"; };
AAC9195BF3A9BF6942EF4D0B /* Pods-cleverrc.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cleverrc.release.xcconfig"; path = "Pods/Target Support Files/Pods-cleverrc/Pods-cleverrc.release.xcconfig"; sourceTree = "<group>"; };
CB200F4B933204EA97E0E2E4 /* Pods-cleverrc.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cleverrc.debug.xcconfig"; path = "Pods/Target Support Files/Pods-cleverrc/Pods-cleverrc.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
7C51653A20139237004D1F4D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C25141CAF1A7125F3CE29DDC /* Pods_cleverrc.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
4FA3968F2242239E15A656D2 /* Pods */ = {
isa = PBXGroup;
children = (
CB200F4B933204EA97E0E2E4 /* Pods-cleverrc.debug.xcconfig */,
AAC9195BF3A9BF6942EF4D0B /* Pods-cleverrc.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
66C638F0021EBE07741B26F3 /* Frameworks */ = {
isa = PBXGroup;
children = (
5C38C04523251039FF13DDCD /* Pods_cleverrc.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
7C51653420139237004D1F4D = {
isa = PBXGroup;
children = (
66C638F0021EBE07741B26F3 /* Frameworks */,
4FA3968F2242239E15A656D2 /* Pods */,
7C51653E20139237004D1F4D /* Products */,
7C51653F20139237004D1F4D /* cleverrc */,
);
sourceTree = "<group>";
};
7C51653E20139237004D1F4D /* Products */ = {
isa = PBXGroup;
children = (
7C51653D20139237004D1F4D /* cleverrc.app */,
);
name = Products;
sourceTree = "<group>";
};
7C51653F20139237004D1F4D /* cleverrc */ = {
isa = PBXGroup;
children = (
7C45DCE9203A75A2009C73F5 /* roslib.js */,
7C51654020139237004D1F4D /* AppDelegate.swift */,
7C51654720139237004D1F4D /* Assets.xcassets */,
7C0AB7AA202A744400BAED27 /* BinUtils.swift */,
7C51654C20139237004D1F4D /* Info.plist */,
7C51654920139237004D1F4D /* LaunchScreen.storyboard */,
7C51654420139237004D1F4D /* Main.storyboard */,
7C51654220139237004D1F4D /* ViewController.swift */,
7CA401E5203471D8009FAA3B /* clever.svg */,
7C516552201526BA004D1F4D /* index.html */,
7CA401E12033CE17009FAA3B /* main.css */,
7C51655420153180004D1F4D /* main.js */,
7CA401E32033FA34009FAA3B /* telemetry.js */,
);
path = cleverrc;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
7C51653C20139237004D1F4D /* cleverrc */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7C51654F20139237004D1F4D /* Build configuration list for PBXNativeTarget "cleverrc" */;
buildPhases = (
9F096121C4A02BCE9D4FD1B9 /* [CP] Check Pods Manifest.lock */,
7C51653920139237004D1F4D /* Sources */,
7C51653A20139237004D1F4D /* Frameworks */,
7C51653B20139237004D1F4D /* Resources */,
A37DBBAD5E44E632F8A8A204 /* [CP] Embed Pods Frameworks */,
9BAB41D26FC0095C7C86B9DE /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = cleverrc;
productName = cleverrc;
productReference = 7C51653D20139237004D1F4D /* cleverrc.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
7C51653520139237004D1F4D /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Copter Express";
TargetAttributes = {
7C51653C20139237004D1F4D = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 7C51653820139237004D1F4D /* Build configuration list for PBXProject "cleverrc" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 7C51653420139237004D1F4D;
productRefGroup = 7C51653E20139237004D1F4D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
7C51653C20139237004D1F4D /* cleverrc */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
7C51653B20139237004D1F4D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7C51654B20139237004D1F4D /* LaunchScreen.storyboard in Resources */,
7CA401E6203471D9009FAA3B /* clever.svg in Resources */,
7CA401E42033FA34009FAA3B /* telemetry.js in Resources */,
7C7DECC2203CBCC4000C1C51 /* roslib.js in Resources */,
7C516553201526BA004D1F4D /* index.html in Resources */,
7C51654820139237004D1F4D /* Assets.xcassets in Resources */,
7CA401E22033CE17009FAA3B /* main.css in Resources */,
7C51654620139237004D1F4D /* Main.storyboard in Resources */,
7C51655520153180004D1F4D /* main.js in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
9BAB41D26FC0095C7C86B9DE /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-cleverrc/Pods-cleverrc-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9F096121C4A02BCE9D4FD1B9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-cleverrc-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
A37DBBAD5E44E632F8A8A204 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-cleverrc/Pods-cleverrc-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/MarqueeLabel/MarqueeLabel.framework",
"${BUILT_PRODUCTS_DIR}/NotificationBannerSwift/NotificationBannerSwift.framework",
"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
"${BUILT_PRODUCTS_DIR}/SwiftSocket/SwiftSocket.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MarqueeLabel.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NotificationBannerSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftSocket.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-cleverrc/Pods-cleverrc-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
7C51653920139237004D1F4D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7C51654320139237004D1F4D /* ViewController.swift in Sources */,
7C51654120139237004D1F4D /* AppDelegate.swift in Sources */,
7C0AB7AB202A744400BAED27 /* BinUtils.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
7C51654420139237004D1F4D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
7C51654520139237004D1F4D /* Base */,
);
name = Main.storyboard;
path = .;
sourceTree = "<group>";
};
7C51654920139237004D1F4D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
7C51654A20139237004D1F4D /* Base */,
);
name = LaunchScreen.storyboard;
path = .;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
7C51654D20139237004D1F4D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
7C51654E20139237004D1F4D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
7C51655020139237004D1F4D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = CB200F4B933204EA97E0E2E4 /* Pods-cleverrc.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 7QY6KJ2672;
INFOPLIST_FILE = cleverrc/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = coex.cleverrc;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
7C51655120139237004D1F4D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AAC9195BF3A9BF6942EF4D0B /* Pods-cleverrc.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 7QY6KJ2672;
INFOPLIST_FILE = cleverrc/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = coex.cleverrc;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
7C51653820139237004D1F4D /* Build configuration list for PBXProject "cleverrc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7C51654D20139237004D1F4D /* Debug */,
7C51654E20139237004D1F4D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7C51654F20139237004D1F4D /* Build configuration list for PBXNativeTarget "cleverrc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7C51655020139237004D1F4D /* Debug */,
7C51655120139237004D1F4D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 7C51653520139237004D1F4D /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:cleverrc.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:cleverrc.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,46 @@
//
// AppDelegate.swift
// cleverrc
//
// Created by Oleg Kalachev on 20.01.2018.
// Copyright © 2018 Copter Express. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}

View File

@@ -0,0 +1,116 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "cleverrc40.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "clever60.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "clever58.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "clever87.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "clever80.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "clever120.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "clever120-1.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "clever180-1.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "clever20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "clever40.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "clever29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "clever58-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "clever40-1.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "clever80-1.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "clever76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "clever152.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "clever167.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "clever1024.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

View File

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,20 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.10586584359407425" green="0.10589186102151871" blue="0.10586420446634293" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="landscape">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="cleverrc" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="667" height="375"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<wkWebView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dtJ-LN-BYT">
<rect key="frame" x="0.0" y="0.0" width="667" height="375"/>
<color key="backgroundColor" red="0.12939286231994629" green="0.12942266464233398" blue="0.12939092516899109" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
</subviews>
<color key="backgroundColor" red="0.1097869947552681" green="0.10981365293264389" blue="0.10978532582521439" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="dtJ-LN-BYT" firstAttribute="height" secondItem="8bC-Xf-vdC" secondAttribute="height" id="KRn-ag-67x"/>
<constraint firstItem="dtJ-LN-BYT" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="qOr-gg-e4M"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="webView" destination="dtJ-LN-BYT" id="bQ3-jy-o6E"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="138.0809595202399" y="124"/>
</scene>
</scenes>
</document>

453
apps/ios/cleverrc/BinUtils.swift vendored Normal file
View File

@@ -0,0 +1,453 @@
//
// BinUtils.swift
// BinUtils
//
// Created by Nicolas Seriot on 12/03/16.
// Copyright © 2016 Nicolas Seriot. All rights reserved.
//
import Foundation
import CoreFoundation
// MARK: protocol UnpackedType
public protocol Unpackable {}
extension NSString: Unpackable {}
extension Bool: Unpackable {}
extension Int: Unpackable {}
extension Double: Unpackable {}
// MARK: protocol DataConvertible
protocol DataConvertible {}
extension DataConvertible {
init?(data: Data) {
guard data.count == MemoryLayout<Self>.size else { return nil }
self = data.withUnsafeBytes { $0.pointee }
}
init?(bytes: [UInt8]) {
let data = Data(bytes:bytes)
self.init(data:data)
}
var data: Data {
var value = self
return Data(buffer: UnsafeBufferPointer(start: &value, count: 1))
}
}
extension Bool : DataConvertible { }
extension Int8 : DataConvertible { }
extension Int16 : DataConvertible { }
extension Int32 : DataConvertible { }
extension Int64 : DataConvertible { }
extension UInt8 : DataConvertible { }
extension UInt16 : DataConvertible { }
extension UInt32 : DataConvertible { }
extension UInt64 : DataConvertible { }
extension Float32 : DataConvertible { }
extension Float64 : DataConvertible { }
// MARK: String extension
extension String {
subscript (from:Int, to:Int) -> String {
return NSString(string: self).substring(with: NSMakeRange(from, to-from))
}
}
// MARK: Data extension
extension Data {
var bytes : [UInt8] {
return self.withUnsafeBytes {
[UInt8](UnsafeBufferPointer(start: $0, count: self.count))
}
}
}
// MARK: functions
public func hexlify(_ data:Data) -> String {
// similar to hexlify() in Python's binascii module
// https://docs.python.org/2/library/binascii.html
var s = String()
var byte: UInt8 = 0
for i in 0 ..< data.count {
NSData(data: data).getBytes(&byte, range: NSMakeRange(i, 1))
s = s.appendingFormat("%02x", byte)
}
return s as String
}
public func unhexlify(_ string:String) -> Data? {
// similar to unhexlify() in Python's binascii module
// https://docs.python.org/2/library/binascii.html
let s = string.uppercased().replacingOccurrences(of: " ", with: "")
let nonHexCharacterSet = CharacterSet(charactersIn: "0123456789ABCDEF").inverted
if let range = s.rangeOfCharacter(from: nonHexCharacterSet) {
print("-- found non hex character at range \(range)")
return nil
}
var data = Data(capacity: s.count / 2)
for i in stride(from: 0, to:s.count, by:2) {
let byteString = s[i, i+2]
let byte = UInt8(byteString.withCString { strtoul($0, nil, 16) })
data.append([byte] as [UInt8], count: 1)
}
return data
}
func readIntegerType<T:DataConvertible>(_ type:T.Type, bytes:[UInt8], loc:inout Int) -> T {
let size = MemoryLayout<T>.size
let sub = Array(bytes[loc..<(loc+size)])
loc += size
return T(bytes: sub)!
}
func readFloatingPointType<T:DataConvertible>(_ type:T.Type, bytes:[UInt8], loc:inout Int, isBigEndian:Bool) -> T {
let size = MemoryLayout<T>.size
let sub = Array(bytes[loc..<(loc+size)])
loc += size
let sub_ = isBigEndian ? sub.reversed() : sub
return T(bytes: sub_)!
}
func isBigEndianFromMandatoryByteOrderFirstCharacter(_ format:String) -> Bool {
guard let firstChar = format.first else { assertionFailure("empty format"); return false }
let s = NSString(string: String(firstChar))
let c = s.substring(to: 1)
if c == "@" { assertionFailure("native size and alignment is unsupported") }
if c == "=" || c == "<" { return false }
if c == ">" || c == "!" { return true }
assertionFailure("format '\(format)' first character must be among '=<>!'")
return false
}
// akin to struct.calcsize(fmt)
func numberOfBytesInFormat(_ format:String) -> Int {
var numberOfBytes = 0
var n = 0 // repeat counter
var mutableFormat = format
while !mutableFormat.isEmpty {
let c = mutableFormat.remove(at: mutableFormat.startIndex)
if let i = Int(String(c)) , 0...9 ~= i {
if n > 0 { n *= 10 }
n += i
continue
}
if c == "s" {
numberOfBytes += max(n,1)
n = 0
continue
}
for _ in 0..<max(n,1) {
switch(c) {
case "@", "<", "=", ">", "!", " ":
()
case "c", "b", "B", "x", "?":
numberOfBytes += 1
case "h", "H":
numberOfBytes += 2
case "i", "l", "I", "L", "f":
numberOfBytes += 4
case "q", "Q", "d":
numberOfBytes += 8
case "P":
numberOfBytes += MemoryLayout<Int>.size
default:
assertionFailure("-- unsupported format \(c)")
}
}
n = 0
}
return numberOfBytes
}
func formatDoesMatchDataLength(_ format:String, data:Data) -> Bool {
let sizeAccordingToFormat = numberOfBytesInFormat(format)
let dataLength = data.count
if sizeAccordingToFormat != dataLength {
print("format \"\(format)\" expects \(sizeAccordingToFormat) bytes but data is \(dataLength) bytes")
return false
}
return true
}
/*
pack() and unpack() should behave as Python's struct module https://docs.python.org/2/library/struct.html BUT:
- native size and alignment '@' is not supported
- as a consequence, the byte order specifier character is mandatory and must be among "=<>!"
- native byte order '=' assumes a little-endian system (eg. Intel x86)
- Pascal strings 'p' and native pointers 'P' are not supported
*/
public enum BinUtilsError: Error {
case formatDoesMatchDataLength(format:String, dataSize:Int)
case unsupportedFormat(character:Character)
}
public func pack(_ format:String, _ objects:[Any], _ stringEncoding:String.Encoding=String.Encoding.windowsCP1252) -> Data {
var objectsQueue = objects
var mutableFormat = format
var mutableData = Data()
var isBigEndian = false
let firstCharacter = mutableFormat.remove(at: mutableFormat.startIndex)
switch(firstCharacter) {
case "<", "=":
isBigEndian = false
case ">", "!":
isBigEndian = true
case "@":
assertionFailure("native size and alignment '@' is unsupported'")
default:
assertionFailure("unsupported format chacracter'")
}
var n = 0 // repeat counter
while !mutableFormat.isEmpty {
let c = mutableFormat.remove(at: mutableFormat.startIndex)
if let i = Int(String(c)) , 0...9 ~= i {
if n > 0 { n *= 10 }
n += i
continue
}
var o : Any = 0
if c == "s" {
o = objectsQueue.remove(at: 0)
guard let stringData = (o as! String).data(using: .utf8) else { assertionFailure(); return Data() }
var bytes = stringData.bytes
let expectedSize = max(1, n)
// pad ...
while bytes.count < expectedSize { bytes.append(0x00) }
// ... or trunk
if bytes.count > expectedSize { bytes = Array(bytes[0..<expectedSize]) }
assert(bytes.count == expectedSize)
if isBigEndian { bytes = bytes.reversed() }
mutableData.append(bytes, count: bytes.count)
n = 0
continue
}
for _ in 0..<max(n,1) {
var bytes : [UInt8] = []
if c != "x" {
o = objectsQueue.removeFirst()
}
switch(c) {
case "?":
bytes = (o as! Bool) ? [0x01] : [0x00]
case "c":
let charAsString = (o as! NSString).substring(to: 1)
guard let data = charAsString.data(using: stringEncoding) else {
assertionFailure("cannot decode character \(charAsString) using encoding \(stringEncoding)")
return Data()
}
bytes = data.bytes
case "b":
bytes = Int8(truncatingIfNeeded:o as! Int).data.bytes
case "h":
bytes = Int16(truncatingIfNeeded:o as! Int).data.bytes
case "i", "l":
bytes = Int32(truncatingIfNeeded:o as! Int).data.bytes
case "q", "Q":
bytes = Int64(o as! Int).data.bytes
case "B":
bytes = UInt8(truncatingIfNeeded:o as! Int).data.bytes
case "H":
bytes = UInt16(truncatingIfNeeded:o as! Int).data.bytes
case "I", "L":
bytes = UInt32(truncatingIfNeeded:o as! Int).data.bytes
case "f":
bytes = Float32(o as! Double).data.bytes
case "d":
bytes = Float64(o as! Double).data.bytes
case "x":
bytes = [0x00]
default:
assertionFailure("Unsupported packing format: \(c)")
}
if isBigEndian { bytes = bytes.reversed() }
let data = Data(bytes)
mutableData.append(data)
}
n = 0
}
return mutableData
}
public func unpack(_ format:String, _ data:Data, _ stringEncoding:String.Encoding=String.Encoding.windowsCP1252) throws -> [Unpackable] {
assert(CFByteOrderGetCurrent() == 1 /* CFByteOrderLittleEndian */, "\(#file) assumes little endian, but host is big endian")
let isBigEndian = isBigEndianFromMandatoryByteOrderFirstCharacter(format)
if formatDoesMatchDataLength(format, data: data) == false {
throw BinUtilsError.formatDoesMatchDataLength(format:format, dataSize:data.count)
}
var a : [Unpackable] = []
var loc = 0
let bytes = data.bytes
var n = 0 // repeat counter
var mutableFormat = format
mutableFormat.remove(at: mutableFormat.startIndex) // consume byte-order specifier
while !mutableFormat.isEmpty {
let c = mutableFormat.remove(at: mutableFormat.startIndex)
if let i = Int(String(c)) , 0...9 ~= i {
if n > 0 { n *= 10 }
n += i
continue
}
if c == "s" {
let length = max(n,1)
let sub = Array(bytes[loc..<loc+length])
guard let s = NSString(bytes: sub, length: length, encoding: stringEncoding.rawValue) else {
assertionFailure("-- not a string: \(sub)")
return []
}
a.append(s)
loc += length
n = 0
continue
}
for _ in 0..<max(n,1) {
var o : Unpackable?
switch(c) {
case "c":
let optionalString = NSString(bytes: [bytes[loc]], length: 1, encoding: String.Encoding.utf8.rawValue)
loc += 1
guard let s = optionalString else { assertionFailure(); return [] }
o = s
case "b":
let r = readIntegerType(Int8.self, bytes:bytes, loc:&loc)
o = Int(r)
case "B":
let r = readIntegerType(UInt8.self, bytes:bytes, loc:&loc)
o = Int(r)
case "?":
let r = readIntegerType(Bool.self, bytes:bytes, loc:&loc)
o = r ? true : false
case "h":
let r = readIntegerType(Int16.self, bytes:bytes, loc:&loc)
o = Int(isBigEndian ? Int16(bigEndian: r) : r)
case "H":
let r = readIntegerType(UInt16.self, bytes:bytes, loc:&loc)
o = Int(isBigEndian ? UInt16(bigEndian: r) : r)
case "i":
fallthrough
case "l":
let r = readIntegerType(Int32.self, bytes:bytes, loc:&loc)
o = Int(isBigEndian ? Int32(bigEndian: r) : r)
case "I":
fallthrough
case "L":
let r = readIntegerType(UInt32.self, bytes:bytes, loc:&loc)
o = Int(isBigEndian ? UInt32(bigEndian: r) : r)
case "q":
let r = readIntegerType(Int64.self, bytes:bytes, loc:&loc)
o = Int(isBigEndian ? Int64(bigEndian: r) : r)
case "Q":
let r = readIntegerType(UInt64.self, bytes:bytes, loc:&loc)
o = Int(isBigEndian ? UInt64(bigEndian: r) : r)
case "f":
let r = readFloatingPointType(Float32.self, bytes:bytes, loc:&loc, isBigEndian:isBigEndian)
o = Double(r)
case "d":
let r = readFloatingPointType(Float64.self, bytes:bytes, loc:&loc, isBigEndian:isBigEndian)
o = Double(r)
case "x":
loc += 1
case " ":
()
default:
throw BinUtilsError.unsupportedFormat(character:c)
}
if let o = o { a.append(o) }
}
n = 0
}
return a
}

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>CLEVER RC</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,10 @@
iOS-приложение для управления Клевером
--------------------------------------
Для установки зависимостей необходим [CocoaPods](https://cocoapods.org):
```bash
pod install
```
Для разработки и сборки откройте в XCode файл `cleverrc.xcworkspace`.

View File

@@ -0,0 +1,86 @@
//
// ViewController.swift
// cleverrc
//
// Created by Oleg Kalachev on 20.01.2018.
// Copyright © 2018 Copter Express. All rights reserved.
//
import UIKit
import WebKit
import SwiftSocket
import NotificationBannerSwift
import AudioToolbox.AudioServices
class ViewController: UIViewController, WKScriptMessageHandler {
@IBOutlet weak var webView: WKWebView!
let impactGenerator = UIImpactFeedbackGenerator(style: .medium)
let notificationGenerator = UINotificationFeedbackGenerator()
let udpSocket = UDPClient(address: "255.255.255.255", port: 35602)
override func viewDidLoad() {
super.viewDidLoad()
// Don't lock screen
UIApplication.shared.isIdleTimerDisabled = true
// Setup webview event handlers
webView.scrollView.bounces = false;
webView.configuration.userContentController.add(self, name: "control")
webView.configuration.userContentController.add(self, name: "controlStart")
webView.configuration.userContentController.add(self, name: "lowBattery")
webView.configuration.userContentController.add(self, name: "notification")
// Load the main page
let url = Bundle.main.url(forResource: "index", withExtension: "html")
let requestObj = URLRequest(url: url!)
webView.load(requestObj)
// Setup UDP broadcasting
udpSocket.enableBroadcast()
// Set UDP broadcasting interface
var wifiInterface = if_nametoindex("en0");
setsockopt(udpSocket.fd!, IPPROTO_IP, IP_BOUND_IF, &wifiInterface, socklen_t(MemoryLayout<UInt32>.size));
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
if (message.name == "control") {
// Send UDP control message
let m = message.body as! NSDictionary;
let d = pack("<hhhh", [m["x"]!, m["y"]!, m["z"]!, m["r"]!])
_ = udpSocket.send(data: d)
} else if (message.name == "lowBattery") {
// Got low battery notification
print("Low battery notification")
tapticNotify()
} else if (message.name == "notification") {
// Got notification message
print(message)
tapticNotify()
}
}
func tapticNotify() {
if let feedbackSupportLevel = UIDevice.current.value(forKey: "_feedbackSupportLevel") as? Int {
switch feedbackSupportLevel {
case 2:
// 2nd Generation Taptic Engine w/ Haptic Feedback (iPhone 7/7+)
notificationGenerator.notificationOccurred(.warning)
case 1:
// 1st Generation Taptic Engine (iPhone 6S/6S+)
let peek = SystemSoundID(1519)
AudioServicesPlaySystemSound(peek)
case 0:
// No Taptic Engine
break
default: break
}
}
}
}

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 69.988266 69.987198"
height="69.987198"
width="69.988266"
xml:space="preserve"
id="svg2"
version="1.1"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs6"><clipPath
id="clipPath18"
clipPathUnits="userSpaceOnUse"><path
id="path16"
d="M 0,52.49 H 52.491 V 0 H 0 Z" /></clipPath></defs><g
transform="matrix(1.3333333,0,0,-1.3333333,0,69.9872)"
id="g10"><g
id="g12"><g
clip-path="url(#clipPath18)"
id="g14"><g
transform="translate(35.6531,35.3361)"
id="g20"><path
id="path22"
style="fill:white;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
d="M 0,0 C 0.279,0.322 0.5,0.686 0.657,1.081 0.827,1.513 0.914,1.968 0.917,2.434 0.92,2.924 0.829,3.403 0.647,3.857 0.458,4.329 0.165,4.77 -0.2,5.13 -0.587,5.512 -1.061,5.812 -1.571,5.995 -2.138,6.198 -2.756,6.262 -3.358,6.18 -3.821,6.115 -4.263,5.967 -4.671,5.739 -4.886,5.618 -5.094,5.472 -5.291,5.305 L -5.467,5.151 C -5.527,5.099 -5.587,5.049 -5.649,5.003 -5.775,4.909 -5.906,4.827 -6.04,4.759 -6.173,4.691 -6.314,4.633 -6.458,4.586 -6.575,4.549 -6.696,4.519 -6.819,4.496 -6.917,4.478 -7.017,4.465 -7.115,4.457 c -0.623,-0.052 -1.281,0.082 -1.9,0.385 -0.224,0.111 -0.439,0.241 -0.64,0.387 -0.042,0.03 -0.084,0.063 -0.127,0.095 -0.039,0.031 -0.069,0.054 -0.102,0.09 -0.023,0.025 -0.043,0.05 -0.061,0.077 -0.056,0.082 -0.093,0.176 -0.107,0.271 -0.004,0.022 -0.005,0.044 -0.006,0.066 l -0.002,6.486 c -0.534,0.589 -1.115,1.136 -1.728,1.626 -0.913,0.73 -1.913,1.352 -2.971,1.845 -0.867,0.405 -1.779,0.725 -2.711,0.952 -0.851,0.208 -1.731,0.34 -2.617,0.391 -0.912,0.053 -1.834,0.023 -2.741,-0.092 -0.741,-0.094 -1.479,-0.246 -2.194,-0.453 -1.274,-0.365 -2.494,-0.905 -3.628,-1.604 -0.824,-0.507 -1.603,-1.101 -2.316,-1.764 -0.687,-0.64 -1.317,-1.35 -1.871,-2.109 -0.505,-0.692 -0.951,-1.432 -1.327,-2.2 -0.375,-0.764 -0.684,-1.566 -0.919,-2.383 -0.201,-0.7 -0.351,-1.423 -0.446,-2.147 -0.12,-0.919 -0.153,-1.858 -0.099,-2.79 0.05,-0.838 0.171,-1.673 0.359,-2.482 0.201,-0.856 0.481,-1.7 0.833,-2.507 0.546,-1.253 1.265,-2.423 2.136,-3.479 0.317,-0.384 0.654,-0.753 1.002,-1.098 0.158,-0.157 0.32,-0.31 0.485,-0.459 h 6.121 c 0.051,0.08 0.099,0.161 0.143,0.245 0.037,0.071 0.072,0.144 0.104,0.218 0.026,0.062 0.05,0.128 0.073,0.193 0.132,0.394 0.159,0.784 0.077,1.127 -0.013,0.052 -0.028,0.105 -0.046,0.157 -0.024,0.068 -0.053,0.136 -0.087,0.201 -0.048,0.09 -0.105,0.174 -0.169,0.249 -0.035,0.041 -0.07,0.079 -0.107,0.116 l -0.024,0.026 c -0.025,0.029 -0.046,0.053 -0.066,0.079 -0.014,0.02 -0.02,0.029 -0.027,0.038 l -0.079,0.096 c -0.109,0.134 -0.212,0.277 -0.304,0.42 -0.207,0.318 -0.378,0.659 -0.506,1.013 -0.118,0.32 -0.202,0.651 -0.252,0.985 -0.085,0.571 -0.073,1.146 0.035,1.71 0.098,0.509 0.273,0.999 0.521,1.454 0.258,0.475 0.588,0.903 0.98,1.272 0.419,0.394 0.895,0.711 1.415,0.942 0.557,0.249 1.15,0.393 1.762,0.428 0.659,0.035 1.298,-0.05 1.914,-0.258 0.653,-0.221 1.268,-0.585 1.78,-1.05 0.541,-0.492 0.977,-1.106 1.261,-1.776 0.151,-0.357 0.26,-0.729 0.324,-1.106 0.072,-0.415 0.092,-0.843 0.058,-1.272 -0.031,-0.388 -0.108,-0.773 -0.227,-1.144 -0.11,-0.341 -0.257,-0.673 -0.441,-0.988 -0.103,-0.177 -0.216,-0.347 -0.335,-0.503 -0.037,-0.051 -0.077,-0.1 -0.117,-0.151 l -0.033,-0.04 -0.005,0.002 -0.049,-0.07 c -0.022,-0.028 -0.043,-0.054 -0.066,-0.08 l -0.076,-0.08 c -0.028,-0.03 -0.055,-0.062 -0.081,-0.094 -0.05,-0.063 -0.095,-0.131 -0.134,-0.202 -0.035,-0.064 -0.066,-0.131 -0.09,-0.199 -0.019,-0.053 -0.035,-0.105 -0.049,-0.158 -0.085,-0.34 -0.062,-0.729 0.066,-1.123 0.021,-0.066 0.045,-0.13 0.071,-0.193 0.03,-0.073 0.063,-0.145 0.1,-0.215 0.045,-0.088 0.096,-0.176 0.156,-0.269 h 7.162 l 0.002,7.527 c 10e-4,0.022 0.002,0.043 0.006,0.065 0.008,0.061 0.027,0.124 0.057,0.187 0.03,0.06 0.067,0.114 0.111,0.161 0.034,0.037 0.065,0.062 0.102,0.09 l 0.062,0.048 c 0.087,0.065 0.173,0.126 0.262,0.183 0.487,0.316 1.027,0.526 1.563,0.608 0.154,0.024 0.312,0.037 0.482,0.04 0.037,0.001 0.076,0 0.113,-0.001 0.062,-0.002 0.124,-0.005 0.186,-0.01 0.123,-0.011 0.247,-0.029 0.367,-0.053 0.338,-0.071 0.654,-0.2 0.939,-0.383 0.11,-0.07 0.214,-0.149 0.31,-0.231 0.031,-0.026 0.061,-0.053 0.09,-0.081 l 0.029,-0.028 -0.07,-0.106 c 0.003,-0.003 0.007,-0.007 0.01,-0.01 l 0.071,0.101 0.215,-0.169 c 0.13,-0.101 0.243,-0.179 0.358,-0.25 0.24,-0.146 0.497,-0.266 0.763,-0.355 0.656,-0.219 1.363,-0.253 2.04,-0.097 0.374,0.086 0.731,0.229 1.059,0.424 C -0.581,-0.571 -0.268,-0.309 0,0" /></g><g
transform="translate(41.5882,22.8337)"
id="g24"><path
id="path26"
style="fill:white;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
d="M 0,0 V 0 L 0.053,0.044 0.013,0.018 Z" /></g><g
transform="translate(28.5515,3.2736)"
id="g28"><path
id="path30"
style="fill:white;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0.934,-0.757 1.959,-1.398 3.045,-1.906 0.84,-0.39 1.72,-0.702 2.615,-0.927 0.883,-0.222 1.796,-0.362 2.714,-0.416 0.944,-0.054 1.897,-0.019 2.832,0.106 0.707,0.094 1.414,0.242 2.102,0.439 1.276,0.368 2.496,0.908 3.628,1.605 0.798,0.492 1.556,1.065 2.251,1.704 0.724,0.666 1.384,1.408 1.962,2.205 0.468,0.646 0.886,1.334 1.242,2.044 0.409,0.815 0.742,1.672 0.99,2.547 0.179,0.628 0.316,1.274 0.409,1.921 0.14,0.979 0.182,1.98 0.123,2.973 -0.048,0.819 -0.165,1.638 -0.348,2.433 -0.2,0.872 -0.484,1.732 -0.843,2.556 -0.538,1.234 -1.247,2.392 -2.106,3.442 -0.313,0.381 -0.648,0.752 -0.998,1.1 l -0.52,0.493 H 12.982 L 12.831,22.068 C 12.797,22.003 12.763,21.931 12.732,21.857 12.705,21.794 12.681,21.73 12.659,21.665 12.527,21.268 12.5,20.878 12.582,20.536 c 0.012,-0.053 0.027,-0.105 0.045,-0.156 0.024,-0.069 0.054,-0.137 0.088,-0.202 0.046,-0.086 0.103,-0.171 0.169,-0.251 0.027,-0.032 0.056,-0.062 0.086,-0.093 l 0.045,-0.048 c 0.023,-0.025 0.044,-0.051 0.065,-0.078 l -0.046,-0.082 0.061,0.057 0.003,-0.002 0.022,-0.028 -10e-4,-10e-4 0.01,-0.015 0.004,0.003 0.05,-0.062 c 0.171,-0.212 0.322,-0.433 0.451,-0.659 0.275,-0.478 0.469,-0.996 0.575,-1.538 0.141,-0.718 0.124,-1.472 -0.05,-2.181 -0.152,-0.623 -0.431,-1.228 -0.807,-1.751 -0.303,-0.42 -0.667,-0.79 -1.082,-1.1 C 11.868,12.048 11.425,11.81 10.954,11.64 10.456,11.461 9.935,11.362 9.406,11.345 8.955,11.331 8.505,11.376 8.07,11.48 c -0.494,0.118 -0.965,0.308 -1.399,0.565 -0.509,0.301 -0.958,0.685 -1.333,1.14 -0.393,0.477 -0.692,1.014 -0.89,1.596 -0.218,0.645 -0.305,1.348 -0.25,2.031 0.029,0.355 0.095,0.704 0.194,1.037 0.114,0.383 0.273,0.751 0.474,1.095 0.095,0.164 0.207,0.334 0.334,0.503 0.038,0.051 0.078,0.102 0.118,0.151 L 5.45,19.56 v 0 l -0.101,0.074 0.055,0.073 c 0.023,0.028 0.045,0.054 0.066,0.078 l 0.076,0.08 c 0.03,0.031 0.057,0.062 0.082,0.095 0.05,0.063 0.095,0.131 0.135,0.203 0.034,0.063 0.065,0.13 0.09,0.199 0.019,0.052 0.034,0.103 0.047,0.156 0.086,0.341 0.063,0.73 -0.065,1.124 -0.021,0.065 -0.044,0.129 -0.071,0.193 -0.033,0.082 -0.071,0.162 -0.113,0.24 -0.044,0.084 -0.092,0.165 -0.143,0.244 h -7.162 l -0.002,-7.532 c -0.001,-0.02 -0.003,-0.041 -0.006,-0.06 -0.015,-0.099 -0.052,-0.192 -0.107,-0.272 -0.018,-0.027 -0.039,-0.052 -0.061,-0.076 -0.035,-0.037 -0.064,-0.061 -0.102,-0.09 -0.02,-0.016 -0.042,-0.033 -0.065,-0.05 -0.122,-0.091 -0.254,-0.181 -0.393,-0.264 -0.619,-0.37 -1.29,-0.565 -1.942,-0.565 -0.093,-0.003 -0.179,0.003 -0.268,0.011 -0.11,0.01 -0.221,0.025 -0.33,0.046 -0.36,0.071 -0.709,0.213 -1.008,0.411 -0.109,0.072 -0.213,0.152 -0.309,0.237 -0.029,0.026 -0.058,0.052 -0.085,0.079 h -0.026 l -0.022,0.042 -0.036,0.027 c -0.035,0.03 -0.061,0.051 -0.087,0.072 l -0.073,0.059 c -0.212,0.162 -0.427,0.296 -0.648,0.404 -0.416,0.204 -0.861,0.328 -1.324,0.367 -0.345,0.028 -0.695,0.012 -1.037,-0.053 -0.259,-0.05 -0.511,-0.126 -0.75,-0.228 -0.498,-0.211 -0.954,-0.534 -1.32,-0.936 -0.345,-0.381 -0.614,-0.838 -0.779,-1.322 -0.154,-0.455 -0.218,-0.933 -0.191,-1.421 0.026,-0.462 0.136,-0.909 0.326,-1.327 0.175,-0.386 0.412,-0.738 0.706,-1.047 0.283,-0.296 0.609,-0.543 0.97,-0.734 0.319,-0.168 0.661,-0.289 1.015,-0.36 0.449,-0.089 0.906,-0.095 1.357,-0.021 0.246,0.041 0.49,0.108 0.725,0.198 0.254,0.098 0.499,0.225 0.727,0.377 0.113,0.075 0.229,0.161 0.343,0.257 l 0.068,0.054 0.016,0.046 0.041,0.002 c 0.012,0.013 0.02,0.02 0.029,0.028 l 0.055,0.052 c 0.051,0.043 0.1,0.084 0.151,0.124 0.104,0.08 0.212,0.151 0.322,0.213 0.28,0.159 0.589,0.268 0.917,0.324 0.152,0.026 0.31,0.04 0.48,0.043 h 0.109 C -4.1,9.429 -3.938,9.414 -3.782,9.389 -3.261,9.303 -2.734,9.095 -2.256,8.787 -2.167,8.73 -2.08,8.668 -1.996,8.604 l 0.053,-0.04 c 0.048,-0.037 0.077,-0.061 0.111,-0.097 0.047,-0.05 0.084,-0.104 0.113,-0.162 0.029,-0.062 0.048,-0.125 0.057,-0.187 0.003,-0.02 0.005,-0.04 0.006,-0.06 L -1.654,8.021 V 1.566 C -1.142,1.001 -0.585,0.474 0,0" /></g><g
transform="translate(22.2707,17.571)"
id="g32"><path
id="path34"
style="fill:white;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
d="m 0,0 v -0.008 l 0.011,0.019 v 0 z" /></g><g
transform="translate(40.657,22.3049)"
id="g36"><path
id="path38"
style="fill:white;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
d="M 0,0 Z" /></g><g
transform="translate(49.1867,28.5134)"
id="g40"><path
id="path42"
style="fill:white;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0.721,0.884 1.337,1.848 1.832,2.865 0.359,0.739 0.659,1.516 0.89,2.311 0.244,0.839 0.413,1.706 0.503,2.579 0.173,1.678 0.063,3.352 -0.329,4.976 -0.323,1.339 -0.834,2.625 -1.518,3.823 -0.416,0.728 -0.898,1.425 -1.432,2.072 -0.597,0.724 -1.268,1.394 -1.993,1.994 -0.636,0.525 -1.32,0.999 -2.034,1.409 -0.75,0.431 -1.539,0.796 -2.345,1.086 -1,0.359 -2.041,0.609 -3.095,0.743 -0.401,0.051 -0.808,0.086 -1.209,0.104 -0.205,0.009 -0.41,0.014 -0.615,0.015 h -0.098 c -0.479,-0.003 -0.943,-0.026 -1.379,-0.069 -0.825,-0.08 -1.65,-0.231 -2.451,-0.45 -0.861,-0.235 -1.705,-0.551 -2.509,-0.941 -0.765,-0.371 -1.502,-0.811 -2.191,-1.308 -0.571,-0.411 -1.115,-0.866 -1.618,-1.352 -0.236,-0.227 -0.471,-0.469 -0.698,-0.72 v -6.121 c 0.079,-0.052 0.161,-0.1 0.245,-0.144 0.07,-0.037 0.143,-0.071 0.216,-0.102 0.064,-0.027 0.13,-0.051 0.195,-0.074 0.394,-0.132 0.784,-0.158 1.127,-0.077 0.053,0.012 0.105,0.027 0.156,0.045 0.069,0.024 0.136,0.054 0.201,0.088 0.088,0.047 0.173,0.104 0.251,0.169 0.04,0.034 0.078,0.071 0.116,0.107 l 0.029,0.028 c 0.035,0.029 0.055,0.046 0.077,0.063 l 0.107,0.085 c 0.164,0.132 0.314,0.24 0.466,0.338 0.319,0.205 0.662,0.373 1.018,0.502 0.317,0.115 0.649,0.198 0.987,0.245 0.56,0.082 1.126,0.068 1.681,-0.038 0.51,-0.098 1,-0.273 1.455,-0.521 0.473,-0.257 0.901,-0.587 1.272,-0.981 0.394,-0.418 0.711,-0.894 0.942,-1.414 0.248,-0.558 0.392,-1.151 0.427,-1.762 0.037,-0.645 -0.052,-1.307 -0.258,-1.914 -0.22,-0.652 -0.583,-1.267 -1.049,-1.781 -0.491,-0.54 -1.105,-0.976 -1.776,-1.26 -0.352,-0.149 -0.724,-0.259 -1.106,-0.325 -0.421,-0.072 -0.849,-0.091 -1.272,-0.057 -0.371,0.03 -0.739,0.1 -1.09,0.21 -0.365,0.113 -0.716,0.267 -1.042,0.458 -0.167,0.096 -0.336,0.209 -0.503,0.334 -0.051,0.039 -0.102,0.078 -0.151,0.118 l -0.108,0.086 c -0.028,0.022 -0.053,0.043 -0.079,0.065 -0.03,0.028 -0.056,0.054 -0.082,0.079 -0.029,0.026 -0.061,0.054 -0.094,0.081 -0.064,0.05 -0.132,0.095 -0.201,0.133 -0.064,0.035 -0.132,0.065 -0.201,0.091 -0.051,0.018 -0.101,0.034 -0.154,0.046 C -20.829,6.024 -21.219,6 -21.613,5.873 -21.677,5.852 -21.742,5.828 -21.806,5.802 -21.887,5.768 -21.967,5.73 -22.045,5.689 -22.129,5.645 -22.21,5.598 -22.289,5.546 v -7.162 l 7.532,-0.003 c 0.02,-0.001 0.04,-0.002 0.06,-0.005 0.098,-0.015 0.192,-0.052 0.272,-0.107 0.026,-0.018 0.053,-0.039 0.076,-0.062 0.035,-0.033 0.058,-0.061 0.085,-0.096 l 0.053,-0.068 c 0.094,-0.125 0.184,-0.257 0.267,-0.395 0.362,-0.608 0.557,-1.269 0.563,-1.912 0.002,-0.099 -0.002,-0.198 -0.01,-0.298 -0.009,-0.11 -0.025,-0.221 -0.046,-0.33 -0.072,-0.362 -0.213,-0.711 -0.41,-1.008 -0.074,-0.11 -0.153,-0.214 -0.238,-0.309 -0.026,-0.029 -0.053,-0.057 -0.08,-0.086 l -0.025,-0.026 v 10e-4 l -0.18,-0.227 c -0.083,-0.106 -0.161,-0.219 -0.23,-0.334 -0.143,-0.233 -0.26,-0.483 -0.349,-0.744 -0.223,-0.654 -0.261,-1.359 -0.109,-2.037 0.084,-0.378 0.229,-0.742 0.429,-1.083 0.208,-0.351 0.47,-0.665 0.779,-0.932 0.323,-0.28 0.687,-0.5 1.081,-0.656 0.429,-0.17 0.884,-0.257 1.352,-0.26 h 0.026 c 0.482,0 0.951,0.09 1.397,0.269 0.473,0.19 0.913,0.483 1.274,0.848 0.383,0.388 0.682,0.862 0.865,1.371 0.203,0.566 0.267,1.184 0.184,1.786 -0.066,0.477 -0.221,0.931 -0.461,1.349 -0.117,0.204 -0.256,0.4 -0.413,0.584 l -0.073,0.089 0.005,0.01 -0.002,0.006 0.007,0.002 0.017,0.033 0.035,0.065 -0.091,-0.085 -0.053,0.057 c -0.051,0.06 -0.101,0.12 -0.148,0.182 -0.091,0.121 -0.173,0.253 -0.243,0.391 -0.067,0.13 -0.125,0.27 -0.172,0.417 -0.038,0.116 -0.068,0.239 -0.091,0.363 -0.018,0.097 -0.031,0.196 -0.039,0.294 -0.052,0.624 0.082,1.281 0.385,1.901 0.109,0.221 0.239,0.436 0.386,0.639 0.031,0.043 0.064,0.085 0.096,0.127 0.032,0.041 0.055,0.069 0.09,0.102 0.025,0.023 0.051,0.045 0.078,0.063 0.079,0.054 0.172,0.091 0.27,0.106 0.02,0.003 0.04,0.004 0.06,0.005 l 0.038,0.003 h 6.454 C -0.981,-1.113 -0.465,-0.57 0,0" /></g>
</g></g></g></svg>

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,24 @@
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="main.css">
<script src="roslib.js"></script>
</head>
<body>
<div class="telemetry"><span class="mode">DISCONNECTED</span></div>
<div class="battery"></div>
<div class="logo"></div>
<div class="container">
<div class="stick stick-left">
<div class="stick-pointer"></div>
</div>
<div class="stick stick-right">
<div class="stick-pointer"></div>
</div>
</div>
<div class="notifications"></div>
<script src="main.js" type="text/javascript"></script>
<script src="telemetry.js" type="text/javascript"></script>
</body>
</html>

125
apps/ios/cleverrc/main.css Normal file
View File

@@ -0,0 +1,125 @@
html, body {
margin: 0;
padding: 0;
user-select: none;
font-family: sans-serif;
background: #212121;
color: rgba(255, 255, 255, 0.9);
}
* {
user-select: none;
}
.stick {
border-radius: 50%;
width: 5cm;
height: 5cm;
position: relative;
transform: translateZ(0);
border: 4px solid rgba(255,255,255,.4);
box-shadow: 0 0 0 1px rgba(0,0,0,.2), inset 0 0 0 1px rgba(0,0,0,.2);
}
.stick-pointer {
position: absolute;
border-radius: 50%;
background-color: rgba(255,255,255,.25);
box-shadow: 0 0 10px rgba(0,0,0,.3);
width: 3cm;
height: 3cm;
margin-left: -1.5cm;
margin-top: -1.5cm;
top: 2.5cm;
left: 2.5cm;
pointer-events: none;
transform: translateZ(0);
}
.container {
display: flex;
justify-content: space-around;
align-items: center;
width: 100%;
height: 100%;
}
.telemetry {
position: absolute;
text-align: center;
width: 100%;
top: 30px;
font-size: 20px;
user-select: none;
pointer-events: none;
}
body.armed .telemetry .mode {
font-weight: bold;
}
@keyframes scale {
0% { transform: scale(1.0); }
50% { transform: scale(1.2); }
100% { transform: scale(1.0); }
}
.battery {
position: absolute;
text-align: center;
width: 100%;
bottom: 30px;
font-size: 20px;
user-select: none;
pointer-events: none;
}
body.low-battery .battery {
color: #ff554b;
animation: scale 0.3s 1 ease-in-out
}
.logo {
position: absolute;
background: url(clever.svg);
-webkit-background-size: 50px;
background-size: 50px;
width: 50px;
height: 50px;
top: 50%;
left: 50%;
margin-top: -25px;
margin-left: -25px;
font-size: 20px;
user-select: none;
pointer-events: none;
}
.notifications {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
right: 0;
color: white;
}
.notifications.hidden {
transform: translateY(-100%);
}
.notifications.anim {
transition: transform 0.2s ease;
}
.notifications .item {
font-size: 4mm;
-webkit-text-size-adjust: none;
background: #fca83a;
padding: 3mm;
padding-bottom: 1.5mm;
}
.notifications .item:last-child {
padding-bottom: 3mm;
}

126
apps/ios/cleverrc/main.js Normal file
View File

@@ -0,0 +1,126 @@
function throttle(func, ms) {
var isThrottled = false,
savedArgs,
savedThis;
function wrapper() {
if (isThrottled) {
savedArgs = arguments;
savedThis = this;
return;
}
func.apply(this, arguments);
isThrottled = true;
setTimeout(function() {
isThrottled = false;
if (savedArgs) {
wrapper.apply(savedThis, savedArgs);
savedArgs = savedThis = null;
}
}, ms);
}
return wrapper;
}
function callNativeApp(name, msg) {
try {
webkit.messageHandlers[name].postMessage(msg);
return true;
} catch(err) {
console.warn('The native context does not exist yet');
return false;
}
}
var rcLastPublish = null;
function rcPublish() {
callNativeApp('control', controlMessage);
rcLastPublish = new Date();
}
rcPublishThrottled = throttle(rcPublish, 30);
setInterval(function() {
if (rcLastPublish !== null && new Date() - rcLastPublish > 800) {
rcPublishThrottled();
}
}, 50);
var body = document.querySelector('body');
var stickLeft = document.querySelector('.stick-left');
var stickRight = document.querySelector('.stick-right');
var controlMessage = { x: 0, y: 0, z: 0, r: 0 };
function onStickTouchMove(touch) {
var target = touch.target;
var targetRect = target.getBoundingClientRect();
var stickPointer = target.querySelector('.stick-pointer');
var offsetX = touch.clientX - targetRect.left;
var offsetY = touch.clientY - targetRect.top;
var x = 2 * offsetX / targetRect.width;
var y = 2 * offsetY / targetRect.height;
x = Math.max(0, x);
x = Math.min(2, x);
y = Math.max(0, y);
y = Math.min(2, y);
stickPointer.style.left = (x * 50) + '%';
stickPointer.style.top = (y * 50) + '%';
x -= 1;
y = 1 - y;
if (target.matches('.stick-left')) {
controlMessage.z = Math.round((y + 1) * 500);
controlMessage.r = Math.round(x * 1000);
} else if (target.matches('.stick-right')) {
controlMessage.x = Math.round(y * 1000);
controlMessage.y = Math.round(x * 1000);
}
}
body.addEventListener('touchmove', function (e) {
e.preventDefault();
});
function stickTouchStart(e) {
setControlMode();
callNativeApp('controlStart');
onStickTouchMove(e.changedTouches[0]);
rcPublishThrottled();
e.stopPropagation();
e.preventDefault();
}
function stickTouchMove(e) {
onStickTouchMove(e.changedTouches[0]);
rcPublishThrottled();
e.stopPropagation();
e.preventDefault();
}
function stickTouchEnd(e) {
var pointer = e.target.querySelector('.stick-pointer');
if (e.target.matches('.stick-left')) {
controlMessage.r = 0;
pointer.style.left = '50%';
} else if (e.target.matches('.stick-right')) {
controlMessage.x = 0;
controlMessage.y = 0;
pointer.style.left = '50%';
pointer.style.top = '50%';
}
rcPublishThrottled();
}
stickLeft.addEventListener('touchmove', stickTouchMove);
stickRight.addEventListener('touchmove', stickTouchMove);
stickLeft.addEventListener('touchstart', stickTouchStart);
stickRight.addEventListener('touchstart', stickTouchStart);
stickLeft.addEventListener('touchend', stickTouchEnd);
stickRight.addEventListener('touchend', stickTouchEnd);

3693
apps/ios/cleverrc/roslib.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,115 @@
var url = 'ws://192.168.11.1:9090';
var modeEl = document.querySelector('.telemetry .mode');
var batteryEl = document.querySelector('.battery');
var notificationsEl = document.querySelector('.notifications');
var ros = new ROSLIB.Ros({ url: url });
ros.on('connection', function () {
body.classList.add('connected');
});
ros.on('close', function () {
body.classList.remove('connected');
modeEl.classList.remove('armed');
modeEl.innerHTML = 'DISCONNECTED';
batteryEl.innerHTML = '';
setTimeout(function() {
modeEl.innerHTML = 'RECONNECTING';
ros.connect(url);
}, 2000);
});
var fcuState;
new ROSLIB.Topic({
ros: ros,
name: '/state_latched',
messageType: 'mavros_msgs/State'
}).subscribe(function(message) {
body.classList.toggle('fcu-disconnected', !message.connected);
body.classList.toggle('armed', message.armed);
fcuState = message;
modeEl.classList.toggle('armed', fcuState.armed);
modeEl.innerHTML = message.connected ? fcuState.mode : 'DISCONNECTED FROM FCU';
console.log('state', message);
});
function notifyLowBattery() {
console.log('low battery');
callNativeApp('lowBattery');
body.classList.remove('low-battery');
void body.offsetWidth; // trick for repeating animation
body.classList.add('low-battery');
}
notifyLowBatteryThrottled = throttle(notifyLowBattery, 15000);
new ROSLIB.Topic({
ros: ros,
name: '/mavros/battery',
messageType: 'sensor_msgs/BatteryState',
throttle_rate: 5000
}).subscribe(function(message) {
var LOW_BATTERY = 3.8;
batteryEl.innerHTML = (message.cell_voltage[0].toFixed(2) + ' V') || '';
if (message.cell_voltage[0] < LOW_BATTERY) {
notifyLowBatteryThrottled();
} else {
body.classList.remove('low-battery');
}
});
var notificationHideTimer;
function notify(text, severity) {
var item = document.createElement('div');
item.innerHTML = text;
item.classList.add('item');
notificationsEl.prepend(item);
var itemHeight = item.offsetHeight;
notificationsEl.classList.remove('anim');
notificationsEl.style.transform = 'translateY(' + -itemHeight + 'px)';
setTimeout(function() {
notificationsEl.classList.add('anim');
notificationsEl.style.transform = 'translateY(0)';
}, 0);
clearTimeout(notificationHideTimer);
notificationHideTimer = setTimeout(function() {
notificationsEl.style.transform = '';
notificationsEl.classList.add('hidden');
setTimeout(function() {
notificationsEl.innerHTML = '';
}, 210);
}, 4000);
}
new ROSLIB.Topic({
ros: ros,
name: '/mavros/statustext/recv',
messageType: 'mavros_msgs/StatusText'
}).subscribe(function(message) {
var BLACKLIST = ['CMD: ', 'PR: ', 'DROPPED', 'Clock skew detected', 'MANUAL CONTROL LOST'];
if (message.severity <= 4) {
if (BLACKLIST.some(function(e) {
return message.text.indexOf(e) != -1;
})) {
console.log('Filtered out message ' + message.text);
return;
}
notify(message.text, message.severity);
callNativeApp('notification', message);
}
});
var setMode = new ROSLIB.Service({
ros: ros,
name : '/mavros/set_mode',
serviceType : 'mavros_msgs/SetMode'
});
function setControlMode() {
var CONTROL_MODE = 'STABILIZED';
setMode.callService(new ROSLIB.ServiceRequest({ custom_mode: CONTROL_MODE }));
}

View File

@@ -16,6 +16,11 @@
#include <stdio.h>
#include <tf/transform_broadcaster.h>
#include "util.h"
using std::vector;
using std::string;
namespace aruco_pose {
class ArucoPose : public nodelet::Nodelet {
@@ -100,6 +105,45 @@ cv::Ptr<cv::aruco::Board> createCustomGridBoard(int markersX, int markersY, floa
return res;
}
cv::Ptr<cv::aruco::Board> createCustomBoard(std::map<string, string> markers, const cv::Ptr<cv::aruco::Dictionary> &dictionary) {
cv::Ptr<cv::aruco::Board> res = cv::makePtr<cv::aruco::Board>();
res->dictionary = dictionary;
size_t total_markers = markers.size();
res->ids.reserve(total_markers);
res->objPoints.reserve(total_markers);
// Generate ids and objPoints
for(auto const &marker : markers) {
res->ids.push_back(std::stoi(marker.first));
vector<string> parts;
parts = strSplit(marker.second, " ");
float size = std::stof(parts.at(0));
float x = std::stof(parts.at(1));
float y = std::stof(parts.at(2));
float z = std::stof(parts.at(3));
float yaw = std::stof(parts.at(4));
float pitch = std::stof(parts.at(5));
float roll = std::stof(parts.at(6));
vector<cv::Point3f> corners;
corners.resize(4);
corners[0] = cv::Point3f(x - size / 2, y + size / 2, 0);
corners[1] = corners[0] + cv::Point3f(size, 0, 0);
corners[2] = corners[0] + cv::Point3f(size, -size, 0);
corners[3] = corners[0] + cv::Point3f(0, -size, 0);
// TODO: process yaw, pitch, roll
res->objPoints.push_back(corners);
}
return res;
}
#include "fix.cpp"
void ArucoPose::createBoard()
@@ -178,8 +222,22 @@ void ArucoPose::createBoard()
}
else if (type == "custom")
{
// Not implemented yet
ROS_FATAL("Custom boards are not implemented yet.");
ROS_INFO("Initialize a custom board");
std::map<string, string> markers;
nh_priv_.getParam("markers", markers);
board = createCustomBoard(markers, dictionary);
ROS_INFO("Draw a custom board");
// Publish map image for debugging
_drawPlanarBoard(board, cv::Size(2000, 2000), map_image, 50, 1);
cv::cvtColor(map_image, map_image, CV_GRAY2BGR);
map_image_msg.encoding = sensor_msgs::image_encodings::BGR8;
map_image_msg.image = map_image;
map_image_pub.publish(map_image_msg.toImageMsg());
}
else
{
@@ -214,10 +272,12 @@ void ArucoPose::detect(const sensor_msgs::ImageConstPtr& msg, const sensor_msgs:
cv::Mat distCoeffs(8, 1, CV_64F);
parseCameraInfo(cinfo, cameraMatrix, distCoeffs);
int valid = 0;
cv::Mat rvec, tvec, objPoints;
if (markerIds.size() > 0) {
cv::Mat rvec, tvec, objPoints;
int valid = _estimatePoseBoard(markerCorners, markerIds, board, cameraMatrix, distCoeffs,
valid = _estimatePoseBoard(markerCorners, markerIds, board, cameraMatrix, distCoeffs,
rvec, tvec, false, objPoints);
if (valid) {
@@ -243,18 +303,16 @@ void ArucoPose::detect(const sensor_msgs::ImageConstPtr& msg, const sensor_msgs:
ref_transform.setOrigin(ref_vector3);
ref_transform.setRotation(q);
br.sendTransform(ref_transform);
if(img_pub.getNumSubscribers() > 0)
{
// Publish debug image
cv::aruco::drawDetectedMarkers(image, markerCorners, markerIds);
cv::aruco::drawAxis(image, cameraMatrix, distCoeffs, rvec, tvec, 0.3);
}
}
}
if (img_pub.getNumSubscribers() > 0)
{
cv::aruco::drawDetectedMarkers(image, markerCorners, markerIds); // draw markers
if (valid)
{
cv::aruco::drawAxis(image, cameraMatrix, distCoeffs, rvec, tvec, 0.3); // draw board axis
}
cv_bridge::CvImage out_msg;
out_msg.header.frame_id = msg->header.frame_id;
out_msg.header.stamp = msg->header.stamp;

20
aruco_pose/src/util.h Normal file
View File

@@ -0,0 +1,20 @@
#pragma once
#include <vector>
#include <string>
std::vector<std::string> strSplit(const std::string& str, const std::string& delim)
{
std::vector<std::string> tokens;
size_t prev = 0, pos = 0;
do
{
pos = str.find(delim, prev);
if (pos == std::string::npos) pos = str.length();
std::string token = str.substr(prev, pos-prev);
if (!token.empty()) tokens.push_back(token);
prev = pos + delim.length();
}
while (pos < str.length() && prev < str.length());
return tokens;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

View File

@@ -3,5 +3,20 @@
"description": "Конструктор квадрокоптера «Клевер»",
"author": "Copter Express",
"language": "ru",
"plugins": ["youtube", "richquotes"]
}
"root": "docs/",
"plugins": ["youtube", "richquotes", "versions", "yametrika"],
"pluginsConfig": {
"disqus": {
"shortName": "coex-clever"
},
"versions": {
"type": "tags"
},
"yametrika": {
"id": 49359238
}
},
"structure": {
"glossary": "_GLOSSARY.md"
}
}

View File

@@ -11,6 +11,7 @@ find_package(catkin REQUIRED COMPONENTS
nodelet
pluginlib
roscpp
genmsg
rospy
std_msgs
message_generation
@@ -68,15 +69,11 @@ add_service_files(
FILES
GetTelemetry.srv
Navigate.srv
NavigateGlobal.srv
SetPosition.srv
SetPositionYawRate.srv
SetPositionGlobal.srv
SetPositionGlobalYawRate.srv
SetVelocity.srv
SetVelocityYawRate.srv
SetAttitude.srv
SetAttitudeYawRate.srv
SetRatesYaw.srv
SetRates.srv
)
@@ -157,7 +154,9 @@ add_library(aruco_vpe
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/clever_node.cpp)
add_executable(rc src/rc.cpp)
target_link_libraries(rc ${catkin_LIBRARIES})
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the

View File

@@ -8,6 +8,7 @@
<arg name="rosbridge" default="true"/>
<arg name="main_camera" default="true"/>
<arg name="aruco" default="false"/>
<arg name="rc" value="true"/>
<arg name="fpv_camera" default="false"/>
<arg name="fpv_camera_device" default="/dev/v4l/by-id/usb-HD_Camera_Manufacturer_USB_2.0_Camera-video-index0"/>
<arg name="arduino" default="false"/>
@@ -46,7 +47,10 @@
<include file="$(find clever)/launch/main_camera.launch" if="$(arg main_camera)"/>
<!-- rosbridge -->
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" if="$(arg rosbridge)"/>
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" if="$(eval rosbridge or rc)"/>
<!-- rc backend -->
<node name="rc" pkg="clever" type="rc" output="screen" if="$(arg rc)"/>
<!-- FPV video streaming -->
<include file="$(find clever)/launch/fpv_camera.launch" if="$(arg fpv_camera)">

View File

@@ -3,8 +3,9 @@
<arg name="fcu_ip" default="127.0.0.1"/>
<arg name="gcs_bridge" default="tcp"/>
<arg name="viz" default="true"/>
<arg name="respawn" default="true"/>
<node pkg="mavros" type="mavros_node" name="mavros" required="false" clear_params="true" output="screen">
<node pkg="mavros" type="mavros_node" name="mavros" required="false" clear_params="true" respawn="$(arg respawn)" respawn_delay="5" output="screen">
<!-- UART connection -->
<param name="fcu_url" value="/dev/ttyAMA0:921600" if="$(eval fcu_conn is None or fcu_conn == 'uart')"/>
@@ -16,8 +17,12 @@
<!-- gcs bridge -->
<param name="gcs_url" value="tcp-l://0.0.0.0:5760" if="$(eval gcs_bridge == 'tcp')"/>
<param name="gcs_url" value="udp://@192.168.11.14:14550" if="$(eval gcs_bridge == 'udp')"/> <!-- TODO: fix -->
<param name="gcs_url" value="udp://0.0.0.0:14550@14550" if="$(eval gcs_bridge == 'udp')"/>
<param name="gcs_url" value="udp-b://$(env ROS_IP):14550@14550" if="$(eval gcs_bridge == 'udp-b')"/>
<param name="gcs_url" value="udp-pb://$(env ROS_IP):14550@14550" if="$(eval gcs_bridge == 'udp-pb')"/>
<param name="gcs_url" value="" if="$(eval not gcs_bridge)"/>
<param name="gcs_quiet_mode" value="true"/>
<param name="conn/timeout" value="8"/>
<!-- default px4 params -->
<rosparam command="load" file="$(find mavros)/launch/px4_config.yaml"/>
@@ -28,6 +33,7 @@
<param name="local_position/tf/frame_id" value="local_origin"/>
<param name="local_position/tf/child_frame_id" value="fcu"/>
<param name="global_position/tf/send" value="false"/>
<param name="imu/frame_id" value="fcu"/>
<rosparam param="plugin_blacklist">
- safety_area
- image_pub
@@ -37,7 +43,6 @@
- 3dr_radio
- actuator_control
- hil_controls
- manual_control
- vfr_hud
- px4flow
- vision_speed_estimate

View File

@@ -1,2 +1,3 @@
flask==0.12.2
geopy==1.11.0
pymavlink==2.2.10

View File

@@ -20,14 +20,15 @@ using std::string;
class ArucoVPE : public nodelet::Nodelet
{
public:
ArucoVPE() :
ArucoVPE() :
last_published_(0),
lookup_timeout_(0.05)
{}
private:
private:
ros::Time last_published_;
ros::Duration lookup_timeout_;
ros::Duration reset_timeout_;
ros::Publisher vision_position_pub_;
ros::Timer dummy_vision_timer_;
string aruco_orientation_;
@@ -42,6 +43,9 @@ private:
bool use_mocap;
nh_priv.param<bool>("use_mocap", use_mocap, false);
nh_priv.param<bool>("reset_vpe", reset_vpe_, !use_mocap);
double reset_timeout;
nh_priv.param("reset_timeout", reset_timeout, 2.0);
reset_timeout_ = ros::Duration(reset_timeout);
static ros::Subscriber pose_sub = nh.subscribe("mavros/local_position/pose", 1, &ArucoVPE::handlePose, this);
static ros::Subscriber aruco_pose_sub = nh.subscribe("aruco_pose/pose", 1, &ArucoVPE::handleArucoPose, this);
@@ -100,7 +104,7 @@ private:
br.sendTransform(t);
if (last_published_.toSec() == 0 || // no vpe has been posted
(reset_vpe_ && (ros::Time::now() - last_published_ > ros::Duration(2)))) // vpe origin outdated
(reset_vpe_ && (ros::Time::now() - last_published_ > reset_timeout_))) // vpe origin outdated
{
ROS_INFO("Reset VPE");
t = tf_buffer.lookupTransform("local_origin", "aruco_map_vision", stamp, lookup_timeout_);

View File

@@ -9,8 +9,15 @@ from sensor_msgs.msg import NavSatFix
def global_to_local(lat, lon):
# TODO: refactor
position_global = rospy.wait_for_message('mavros/global_position/global', NavSatFix, timeout=5)
pose = rospy.wait_for_message('mavros/local_position/pose', PoseStamped, timeout=5)
try:
position_global = rospy.wait_for_message('mavros/global_position/global', NavSatFix, timeout=0.5)
except rospy.exceptions.ROSException:
raise Exception('No global position')
try:
pose = rospy.wait_for_message('mavros/local_position/pose', PoseStamped, timeout=0.5)
except rospy.exceptions.ROSException:
raise Exception('No local position')
d = math.hypot(pose.pose.position.x, pose.pose.position.y)

173
clever/src/rc.cpp Normal file
View File

@@ -0,0 +1,173 @@
// CLEVER mobile remote control support:
// * Send ManualControl messages through UDP
// * `latched_state` topic
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <thread>
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "mavros_msgs/State.h"
#include "mavros_msgs/ManualControl.h"
#include "mavros_msgs/Mavlink.h"
struct ControlMessage
{
int16_t x, y, z, r;
} __attribute__((packed));
class RC
{
public:
RC():
nh(),
nh_priv("~")
{
// Create socket thread
std::thread t(&RC::socketThread, this);
t.detach();
std::thread gcst(&RC::fakeGCSThread, this);
gcst.detach();
initLatchedState();
}
private:
ros::NodeHandle nh, nh_priv;
ros::Subscriber state_sub;
ros::Publisher state_pub;
ros::Timer state_timeout_timer;
ros::Time last_manual_control{0};
mavros_msgs::StateConstPtr state_msg;
void handleState(const mavros_msgs::StateConstPtr& state)
{
state_timeout_timer.setPeriod(ros::Duration(3), true);
state_timeout_timer.start();
if (!state_msg ||
state->connected != state_msg->connected ||
state->mode != state_msg->mode ||
state->armed != state_msg->armed) {
state_msg = state;
state_pub.publish(state_msg);
}
}
void stateTimedOut(const ros::TimerEvent&)
{
ROS_INFO("State timeout");
mavros_msgs::State unknown_state;
state_pub.publish(unknown_state);
state_msg = nullptr;
}
void initLatchedState()
{
state_sub = nh.subscribe("mavros/state", 1, &RC::handleState, this);
state_pub = nh.advertise<mavros_msgs::State>("state_latched", 1, true);
state_timeout_timer = nh.createTimer(ros::Duration(0), &RC::stateTimedOut, this, true, false);
// Publish initial state
mavros_msgs::State unknown_state;
state_pub.publish(unknown_state);
}
void fakeGCSThread()
{
// Awful workaround for fixing PX4 not sending STATUSTEXTs
// if there is no GCS hearbeats.
// TODO: use timer
// TODO: remove, when PX4 get this fixed.
ros::Publisher mavlink_pub = nh.advertise<mavros_msgs::Mavlink>("mavlink/to", 1);
// HEARTBEAT from GCS message
mavros_msgs::Mavlink hb;
hb.framing_status = mavros_msgs::Mavlink::FRAMING_OK;
hb.magic = mavros_msgs::Mavlink::MAVLINK_V20;
hb.len = 9;
hb.incompat_flags = 0;
hb.compat_flags = 0;
hb.seq = 0;
hb.sysid = 255;
hb.compid = 0;
hb.checksum = 26460;
hb.payload64.push_back(342282393542983680);
hb.payload64.push_back(3);
ros::Rate rate(1);
while (ros::ok()) {
if (ros::Time::now() - last_manual_control < ros::Duration(8)) {
mavlink_pub.publish(hb);
}
rate.sleep();
}
}
int createSocket(int port)
{
int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
sockaddr_in sin;
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_ANY);
sin.sin_port = htons(port);
if (bind(sockfd, (sockaddr *)&sin, sizeof(sin)) < 0) {
ROS_FATAL("socket bind error: %s", strerror(errno));
close(sockfd);
ros::shutdown();
}
return sockfd;
}
void socketThread()
{
int port;
nh_priv.param("port", port, 35602);
int sockfd = createSocket(port);
char buff[9999];
ros::Publisher manual_control_pub = nh.advertise<mavros_msgs::ManualControl>("mavros/manual_control/send", 1);
mavros_msgs::ManualControl manual_control_msg;
sockaddr_in client_addr;
socklen_t client_addr_size = sizeof(client_addr);
ROS_INFO("UDP RC initialized on port %d", port);
while (true) {
// read next UDP packet
int bsize = recvfrom(sockfd, &buff[0], sizeof(buff) - 1, 0, (sockaddr *) &client_addr, &client_addr_size);
if (bsize < 0) {
ROS_ERROR("recvfrom() error: %s", strerror(errno));
} else if (bsize != sizeof(ControlMessage)) {
ROS_ERROR_THROTTLE(30, "Wrong UDP packet size: %d", bsize);
}
// unpack message
// warning: ignore endianness, so the code is platform-dependent
ControlMessage *msg = (ControlMessage *)buff;
manual_control_msg.x = msg->x;
manual_control_msg.y = msg->y;
manual_control_msg.z = msg->z;
manual_control_msg.r = msg->r;
manual_control_pub.publish(manual_control_msg);
last_manual_control = ros::Time::now();
}
}
};
int main(int argc, char **argv)
{
ros::init(argc, argv, "rc");
RC rc;
ros::spin();
}

109
clever/src/selfcheck.py Executable file
View File

@@ -0,0 +1,109 @@
#!/usr/bin/env python
import rospy
from std_srvs.srv import Trigger
from sensor_msgs.msg import Image, CameraInfo, NavSatFix, Imu
from mavros_msgs.msg import State
from geometry_msgs.msg import PoseStamped, TwistStamped
# TODO: roscore is running
# TODO: local_origin, fcu, fcu_horiz
# TODO: rc service
# TODO: perform commander check in PX4
rospy.init_node('selfcheck')
def check_fcu():
try:
state = rospy.wait_for_message('mavros/state', State, timeout=3)
if not state.connected:
raise Exception('No connection to the FCU')
except rospy.ROSException:
raise Exception('No MAVROS state')
def check_camera(name):
try:
rospy.wait_for_message(name + '/image_raw', Image, timeout=3)
except rospy.ROSException:
raise Exception('No %s camera images' % name)
try:
rospy.wait_for_message(name + '/camera_info', CameraInfo, timeout=3)
except rospy.ROSException:
raise Exception('No %s camera camera info' % name)
def check_aruco():
try:
rospy.wait_for_message('aruco_pose/debug', Image, timeout=3)
except rospy.ROSException:
raise Exception('No aruco_pose/debug topic')
def check_simpleoffboard():
try:
rospy.wait_for_service('navigate', timeout=3)
rospy.wait_for_service('get_telemetry', timeout=3)
rospy.wait_for_service('land', timeout=3)
except rospy.ROSException:
raise Exception('No simple_offboard services')
def check_imu():
try:
rospy.wait_for_message('mavros/imu/data', Imu, timeout=3)
except rospy.ROSException:
raise Exception('No IMU data')
def check_local_position():
try:
rospy.wait_for_message('mavros/local_position/pose', PoseStamped, timeout=3)
except rospy.ROSException:
raise Exception('No local position')
def check_velocity():
try:
velocity = rospy.wait_for_message('mavros/local_position/velocity', TwistStamped, timeout=3)
horiz = math.hypot(velocity.twist.linear.x, velocity.twist.linear.y)
vert = velocity.twist.linear.z
if abs(horiz) > 0.1:
raise Exception('Horizontal velocity estimation is %s m/s; is the copter staying still?' % horiz)
if abs(vert) > 0.1:
raise Exception('Vertical velocity estimation is %s m/s; is the copter staying still?' % vert)
except rospy.ROSException:
raise Exception('No velocity estimation')
def check_global_position():
try:
rospy.wait_for_message('mavros/global_position/global', PoseStamped, timeout=3)
except rospy.ROSException:
raise Exception('No global position')
def check(name, fn):
try:
fn()
rospy.loginfo('%s: OK', name)
except BaseException as e:
rospy.logwarn('%s: %s', name, str(e))
def selfcheck():
check('FCU', check_fcu)
check('Simple offboard node', check_simpleoffboard)
check('Main camera node', lambda: check_camera('main_camera'))
check('aruco_pose/debug topic', check_aruco)
check('IMU data', check_imu)
check('Local position', check_local_position)
check('Velocity estimation', check_velocity)
check('Global position (GPS)', check_global_position)
if __name__ == '__main__':
rospy.loginfo('Performing selfcheck...')
selfcheck()

View File

@@ -2,7 +2,8 @@
from __future__ import division
import rospy
from geometry_msgs.msg import TransformStamped, PoseStamped, Point, PointStamped, Vector3, Vector3Stamped, TwistStamped, QuaternionStamped
from geometry_msgs.msg import TransformStamped, PoseStamped, Point, PointStamped, Vector3, \
Vector3Stamped, TwistStamped, QuaternionStamped
from sensor_msgs.msg import NavSatFix, BatteryState
import tf2_ros
import tf2_geometry_msgs
@@ -75,12 +76,19 @@ rospy.Subscriber('/mavros/global_position/global', NavSatFix, global_position_up
rospy.Subscriber('/mavros/battery', BatteryState, battery_update)
PT = PositionTarget
AT = AttitudeTarget
AUTO_OFFBOARD = rospy.get_param('~auto_offboard', True)
AUTO_ARM = AUTO_OFFBOARD and rospy.get_param('~auto_arm', True)
OFFBOARD_TIMEOUT = rospy.Duration(rospy.get_param('~offboard_timeout', 3))
ARM_TIMEOUT = rospy.Duration(rospy.get_param('~arm_timeout', 5))
LOCAL_POSITION_TIMEOUT = rospy.Duration(rospy.get_param('~local_position_timeout', 0.5))
NAVIGATE_AFTER_ARMED = rospy.Duration(rospy.get_param('~navigate_after_armed', False))
TRANSFORM_TIMEOUT = rospy.Duration(rospy.get_param('~transform_timeout', 3))
SETPOINT_RATE = rospy.get_param('~setpoint_rate', 30)
LOCAL_FRAME = rospy.get_param('~local_frame', 'local_origin')
LAND_MODE = rospy.get_param('~land_mode', 'AUTO.LAND')
LAND_TIMEOUT = rospy.Duration(rospy.get_param('~land_timeout', 2))
def offboard_and_arm():
@@ -95,6 +103,7 @@ def offboard_and_arm():
break
if rospy.get_rostime() - start > OFFBOARD_TIMEOUT:
raise Exception('OFFBOARD request timed out')
rospy.sleep(0.1)
if AUTO_ARM and not state.armed:
rospy.loginfo('Arming')
@@ -104,9 +113,9 @@ def offboard_and_arm():
while True:
if state.armed:
return True
if rospy.get_rostime() - start > ARM_TIMEOUT:
raise Exception('Arming timed out')
rospy.sleep(0.1)
ps = PoseStamped()
@@ -149,143 +158,84 @@ def get_publisher_and_message(req, stamp, continued=True, update_frame=True):
ps.header.stamp = stamp
vs.header.stamp = stamp
if isinstance(req, srv.NavigateRequest):
if isinstance(req, (srv.NavigateRequest, srv.NavigateGlobalRequest)):
global current_nav_start, current_nav_start_stamp, current_nav_finish
if update_frame:
ps.header.frame_id = req.frame_id or 'local_origin'
ps.pose.position = Point(req.x, req.y, req.z)
ps.header.frame_id = req.frame_id or LOCAL_FRAME
ps.pose.position = Point(getattr(req, 'x', 0), getattr(req, 'y', 0), req.z)
ps.pose.orientation = orientation_from_euler(0, 0, req.yaw)
current_nav_finish = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
current_nav_finish = tf_buffer.transform(ps, LOCAL_FRAME, TRANSFORM_TIMEOUT)
if isinstance(req, srv.NavigateGlobalRequest):
# Recalculate x and y from lat and lon
current_nav_finish.pose.position.x, current_nav_finish.pose.position.y = \
global_to_local(req.lat, req.lon)
if not continued:
current_nav_start = pose.pose.position
current_nav_start_stamp = stamp
if NAVIGATE_AFTER_ARMED and not state.armed:
current_nav_start_stamp = stamp
setpoint = get_navigate_setpoint(stamp, current_nav_start, current_nav_finish.pose.position,
current_nav_start_stamp, req.speed)
msg = PositionTarget(coordinate_frame=PositionTarget.FRAME_LOCAL_NED,
type_mask=PositionTarget.IGNORE_VX + PositionTarget.IGNORE_VY + PositionTarget.IGNORE_VZ +
PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ +
PositionTarget.IGNORE_YAW_RATE,
yaw_rate_flag = math.isnan(req.yaw)
msg = PositionTarget(coordinate_frame=PT.FRAME_LOCAL_NED,
type_mask=PT.IGNORE_VX + PT.IGNORE_VY + PT.IGNORE_VZ +
PT.IGNORE_AFX + PT.IGNORE_AFY + PT.IGNORE_AFZ +
(PT.IGNORE_YAW if yaw_rate_flag else PT.IGNORE_YAW_RATE),
position=setpoint,
yaw=euler_from_orientation(current_nav_finish.pose.orientation)[2] - math.pi / 2)
return position_pub, msg
elif isinstance(req, srv.SetPositionRequest):
ps.header.frame_id = req.frame_id or 'local_origin'
ps.pose.position = Point(req.x, req.y, req.z)
ps.pose.orientation = orientation_from_euler(0, 0, req.yaw)
pose_local = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
msg = PositionTarget(coordinate_frame=PositionTarget.FRAME_LOCAL_NED,
type_mask=PositionTarget.IGNORE_VX + PositionTarget.IGNORE_VY + PositionTarget.IGNORE_VZ +
PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ +
PositionTarget.IGNORE_YAW_RATE,
position=pose_local.pose.position,
yaw=euler_from_orientation(pose_local.pose.orientation)[2] - math.pi / 2)
return position_pub, msg
elif isinstance(req, srv.SetPositionYawRateRequest):
ps.header.frame_id = req.frame_id or 'local_origin'
ps.pose.position = Point(req.x, req.y, req.z)
pose_local = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
msg = PositionTarget(coordinate_frame=PositionTarget.FRAME_LOCAL_NED,
type_mask=PositionTarget.IGNORE_VX + PositionTarget.IGNORE_VY + PositionTarget.IGNORE_VZ +
PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ +
PositionTarget.IGNORE_YAW,
position=pose_local.pose.position,
yaw=euler_from_orientation(current_nav_finish.pose.orientation, 'szyx')[2] - math.pi / 2,
yaw_rate=req.yaw_rate)
return position_pub, msg
elif isinstance(req, srv.SetPositionGlobalRequest):
x, y = global_to_local(req.lat, req.lon)
ps.header.frame_id = req.frame_id or 'local_origin'
ps.pose.position = Point(0, 0, req.z)
elif isinstance(req, (srv.SetPositionRequest, srv.SetPositionGlobalRequest)):
ps.header.frame_id = req.frame_id or LOCAL_FRAME
ps.pose.position = Point(getattr(req, 'x', 0), getattr(req, 'y', 0), req.z)
ps.pose.orientation = orientation_from_euler(0, 0, req.yaw)
pose_local = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
pose_local.pose.position.x = x
pose_local.pose.position.y = y
pose_local = tf_buffer.transform(ps, LOCAL_FRAME, TRANSFORM_TIMEOUT)
msg = PositionTarget(coordinate_frame=PositionTarget.FRAME_LOCAL_NED,
type_mask=PositionTarget.IGNORE_VX + PositionTarget.IGNORE_VY + PositionTarget.IGNORE_VZ +
PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ +
PositionTarget.IGNORE_YAW_RATE,
position=pose_local.pose.position,
yaw=euler_from_orientation(pose_local.pose.orientation)[2] - math.pi / 2)
return position_pub, msg
elif isinstance(req, srv.SetPositionGlobalYawRateRequest):
x, y = global_to_local(req.lat, req.lon)
ps.header.frame_id = req.frame_id or 'local_origin'
ps.pose.position = Point(0, 0, req.z)
pose_local = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
pose_local.pose.position.x = x
pose_local.pose.position.y = y
msg = PositionTarget(coordinate_frame=PositionTarget.FRAME_LOCAL_NED,
type_mask=PositionTarget.IGNORE_VX + PositionTarget.IGNORE_VY + PositionTarget.IGNORE_VZ +
PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ +
PositionTarget.IGNORE_YAW,
if isinstance(req, srv.SetPositionGlobalRequest):
pose_local.pose.position.x, pose_local.pose.position.y = global_to_local(req.lat, req.lon)
yaw_rate_flag = math.isnan(req.yaw)
msg = PositionTarget(coordinate_frame=PT.FRAME_LOCAL_NED,
type_mask=PT.IGNORE_VX + PT.IGNORE_VY + PT.IGNORE_VZ +
PT.IGNORE_AFX + PT.IGNORE_AFY + PT.IGNORE_AFZ +
(PT.IGNORE_YAW if yaw_rate_flag else PT.IGNORE_YAW_RATE),
position=pose_local.pose.position,
yaw=euler_from_orientation(pose_local.pose.orientation, 'szyx')[2] - math.pi / 2,
yaw_rate=req.yaw_rate)
return position_pub, msg
elif isinstance(req, srv.SetVelocityRequest):
vs.vector = Vector3(req.vx, req.vy, req.vz)
vs.header.frame_id = req.frame_id or 'local_origin'
ps.header.frame_id = req.frame_id or 'local_origin'
vs.header.frame_id = req.frame_id or LOCAL_FRAME
ps.header.frame_id = req.frame_id or LOCAL_FRAME
ps.pose.orientation = orientation_from_euler(0, 0, req.yaw)
pose_local = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
vector_local = tf_buffer.transform(vs, 'local_origin', TRANSFORM_TIMEOUT)
msg = PositionTarget(coordinate_frame=PositionTarget.FRAME_LOCAL_NED,
type_mask=PositionTarget.IGNORE_PX + PositionTarget.IGNORE_PY + PositionTarget.IGNORE_PZ +
PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ +
PositionTarget.IGNORE_YAW_RATE,
velocity=vector_local.vector,
yaw=euler_from_orientation(pose_local.pose.orientation)[2] - math.pi / 2)
return position_pub, msg
pose_local = tf_buffer.transform(ps, LOCAL_FRAME, TRANSFORM_TIMEOUT)
vector_local = tf_buffer.transform(vs, LOCAL_FRAME, TRANSFORM_TIMEOUT)
elif isinstance(req, srv.SetVelocityYawRateRequest):
vs.vector = Vector3(req.vx, req.vy, req.vz)
vs.header.frame_id = req.frame_id or 'local_origin'
vector_local = tf_buffer.transform(vs, 'local_origin', TRANSFORM_TIMEOUT)
msg = PositionTarget(coordinate_frame=PositionTarget.FRAME_LOCAL_NED,
type_mask=PositionTarget.IGNORE_PX + PositionTarget.IGNORE_PY + PositionTarget.IGNORE_PZ +
PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ +
PositionTarget.IGNORE_YAW,
yaw_rate_flag = math.isnan(req.yaw)
msg = PositionTarget(coordinate_frame=PT.FRAME_LOCAL_NED,
type_mask=PT.IGNORE_PX + PT.IGNORE_PY + PT.IGNORE_PZ +
PT.IGNORE_AFX + PT.IGNORE_AFY + PT.IGNORE_AFZ +
(PT.IGNORE_YAW if yaw_rate_flag else PT.IGNORE_YAW_RATE),
velocity=vector_local.vector,
yaw=euler_from_orientation(pose_local.pose.orientation, 'szyx')[2] - math.pi / 2,
yaw_rate=req.yaw_rate)
return position_pub, msg
elif isinstance(req, srv.SetAttitudeRequest):
ps.header.frame_id = req.frame_id or 'local_origin'
ps.header.frame_id = req.frame_id or LOCAL_FRAME
ps.pose.orientation = orientation_from_euler(req.roll, req.pitch, req.yaw)
pose_local = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
pose_local = tf_buffer.transform(ps, LOCAL_FRAME, TRANSFORM_TIMEOUT)
msg = AttitudeTarget(orientation=pose_local.pose.orientation,
thrust=req.thrust,
type_mask=AttitudeTarget.IGNORE_YAW_RATE + AttitudeTarget.IGNORE_PITCH_RATE +
AttitudeTarget.IGNORE_ROLL_RATE)
return attitude_pub, msg
elif isinstance(req, srv.SetAttitudeYawRateRequest):
msg = AttitudeTarget(orientation=orientation_from_euler(req.roll, req.pitch, 0),
thrust=req.thrust,
type_mask=AttitudeTarget.IGNORE_PITCH_RATE + AttitudeTarget.IGNORE_ROLL_RATE)
msg.body_rate.z = req.yaw_rate
return attitude_pub, msg
elif isinstance(req, srv.SetRatesYawRequest):
ps.header.frame_id = req.frame_id or 'local_origin'
ps.pose.orientation = orientation_from_euler(0, 0, req.yaw)
pose_local = tf_buffer.transform(ps, 'local_origin', TRANSFORM_TIMEOUT)
msg = AttitudeTarget(orientation=pose_local.pose.orientation,
thrust=req.thrust,
type_mask=AttitudeTarget.IGNORE_YAW_RATE,
body_rate=Vector3(req.roll_rate, req.pitch_rate, 0))
type_mask=AT.IGNORE_YAW_RATE + AT.IGNORE_PITCH_RATE + AT.IGNORE_ROLL_RATE)
return attitude_pub, msg
elif isinstance(req, srv.SetRatesRequest):
@@ -311,10 +261,23 @@ def handle(req):
rospy.logwarn('No connection to the FCU')
return {'message': 'No connection to the FCU'}
if isinstance(req, srv.NavigateRequest) and req.speed <= 0:
if isinstance(req, (srv.NavigateRequest, srv.NavigateGlobalRequest)) and req.speed <= 0:
rospy.logwarn('Navigate speed must be greater than zero, %s passed')
return {'message': 'Navigate speed must be greater than zero, %s passed' % req.speed}
if isinstance(req, (srv.NavigateRequest, srv.NavigateGlobalRequest)) and \
(pose is None or rospy.get_rostime() - pose.header.stamp > LOCAL_POSITION_TIMEOUT):
rospy.logwarn('No local position')
return {'message': 'No local position'}
if getattr(req, 'yaw_rate', 0) != 0 and not math.isnan(getattr(req, 'yaw')):
rospy.logwarn('Yaw value should be NaN for setting yaw rate')
return {'message': 'Yaw value should be NaN for setting yaw rate'}
if math.isnan(getattr(req, 'yaw', 0)) and math.isnan(getattr(req, 'yaw_rate', 0)):
rospy.logwarn('Both yaw and yaw_rate cannot be NaN')
return {'message': 'Both yaw and yaw_rate cannot be NaN'}
try:
with handle_lock:
stamp = rospy.get_rostime()
@@ -340,6 +303,25 @@ def handle(req):
return {'success': False, 'message': str(e)}
def land(req):
if not state or not state.connected:
rospy.logwarn('No connection to the FCU')
return {'message': 'No connection to the FCU'}
rospy.loginfo('Set %s mode', LAND_MODE)
res = set_mode(custom_mode=LAND_MODE)
if not res.mode_sent:
return {'message': 'Cannot send %s mode request' % LAND_MODE}
start = rospy.get_rostime()
while True:
if state.mode == LAND_MODE:
return {'success': True}
if rospy.get_rostime() - start > LAND_TIMEOUT:
return {'message': '%s mode request timed out' % LAND_MODE}
rospy.sleep(0.1)
def release(req):
global current_pub
current_pub = None
@@ -348,27 +330,25 @@ def release(req):
rospy.Service('navigate', srv.Navigate, handle)
rospy.Service('navigate_global', srv.NavigateGlobal, handle)
rospy.Service('set_position', srv.SetPosition, handle)
rospy.Service('set_position/yaw_rate', srv.SetPositionYawRate, handle)
rospy.Service('set_position_global', srv.SetPositionGlobal, handle)
rospy.Service('set_position_global/yaw_rate', srv.SetPositionGlobalYawRate, handle)
rospy.Service('set_velocity', srv.SetVelocity, handle)
rospy.Service('set_velocity/yaw_rate', srv.SetVelocityYawRate, handle)
rospy.Service('set_attitude', srv.SetAttitude, handle)
rospy.Service('set_attitude/yaw_rate', srv.SetAttitudeYawRate, handle)
rospy.Service('set_rates', srv.SetRates, handle)
rospy.Service('set_rates/yaw', srv.SetRatesYaw, handle)
rospy.Service('land', Trigger, land)
rospy.Service('release', Trigger, release)
def get_telemetry(req):
res = {
'frame_id': req.frame_id or 'local_origin',
'frame_id': req.frame_id or LOCAL_FRAME,
'x': float('nan'),
'y': float('nan'),
'z': float('nan'),
'lat': float('nan'),
'lon': float('nan'),
'alt': float('nan'),
'vx': float('nan'),
'vy': float('nan'),
'vz': float('nan'),
@@ -381,7 +361,7 @@ def get_telemetry(req):
'voltage': float('nan'),
'cell_voltage': float('nan')
}
frame_id = req.frame_id or 'local_origin'
frame_id = req.frame_id or LOCAL_FRAME
stamp = rospy.get_rostime()
if pose:
@@ -389,11 +369,9 @@ def get_telemetry(req):
res['x'] = p.pose.position.x
res['y'] = p.pose.position.y
res['z'] = p.pose.position.z
# Get yaw in the request's frame_in
_, _, res['yaw'] = euler_from_orientation(p.pose.orientation)
# Calculate pitch and roll as angles between the pose and fcu_horiz
attitude_pose = tf_buffer.transform(pose, 'fcu_horiz', TRANSFORM_TIMEOUT)
res['roll'], res['pitch'], _ = euler_from_orientation(attitude_pose.pose.orientation)
# Calculate roll pitch and yaw as Tait-Bryan angles, order z-y-x
res['yaw'], res['pitch'], res['roll'] = euler_from_orientation(p.pose.orientation, axes='rzyx')
if velocity:
v = Vector3Stamped()
@@ -404,11 +382,15 @@ def get_telemetry(req):
res['vx'] = linear.vector.x
res['vy'] = linear.vector.y
res['vz'] = linear.vector.z
# TODO pitch_rate, roll_rate, yaw_rate
res['yaw_rate'] = velocity.twist.angular.z
res['pitch_rate'] = velocity.twist.angular.y
res['roll_rate'] = velocity.twist.angular.x
if global_position and stamp - global_position.header.stamp < rospy.Duration(5):
res['lat'] = global_position.latitude
res['lon'] = global_position.longitude
res['alt'] = global_position.altitude
if state:
res['connected'] = state.connected
@@ -441,7 +423,8 @@ def start_loop():
try:
stamp = rospy.get_rostime()
if getattr(current_req, 'update_frame', False) or isinstance(current_req, srv.NavigateRequest):
if getattr(current_req, 'update_frame', False) or \
isinstance(current_req, (srv.NavigateRequest, srv.NavigateGlobalRequest)):
current_pub, current_msg = get_publisher_and_message(current_req, stamp, True,
getattr(current_req, 'update_frame', False))
@@ -451,7 +434,7 @@ def start_loop():
# For monitoring
if isinstance(current_msg, PositionTarget):
p = PoseStamped()
p.header.frame_id = 'local_origin'
p.header.frame_id = LOCAL_FRAME
p.header.stamp = stamp
p.pose.position = current_msg.position
p.pose.orientation = orientation_from_euler(0, 0, current_msg.yaw + math.pi / 2)

View File

@@ -6,8 +6,8 @@ def orientation_from_quaternion(q):
return Quaternion(*q)
def orientation_from_euler(roll, pitch, yaw):
q = t.quaternion_from_euler(roll, pitch, yaw)
def orientation_from_euler(roll, pitch, yaw, axes='rzyx'):
q = t.quaternion_from_euler(roll, pitch, yaw, axes)
return orientation_from_quaternion(q)
@@ -15,9 +15,9 @@ def quaternion_from_orientation(o):
return o.x, o.y, o.z, o.w
def euler_from_orientation(o):
def euler_from_orientation(o, axes='rzyx'):
q = quaternion_from_orientation(o)
return t.euler_from_quaternion(q)
return t.euler_from_quaternion(q, axes)
def vector3_from_point(p):

View File

@@ -7,8 +7,9 @@ string mode
float32 x
float32 y
float32 z
float32 lat
float32 lon
float64 lat
float64 lon
float32 alt
float32 vx
float32 vy
float32 vz

Some files were not shown because too many files have changed in this diff Show More