https://youtu.be/_2e5JkRhnpQ 무더웠던 여름 끝 무렵에 처음 골판지 차체로 밸런싱 로봇을 제작한지 벌써 두어달을 넘기면서 수차례 폐차했다가 다시 부활시켜 동영상에서 마지막 유년기(?)의 모습을 보여 주고 있다. 이미 건물 창밖에는 새빨갛게 물든 단풍이 짱짱 얼어붙을지도 모를 초겨울의 전조를 알리고 있다.  Broking 의 오픈소스로부터 시작했던 밸런싱 로봇도 성능이 많이 업그레이드 되어 이번에 드디어 셀프 드라이빙이 어느 정도 가능해졌다. 영상에서 밸런싱 로빗 setup() 과정에서 예기치 못했던 몸부림이 좀 있는데 확실한 원인을 정확히 못밝히고 있어 못 보여드린 부분이 있는 베타 버전 상태에 머물고 있다. 밸런싱 로봇의 셀프 드라이빙 코딩 자체를 상세히 브리핑하기는 아직 어려우나 대략적인 알고리듬은 다음과 같다. 전원 스위치를 넣고 블루투스 보드 HC-06 의 LED 가 점멸하면 스마트폰 앱에서 신속하게 페어링을 시킨다. 페어링이 성공하자마자 잽싸게 스마트폰 앱에서 STOP 키보드를 눌러둔다. 밸런싱 로빗의 아두이노 코드 loop()에서 STOP 에 해당하는 문자를 전송 받으면 로빗은 막바로 제자리 서기 모드에 돌입한다. 원래 Broking 의 코드 자체가 블루투스로부터 전진이나 후진 신호가 없으면 제자리 서기를 하게끔 코딩되어 있다. 이 사실을 무시하고 임의로 코딩을 해보았더니 아예 일어서지 못하는 증상을 보였다. 그래서 일단 로빗 주행을 위해서는 처음에 무조건적으로 STOP 모드가 작동하도록 코딩해야 한다는 점을 깨닫는데 두 시간을 허비했다. 이 상태에서 millis() 명령을 사용하여 2초씩 전진 후진 좌회전을 되풀이 시켜야 한다. 즉 헤더 영역에 unsigned long 형태의 cmillis(current millis) 와 pmillis(previous millis) 두 개의 변수를 초기화 해두고 intervalF(전진 시간), intervalB(후진 시간), intervalL(좌회전 시간) 을 각각 2초, 4초, 6초로 선언해 둔다. 제자리 서기가 되면 그때부터 pmillis = cmillis 로 두어 셀프 드라이브를 시작한다. 즉 loop() 과정에서 cmillis = millis() 명령을 실행 후 (cmillis – pmillis) < intervalF 이면 2초간 계속 전진 시킨다. 한편 (cmillis – pmillis) > intervalF 이면서 동시에 (cmillis – pmillis) < intervalB 이면 2초간 계속 후진 시킨다. 아울러 (cmillis – pmillis) > intervalB 이면서 동시에 (cmillis – pmillis) < intervalL 이면 2초간 계속 좌회전 시킨다. 마지막으로 (cmillis – pmillis) > intervalB 이면 다시 pmillis = cmillis 로 두어 loop()를 반복한다. 알고리듬 자체가 그다지 복잡하지는 않지만 실제로 해보니 동영상만큼의 성능은 나오지만 초기에 드러누워서 뻣대며 한쪽 바퀴가 도는 고질병이 숨어 있는 상태이다. 좀 더 코드 알고리듬을 검토해야 할 부분이다. 아직 미완성 상태여서 굳이 코드를 첨부하지 못함을 양해 바란다.
author | codingart |
---|---|
permlink | 157 |
category | kr |
json_metadata | {"tags":["kr","kr-newbie","manamine","jjangjjangman","kr-dev"],"image":["https://img.youtube.com/vi/_2e5JkRhnpQ/0.jpg","https://cdn.steemitimages.com/DQmaRyVLrDPDtBkkaSPJj5Qm6df8ofzxG2FXzyFsG3GW1H4/noname01.png"],"links":["https://youtu.be/_2e5JkRhnpQ"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-10-29 01:37:27 |
last_update | 2018-10-29 02:05:36 |
depth | 0 |
children | 6 |
last_payout | 2018-11-05 01:37:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 8.923 HBD |
curator_payout_value | 2.836 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,700 |
author_reputation | 41,833,111,979,966 |
root_title | "아두이노 코딩-157: 밸런싱 로빗의 셀프 주행" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,244,740 |
net_rshares | 10,141,873,791,770 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
eforucom | 0 | 2,898,273,977 | 1% | ||
steemitboard | 0 | 13,900,110,894 | 1% | ||
wony | 0 | 231,642,597,856 | 30% | ||
catchawhale | 0 | 3,951,253,573 | 1% | ||
virus707 | 0 | 7,047,653,698,954 | 50% | ||
beoped | 0 | 32,055,160,995 | 20% | ||
bramd | 0 | 2,568,459,603,367 | 30% | ||
shammi | 0 | 920,656,915 | 1% | ||
steemtaker | 0 | 771,603,791 | 1% | ||
urobotics | 0 | 7,660,900,816 | 100% | ||
jesusjacr | 0 | 368,483,165 | 0.34% | ||
hansangyou | 0 | 68,261,467,175 | 25% | ||
sd974201 | 0 | 2,194,604,272 | 7% | ||
angelinafx | 0 | 1,384,551,634 | 1% | ||
anpigon | 0 | 12,202,287,909 | 50% | ||
merry1990 | 0 | 509,312,862 | 100% | ||
inn25 | 0 | 509,202,503 | 100% | ||
amaratonna | 0 | 509,050,894 | 100% | ||
desp-er | 0 | 509,039,621 | 100% | ||
pairplay | 0 | 20,597,565,788 | 10% | ||
minasyandianna | 0 | 508,406,658 | 100% | ||
bornd07 | 0 | 508,411,236 | 100% | ||
dinsipov00 | 0 | 508,561,265 | 100% | ||
vorovskoy44 | 0 | 508,378,541 | 100% | ||
eclipticsecond | 0 | 508,856,015 | 100% | ||
soleelephant | 0 | 508,295,788 | 100% | ||
codingart | 0 | 10,610,976,815 | 100% | ||
carsonbak | 0 | 508,348,497 | 100% | ||
mmmagazine | 0 | 33,298,802,070 | 100% | ||
berwynelbow | 0 | 508,020,988 | 100% | ||
dreadfulfilk | 0 | 508,661,276 | 100% | ||
decagonour | 0 | 508,364,856 | 100% | ||
samakovgor | 0 | 508,652,135 | 100% | ||
albinakarimova | 0 | 509,019,434 | 100% | ||
dotfanning | 0 | 509,071,137 | 100% | ||
donortopmast | 0 | 509,198,452 | 100% | ||
milkyteammate | 0 | 509,160,439 | 100% | ||
relaxrepeat | 0 | 509,291,172 | 100% | ||
cappedscramble | 0 | 509,404,077 | 100% | ||
bubblyhexes | 0 | 509,452,928 | 100% | ||
lotgreasy | 0 | 509,454,376 | 100% | ||
rydbergactinium | 0 | 509,296,488 | 100% | ||
olivineplot | 0 | 509,176,287 | 100% | ||
boriskamiran | 0 | 509,084,991 | 100% | ||
synonymsdiapir | 0 | 509,658,014 | 100% | ||
spicedwave | 0 | 509,796,156 | 100% | ||
lobestay | 0 | 509,536,198 | 100% | ||
tillerthey | 0 | 509,912,300 | 100% | ||
devsup | 0 | 2,775,317,891 | 0.69% | ||
strelkaworkshop | 0 | 15,041,289,681 | 100% | ||
nfc | 0 | 11,859,711,806 | 1% | ||
optimizer | 0 | 1,987,415,537 | 2.5% | ||
tonkaerobics | 0 | 512,587,716 | 100% | ||
inningreactivity | 0 | 512,497,834 | 100% | ||
helpscode | 0 | 512,518,126 | 100% | ||
ivan.rogach | 0 | 512,237,951 | 100% | ||
toxa555 | 0 | 512,674,164 | 100% | ||
pectoralwake | 0 | 512,640,021 | 100% | ||
outsidevoting | 0 | 512,378,229 | 100% | ||
leveretwit | 0 | 512,545,588 | 100% | ||
bitok.xyz | 0 | 8,963,686,536 | 1% | ||
monarija620 | 0 | 3,824,488,690 | 100% | ||
whitebot | 0 | 19,219,126,450 | 1% |
화이팅!
author | hansangyou |
---|---|
permlink | re-codingart-157-20181029t134647713z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2018-10-29 13:46:57 |
last_update | 2018-10-29 13:46:57 |
depth | 1 |
children | 1 |
last_payout | 2018-11-05 13:46:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4 |
author_reputation | 21,053,903,109,698 |
root_title | "아두이노 코딩-157: 밸런싱 로빗의 셀프 주행" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,277,080 |
net_rshares | 0 |
녜 고마워요!
author | codingart |
---|---|
permlink | re-hansangyou-re-codingart-157-20181029t142225735z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2018-10-29 14:22:27 |
last_update | 2018-10-29 14:22:27 |
depth | 2 |
children | 0 |
last_payout | 2018-11-05 14:22:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 7 |
author_reputation | 41,833,111,979,966 |
root_title | "아두이노 코딩-157: 밸런싱 로빗의 셀프 주행" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,279,155 |
net_rshares | 0 |
미니 자율주행차인가요?
author | jyinvest |
---|---|
permlink | re-codingart-157-20181029t032234657z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2018-10-29 03:22:36 |
last_update | 2018-10-29 03:22:36 |
depth | 1 |
children | 1 |
last_payout | 2018-11-05 03:22:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 12 |
author_reputation | 25,687,578,009,800 |
root_title | "아두이노 코딩-157: 밸런싱 로빗의 셀프 주행" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,248,701 |
net_rshares | 0 |
아직 자율 주행은 아니구요 코드에 주어진 순서대로 주행하는 셀프 주행 수준이에요.
author | codingart |
---|---|
permlink | re-jyinvest-re-codingart-157-20181029t045426964z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2018-10-29 04:54:27 |
last_update | 2018-10-29 04:54:27 |
depth | 2 |
children | 0 |
last_payout | 2018-11-05 04:54:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 45 |
author_reputation | 41,833,111,979,966 |
root_title | "아두이노 코딩-157: 밸런싱 로빗의 셀프 주행" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,252,268 |
net_rshares | 0 |
Congratulations @codingart! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) : <table><tr><td>https://steemitimages.com/60x60/http://steemitboard.com/notifications/postallweek.png</td><td>You published a post every day of the week</td></tr> </table> <sub>_[Click here to view your Board of Honor](https://steemitboard.com/@codingart)_</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> To support your work, I also upvoted your post! **Do not miss the last post from @steemitboard:** <table><tr><td><a href="https://steemit.com/halloween/@steemitboard/trick-or-treat-publish-your-scariest-halloweeen-story-and-win-a-new-badge"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/RUyB3u.png"></a></td><td><a href="https://steemit.com/halloween/@steemitboard/trick-or-treat-publish-your-scariest-halloweeen-story-and-win-a-new-badge">Trick or Treat - Publish your scariest halloween story and win a new badge</a></td></tr><tr><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-notifications-improved"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/NgygYH.png"></a></td><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-notifications-improved">SteemitBoard notifications improved</a></td></tr></table> > Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
author | steemitboard |
---|---|
permlink | steemitboard-notify-codingart-20181029t035605000z |
category | kr |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2018-10-29 03:56:06 |
last_update | 2018-10-29 03:56:06 |
depth | 1 |
children | 0 |
last_payout | 2018-11-05 03:56:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,617 |
author_reputation | 38,975,615,169,260 |
root_title | "아두이노 코딩-157: 밸런싱 로빗의 셀프 주행" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,249,934 |
net_rshares | 0 |
멋지네요 ㅋㅋ 드디어 로봇이
author | urobotics |
---|---|
permlink | re-codingart-157-20181029t025348336z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2018-10-29 02:53:51 |
last_update | 2018-10-29 02:53:51 |
depth | 1 |
children | 0 |
last_payout | 2018-11-05 02:53:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 15 |
author_reputation | 14,923,860,622,500 |
root_title | "아두이노 코딩-157: 밸런싱 로빗의 셀프 주행" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,247,611 |
net_rshares | 0 |