yusuke takahashi
/
TurnShoot
kkkk
Revision 0:271c83fbca24, committed 2013-03-07
- Comitter:
- yusuke_robocup
- Date:
- Thu Mar 07 04:56:37 2013 +0000
- Commit message:
- kkkkk
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 271c83fbca24 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 07 04:56:37 2013 +0000 @@ -0,0 +1,56 @@ +//ball direction +double ball_sankaku[16][2] = { + {0 , 1 }, + {0.390 , 0.920}, + {0.707 , 0.707}, + {0.927 , 0.374}, + {1 , 0 }, + {0.920 ,-0.390}, + {0.707 ,-0.707}, + {0.374 ,-0.927}, + {0 ,-1 }, + {-0.390,-0.920}, + {-0.707,-0.707}, + {-0.927,-0.374}, + {-1 , 0 }, + {-0.920, 0.390}, + {-0.707, 0.707}, + {-0.374, 0.927} +}; + +//turn direction +double turn_sankaku[16][2] = { + { 0 ,0 } + { 0.920,-0.390 } + { 0.707,-0.707 } + { 0.374,-0.927 } + { 0 ,-1 } + {-0.390,-0.920 } + {-0.707,-0.707 } + {-0.927,-0.374 } + {-0.927,-0.374 } + {0.920 ,-0.390 } + {0.707 ,-0.707 } + {0.374 ,-0.927 } + {0 ,-1 } + {-0.390,-0.920 } + {-0.707,-0.707 } + {-0.927,-0.374 } +}; + +if(ballturn){ + if(distance<10){ + x_dista = pow*(-ball_sankaku[direc][0]); + y_dista = pow*(-ball_sankaku[direc][1]); + }else if(distance>30){ + x_dista = pow*(+ball_sankaku[direc][0]); + y_dista = pow*(+ball_sankaku[direc][1]); + } + + x_turn = pow*(turn_sankaku[direc][0]); + y_turn = pow*(turn_sankaku[direc][1]); + + + X = x_dista + x_turn; + Y = y_dista + y_turn; +}
diff -r 000000000000 -r 271c83fbca24 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 07 04:56:37 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b \ No newline at end of file