main
Dependents: 00_yotsuba 200_yotsuba_21 200_yotuba_21_uiChange
robot.cpp
- Committer:
- piroro4560
- Date:
- 2020-01-30
- Revision:
- 1:6a5065829cfc
- Parent:
- 0:3f87ec23c3cf
- Child:
- 2:fc5545ddf69a
File content as of revision 1:6a5065829cfc:
#include "robot.h" robot::robot() : spin(P, I, D, interval), pc(USBTX, USBRX, 115200), shot(kicker), { omni.wheel[0].setRadian(PI/4 * 1); omni.wheel[1].setRadian(PI/4 * 3); omni.wheel[2].setRadian(PI/4 * 5); omni.wheel[3].setRadian(PI/4 * 7); motor[0] = new kohiMD(PA_6); motor[1] = new kohiMD(PA_7); motor[2] = new kohiMD(PA_9); motor[3] = new kohiMD(PB_10); spin.setInputLimits(-180, 180); spin.setOutputLimits(-0.3,0.3); spin.setBias(0); spin.setMode(1); spin.setSetPoint(0); shot.setkickperiod(0.5); shot.setoutputtime(0.01); ui.beep(1000, 1.0); } void robot::chaseBall(float ball_theta, float ball_dis, float r) { theta = ball_theta + ballExtra * ((r > 0) - (r <= 0)); spin.setProcessValue(r); omni.computeCircular( ,spin.compute()); } void robot::lostBall() { } void robot::moveGoal(float r, float goal_size, float goal_) { } void robot::detour() { } void robot::outLine(float r, line) { } void robot::shotBall() { shot.outPut; } void test() { while(1) { for (int i=0; i<4; i++) { motor[i]->setSpeed(0.2); wait(1.0); } for (int i=0; i<4; i++) { motor[i]->setSpeed(-0.2); wait(1.0); } } }