2016a/Member/kodamanma/Mission1
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
#contents
はじめに
「お絵かきロボット」を作る課題~
先生曰く「グループ三人の中で誰か識別できる程度の顔を描き...
ほかの制限は
・マクロや関数、サブルーチンなどを使い、main関数がなるべ...
・定数名やマクロなどは分かりやすい名前を用いること~
・余裕をもってA4の紙の中に収まる大きさにすること。いくら...
・ペン以外はキットの部品を使うこと~
いや〜きついっす(素)
課題自体は3週間ほど前から提示されてましたがEV3班は%%見捨...
ロボットの説明と開発環境
今回使用したキットは教育版レゴ社マインドストーム EV3を使...
今回、先生から開発環境やプログラミング言語の支持がなかっ...
ペンはアームを動かすことで上げ下げできるようにしました~
このペンの上げ下げが僕らを苦しめることになるがそれは後述~
http://gazo.shitao.info/r/i/20160609164843_000.jpg
モーターは車輪を動かす用のモーターを2つと、アーム用のモー...
EV3のOSは「linax debian」を使用~
パソコン側はwindows8.1だとEV3との通信の互換性が悪いと聞い...
「Tera Term」というソフトウェアを使用しwin8.1からEV3に転...
開発言語も最初はC#を使用する予定でしたが最終的にはpython...
プログラム
・定義~
m1 = ev3.LargeMotor('outA')
m2 = ev3.LargeMotor('outB')
m3 = ev3.MediumMotor('outC')
ts = time.sleep
m1stop = m1.stop(stop_command='brake')
m2stop = m2.stop(stop_command='brake')
m3stop = m3.stop(stop_command='brake')
m1run = m1.run_forever
m2run = m2.run_forever
m3run = m3.run_forever
↑これが定義文です~
これを利用すれば例えば『ev3.LargeMotor('outA')』と書かな...
「LargeMotor」は車輪用の大きなモーターのことです~
これは先生から教えてもらっていたので大丈夫だったのですが...
「でかいのが『Large』なんだから小さい方は『Small』じゃね」~
普通そうなるよね、でもこれ「MediumMotor」だったの%%モータ...
http://gazo.shitao.info/r/i/20160609200225_000.jpg
↑アーム周りの動作ギミック~
このペンの上げ下げの動作ですが、重力の関係からかアームを...
例~
m1run(duty_cycle_sp=『数字』)←これで『数字』%のパワーでモ...
m1stop←これでモーター1を急停止~
ts(『数字』)←これで『数字』秒間動作を継続~
これらを利用して
m1run(duty_cycle_sp=『70』)~
m2run(duty_cycle_sp=『70』)~
ts(3.0)~
m1stop~
m2stop~
これで「左右のモーターを70%の力で3.0秒間前進した後急停止...
その他、m1run(duty_cycle_sp=『正の実数』)でペンを持ち上げ...
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜...
ここからは実践編です~
m1run(duty_cycle_sp=70)
m2run(duty_cycle_sp=-20)
ts(0.4)
m1run(duty_cycle_sp=90)
m2run(duty_cycle_sp=20)
ts(0.7)
m1run(duty_cycle_sp=70)
m2run(duty_cycle_sp=-20)
ts(0.8)
m1run(duty_cycle_sp=-30)
m2run(duty_cycle_sp=1)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=30)
m2run(duty_cycle_sp=35)
ts(2.0)
m1stop
m2stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-25)
ts(0.5)
m1run(duty_cycle_sp=50)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=0)
ts(1.0)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.6)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-25)
ts(0.5)
m1run(duty_cycle_sp=30)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=0)
ts(0.6)
m1stop
m2stop
m3stop
ts(0.3)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1run(duty_cycle_sp=-30)
m2run(duty_cycle_sp=-30)
m3run(duty_cycle_sp=0)
ts(1.0)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-25)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.15)
m1stop
m2stop
m3stop
ts(0.1)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=90)
m2run(duty_cycle_sp=30)
m3run(duty_cycle_sp=0)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-30)
m2run(duty_cycle_sp=-30)
m3run(duty_cycle_sp=0)
ts(0.65)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-30)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.3)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1run(duty_cycle_sp=-50)
m2run(duty_cycle_sp=-50)
m3run(duty_cycle_sp=0)
ts(0.4)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-30)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.3)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=55)
ts(0.2)
m1run(duty_cycle_sp=90)
m2run(duty_cycle_sp=-90)
m3run(duty_cycle_sp=0)
ts(1.0)
m1run(duty_cycle_sp=-90)
m2run(duty_cycle_sp=90)
m3run(duty_cycle_sp=0)
ts(1.0)
m1stop
m2stop
m3stop
ts(1)
このプログラムで%%何度も繰り返し動作させて最も良く%%描け...
http://gazo.shitao.info/r/i/20160609201643_000.jpg
別の試し描きの線と被ってしまっていますが、輪郭があって、%...
確かに人の顔です~
苦節12時間、努力した甲斐がありました
問題点とその反省
今回人の顔は描けましたが、誰だかわかるほど細かくかけてい...
多くのRCX班やNXT班が制作したロボットと比べて、わたしたち...
そのため回転最小半径が大きくなってしまったのが絵の大型化...
あってはならないはずのおまけ
「今日は徹夜だな、初徹夜記念に撮っとくか」「うえーい」~
http://gazo.shitao.info/r/i/20160609211102_000.jpg~
↓~
「徹夜でパソコンいじりながらカップラーメンとか俺ら工学部...
http://gazo.shitao.info/r/i/20160609211947_000.jpg~
↓~
深夜テンション~
http://gazo.shitao.info/r/i/20160609212025_000.jpg
~
~
~
健気に絵を描くEV3さんに愛着すら湧いてきます~
http://gazo.shitao.info/r/i/20160609210342_000.jpg
http://gazo.shitao.info/r/i/20160609210413_000.jpg
終了行:
#contents
はじめに
「お絵かきロボット」を作る課題~
先生曰く「グループ三人の中で誰か識別できる程度の顔を描き...
ほかの制限は
・マクロや関数、サブルーチンなどを使い、main関数がなるべ...
・定数名やマクロなどは分かりやすい名前を用いること~
・余裕をもってA4の紙の中に収まる大きさにすること。いくら...
・ペン以外はキットの部品を使うこと~
いや〜きついっす(素)
課題自体は3週間ほど前から提示されてましたがEV3班は%%見捨...
ロボットの説明と開発環境
今回使用したキットは教育版レゴ社マインドストーム EV3を使...
今回、先生から開発環境やプログラミング言語の支持がなかっ...
ペンはアームを動かすことで上げ下げできるようにしました~
このペンの上げ下げが僕らを苦しめることになるがそれは後述~
http://gazo.shitao.info/r/i/20160609164843_000.jpg
モーターは車輪を動かす用のモーターを2つと、アーム用のモー...
EV3のOSは「linax debian」を使用~
パソコン側はwindows8.1だとEV3との通信の互換性が悪いと聞い...
「Tera Term」というソフトウェアを使用しwin8.1からEV3に転...
開発言語も最初はC#を使用する予定でしたが最終的にはpython...
プログラム
・定義~
m1 = ev3.LargeMotor('outA')
m2 = ev3.LargeMotor('outB')
m3 = ev3.MediumMotor('outC')
ts = time.sleep
m1stop = m1.stop(stop_command='brake')
m2stop = m2.stop(stop_command='brake')
m3stop = m3.stop(stop_command='brake')
m1run = m1.run_forever
m2run = m2.run_forever
m3run = m3.run_forever
↑これが定義文です~
これを利用すれば例えば『ev3.LargeMotor('outA')』と書かな...
「LargeMotor」は車輪用の大きなモーターのことです~
これは先生から教えてもらっていたので大丈夫だったのですが...
「でかいのが『Large』なんだから小さい方は『Small』じゃね」~
普通そうなるよね、でもこれ「MediumMotor」だったの%%モータ...
http://gazo.shitao.info/r/i/20160609200225_000.jpg
↑アーム周りの動作ギミック~
このペンの上げ下げの動作ですが、重力の関係からかアームを...
例~
m1run(duty_cycle_sp=『数字』)←これで『数字』%のパワーでモ...
m1stop←これでモーター1を急停止~
ts(『数字』)←これで『数字』秒間動作を継続~
これらを利用して
m1run(duty_cycle_sp=『70』)~
m2run(duty_cycle_sp=『70』)~
ts(3.0)~
m1stop~
m2stop~
これで「左右のモーターを70%の力で3.0秒間前進した後急停止...
その他、m1run(duty_cycle_sp=『正の実数』)でペンを持ち上げ...
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜...
ここからは実践編です~
m1run(duty_cycle_sp=70)
m2run(duty_cycle_sp=-20)
ts(0.4)
m1run(duty_cycle_sp=90)
m2run(duty_cycle_sp=20)
ts(0.7)
m1run(duty_cycle_sp=70)
m2run(duty_cycle_sp=-20)
ts(0.8)
m1run(duty_cycle_sp=-30)
m2run(duty_cycle_sp=1)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=-40)
m2run(duty_cycle_sp=0)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=-40)
ts(0.4)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=30)
m2run(duty_cycle_sp=35)
ts(2.0)
m1stop
m2stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-25)
ts(0.5)
m1run(duty_cycle_sp=50)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=0)
ts(1.0)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.6)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-25)
ts(0.5)
m1run(duty_cycle_sp=30)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=0)
ts(0.6)
m1stop
m2stop
m3stop
ts(0.3)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1run(duty_cycle_sp=-30)
m2run(duty_cycle_sp=-30)
m3run(duty_cycle_sp=0)
ts(1.0)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-25)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.15)
m1stop
m2stop
m3stop
ts(0.1)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=90)
m2run(duty_cycle_sp=30)
m3run(duty_cycle_sp=0)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-30)
m2run(duty_cycle_sp=-30)
m3run(duty_cycle_sp=0)
ts(0.65)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-30)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.3)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=50)
ts(0.1)
m1run(duty_cycle_sp=-50)
m2run(duty_cycle_sp=-50)
m3run(duty_cycle_sp=0)
ts(0.4)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=-30)
ts(0.5)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=-20)
m2run(duty_cycle_sp=-20)
m3run(duty_cycle_sp=0)
ts(0.3)
m1stop
m2stop
m3stop
ts(0.2)
m1run(duty_cycle_sp=0)
m2run(duty_cycle_sp=0)
m3run(duty_cycle_sp=55)
ts(0.2)
m1run(duty_cycle_sp=90)
m2run(duty_cycle_sp=-90)
m3run(duty_cycle_sp=0)
ts(1.0)
m1run(duty_cycle_sp=-90)
m2run(duty_cycle_sp=90)
m3run(duty_cycle_sp=0)
ts(1.0)
m1stop
m2stop
m3stop
ts(1)
このプログラムで%%何度も繰り返し動作させて最も良く%%描け...
http://gazo.shitao.info/r/i/20160609201643_000.jpg
別の試し描きの線と被ってしまっていますが、輪郭があって、%...
確かに人の顔です~
苦節12時間、努力した甲斐がありました
問題点とその反省
今回人の顔は描けましたが、誰だかわかるほど細かくかけてい...
多くのRCX班やNXT班が制作したロボットと比べて、わたしたち...
そのため回転最小半径が大きくなってしまったのが絵の大型化...
あってはならないはずのおまけ
「今日は徹夜だな、初徹夜記念に撮っとくか」「うえーい」~
http://gazo.shitao.info/r/i/20160609211102_000.jpg~
↓~
「徹夜でパソコンいじりながらカップラーメンとか俺ら工学部...
http://gazo.shitao.info/r/i/20160609211947_000.jpg~
↓~
深夜テンション~
http://gazo.shitao.info/r/i/20160609212025_000.jpg
~
~
~
健気に絵を描くEV3さんに愛着すら湧いてきます~
http://gazo.shitao.info/r/i/20160609210342_000.jpg
http://gazo.shitao.info/r/i/20160609210413_000.jpg
ページ名: