2019a/Member/mistral/Mission1
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[2019a/Member]]
#contents
*課題 [#t61fd7f7]
課題については[[2019a/Mission1]]を参照。
**選んだ言葉 [#gde8c1b4]
私は今年一年過ごすこの街、「松本」を選んだ。
*ロボットについて [#m0feb2e3]
#ref(2019a/Member/mistral/Mission1/line_264297717068338.jpg,50%)
ペンが両タイヤの中心に来るように置き、ペンが軸となるようにすることでペンが降りている状態でも回転することが出来るようにした...と思っていた。
#ref(2019a/Member/mistral/Mission1/kikou.jpg,50%)
これがペンを上下する機巧である。ペンの上下とロボットの動きで文字を書くようにした。
*プログラミングから実行へ [#w1c6addc]
**始まり [#j28f09dd]
まず直線を二種類、90度の右回転と左回転を調べ定義した。このとき直線と回転を連続して行うと、調べたときの動きをせず、行動と行動の間に停止させる必要があることにきづく。
その後、文字をこのようにした。
**プログラムの説明 [#necb9f57]
はじめに定義した四種のdefineに加え、さらにペンの上下と他四種を定義した。
#define t_l90 OnFwd(OUT_A);OnRev(OUT_C);Off(OUT_B);Wait(22);Off(OUT_ABC);//左回転(90度)
#define t_l OnFwd(OUT_A);OnRev(OUT_C);Off(OUT_B);//左回転
#define t_r90 OnFwd(OUT_C);OnRev(OUT_A);Off(OUT_B);Wait(23);Off(OUT_ABC);//右回転(90度)
#define t_r OnFwd(OUT_C);OnRev(OUT_A);Off(OUT_B);//右回転
#define str2 OnFwd(OUT_AC);Off(OUT_B);Wait(6);Off(OUT_ABC);//直進2
#define str1 OnFwd(OUT_AC);Off(OUT_B);Wait(3);Off(OUT_ABC);//直進1
#define back OnRev(OUT_AC);Off(OUT_B);//後退
#define stopABC Off(OUT_ABC);Wait(100);//停止
#define up OnFwd (OUT_B);Wait(5);Off(OUT_B);//ペンを上げる
#define down OnRev(OUT_B);Wait(4);Off(OUT_B);//ペンを下げる
#ref(2019a/Member/mistral/Mission1/20190806_174003 (2).jpg,10%)
#ref(2019a/Member/mistral/Mission1/20190806_174430 (2).jpg,10%)
黒の矢印が筆を下ろした状態での動き~
赤の矢印が筆を上げた状態での動き
松を書くためのプログラミング~
黒の1
task main()
{ stopABC
str2
赤の1
stopABC
up
stopABC
t_r
Wait(36);
back
Wait(3);
黒の2
stopABC
down
stopABC
str1
str2
str2
赤の2
stopABC
up
stopABC
back
Wait(12);
stopABC
t_r
Wait(6);
黒の3
stopABC
down
stopABC
str2
stopABC
back
Wait(8);
stopABC
t_l
Wait(10);
stopABC
str2
赤の3
stopABC
up
stopABC
back
Wait(8);
stopABC
t_l
Wait(42);
stopABC
str2
str1
黒の4
stopABC
down
stopABC
str2
赤の4
stopABC
up
stopABC
str1
t_r90
黒の5
stopABC
down
stopABC
str2
赤の5
stopABC
up
stopABC
back
Wait(6);
stopABC
t_r
Wait(32);
stopABC
str2
黒の6
stopABC
down
stopABC
str2
stopABC
t_l
Wait(45);
stopABC
str2
stopABC
t_r90
stopABC
str2
back
Wait(8);
赤の6
stopABC
up
stopABC
back
Wait(10);
stopABC
t_l
Wait(28);
stopABC
str2
str2
本を書くためのプログラミング~
黒の7
stopABC
down
stopABC
str2
str2
赤の7
stopABC
up
back
Wait(3);
stopABC
t_r
Wait(36);
back
Wait(3);
黒の8
stopABC
down
stopABC
str2
str2
str1
赤の8
stopABC
up
back
Wait(15);
stopABC
t_r
Wait(16);
黒の9
stopABC
down
str2
str2
stopABC
back
Wait(14);
stopABC
t_l90
stopABC
str2
str2
赤の9
stopABC
up
stopABC
back
Wait(6);
t_r
Wait(35);
stopABC
str1
黒の10
stopABC
down
stopABC
str2
stopABC
up
}
**書けた文字 [#l40017c4]
#ref(2019a/Member/mistral/Mission1/line_264311116808594.jpg,50%)
#ref(2019a/Member/mistral/Mission1/line_264312742630572.jpg,50%)
同じプログラムでこれだけの差が出来てしまった。この理由として次のことが考えられる。
+タイヤがきちんと固定されていない
+紙をとめているテープで滑ってしまっている
+バッテリーが書くごとに下がっている
*まとめと感想 [#t5b7b318]
思った通りになかなか動いてもらえず苦労した。同じプログラムで異なる動きを見せたときは、それはもう困った。完璧にはほど遠いが、読めるくらいまでになったことはとても感動している。
終了行:
[[2019a/Member]]
#contents
*課題 [#t61fd7f7]
課題については[[2019a/Mission1]]を参照。
**選んだ言葉 [#gde8c1b4]
私は今年一年過ごすこの街、「松本」を選んだ。
*ロボットについて [#m0feb2e3]
#ref(2019a/Member/mistral/Mission1/line_264297717068338.jpg,50%)
ペンが両タイヤの中心に来るように置き、ペンが軸となるようにすることでペンが降りている状態でも回転することが出来るようにした...と思っていた。
#ref(2019a/Member/mistral/Mission1/kikou.jpg,50%)
これがペンを上下する機巧である。ペンの上下とロボットの動きで文字を書くようにした。
*プログラミングから実行へ [#w1c6addc]
**始まり [#j28f09dd]
まず直線を二種類、90度の右回転と左回転を調べ定義した。このとき直線と回転を連続して行うと、調べたときの動きをせず、行動と行動の間に停止させる必要があることにきづく。
その後、文字をこのようにした。
**プログラムの説明 [#necb9f57]
はじめに定義した四種のdefineに加え、さらにペンの上下と他四種を定義した。
#define t_l90 OnFwd(OUT_A);OnRev(OUT_C);Off(OUT_B);Wait(22);Off(OUT_ABC);//左回転(90度)
#define t_l OnFwd(OUT_A);OnRev(OUT_C);Off(OUT_B);//左回転
#define t_r90 OnFwd(OUT_C);OnRev(OUT_A);Off(OUT_B);Wait(23);Off(OUT_ABC);//右回転(90度)
#define t_r OnFwd(OUT_C);OnRev(OUT_A);Off(OUT_B);//右回転
#define str2 OnFwd(OUT_AC);Off(OUT_B);Wait(6);Off(OUT_ABC);//直進2
#define str1 OnFwd(OUT_AC);Off(OUT_B);Wait(3);Off(OUT_ABC);//直進1
#define back OnRev(OUT_AC);Off(OUT_B);//後退
#define stopABC Off(OUT_ABC);Wait(100);//停止
#define up OnFwd (OUT_B);Wait(5);Off(OUT_B);//ペンを上げる
#define down OnRev(OUT_B);Wait(4);Off(OUT_B);//ペンを下げる
#ref(2019a/Member/mistral/Mission1/20190806_174003 (2).jpg,10%)
#ref(2019a/Member/mistral/Mission1/20190806_174430 (2).jpg,10%)
黒の矢印が筆を下ろした状態での動き~
赤の矢印が筆を上げた状態での動き
松を書くためのプログラミング~
黒の1
task main()
{ stopABC
str2
赤の1
stopABC
up
stopABC
t_r
Wait(36);
back
Wait(3);
黒の2
stopABC
down
stopABC
str1
str2
str2
赤の2
stopABC
up
stopABC
back
Wait(12);
stopABC
t_r
Wait(6);
黒の3
stopABC
down
stopABC
str2
stopABC
back
Wait(8);
stopABC
t_l
Wait(10);
stopABC
str2
赤の3
stopABC
up
stopABC
back
Wait(8);
stopABC
t_l
Wait(42);
stopABC
str2
str1
黒の4
stopABC
down
stopABC
str2
赤の4
stopABC
up
stopABC
str1
t_r90
黒の5
stopABC
down
stopABC
str2
赤の5
stopABC
up
stopABC
back
Wait(6);
stopABC
t_r
Wait(32);
stopABC
str2
黒の6
stopABC
down
stopABC
str2
stopABC
t_l
Wait(45);
stopABC
str2
stopABC
t_r90
stopABC
str2
back
Wait(8);
赤の6
stopABC
up
stopABC
back
Wait(10);
stopABC
t_l
Wait(28);
stopABC
str2
str2
本を書くためのプログラミング~
黒の7
stopABC
down
stopABC
str2
str2
赤の7
stopABC
up
back
Wait(3);
stopABC
t_r
Wait(36);
back
Wait(3);
黒の8
stopABC
down
stopABC
str2
str2
str1
赤の8
stopABC
up
back
Wait(15);
stopABC
t_r
Wait(16);
黒の9
stopABC
down
str2
str2
stopABC
back
Wait(14);
stopABC
t_l90
stopABC
str2
str2
赤の9
stopABC
up
stopABC
back
Wait(6);
t_r
Wait(35);
stopABC
str1
黒の10
stopABC
down
stopABC
str2
stopABC
up
}
**書けた文字 [#l40017c4]
#ref(2019a/Member/mistral/Mission1/line_264311116808594.jpg,50%)
#ref(2019a/Member/mistral/Mission1/line_264312742630572.jpg,50%)
同じプログラムでこれだけの差が出来てしまった。この理由として次のことが考えられる。
+タイヤがきちんと固定されていない
+紙をとめているテープで滑ってしまっている
+バッテリーが書くごとに下がっている
*まとめと感想 [#t5b7b318]
思った通りになかなか動いてもらえず苦労した。同じプログラムで異なる動きを見せたときは、それはもう困った。完璧にはほど遠いが、読めるくらいまでになったことはとても感動している。
ページ名: