ライブラリ化を行った後
Dependencies: QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo
Fork of 17robo_Practice1 by
Diff: main.cpp
- Revision:
- 52:f5ae47e683fa
- Parent:
- 51:70d45b959d6b
- Child:
- 53:701dc7886fff
diff -r 70d45b959d6b -r f5ae47e683fa main.cpp --- a/main.cpp Wed Sep 13 02:58:53 2017 +0000 +++ b/main.cpp Thu Sep 14 11:56:51 2017 +0000 @@ -44,8 +44,8 @@ #define enc_Ki 0.0001 #define enc_Kd 0.0003 #define mecanum_power 1.0 -#define sword_power 0.8 -#define sholder_power 0.8 +#define sword_power 1.0 +#define sholder_power 1.0 #define pin_interrupt_sholderright_max p19 //p21 #define pin_interrupt_sholderright_min p20 //p22 #define pin_interrupt_sholderleft_max p7 @@ -131,7 +131,7 @@ pc.baud(pc_baud); sbdbt.begin(sbdbt_baud); rs422.begin(rs422_baud); - cylinder_origin_first(); +// cylinder_origin_first(); cylinder_pos_num = 2; //セットアップタイムでの初期装填のため output_timer.attach(&output, output_period); yaw_pid.setup(yaw_Kp, yaw_Ki, yaw_Kd); @@ -176,7 +176,7 @@ void cylinder_origin_first() { while(interrupt_cylinder_min == 1){ - rs422.put(5, -0.4, 0.0); + rs422.put(5, -0.8, 0.0); } rs422.put(5, 0.0, 0.0); enc_cylinder.origin(); @@ -281,16 +281,16 @@ if(sbdbt.get_pairingState()) { switch (counter) { case 0: - rs422.put(id[counter], v1.duty((mecanum.v1()*mecanum_power)+(sbdbt.right_y*0.5)), v3.duty((mecanum.v3()*mecanum_power)+(sbdbt.right_y*0.5))); + rs422.put(id[counter], v1.duty((mecanum.v1()*mecanum_power)+(sbdbt.right_y*0.8)), v3.duty((mecanum.v3()*mecanum_power)+(sbdbt.right_y*0.8))); counter++; break; case 1: //.duty(<cal>*<powerControle>+(<boost>*0.5)) - rs422.put(id[counter], v2.duty((mecanum.v2()*mecanum_power)-(sbdbt.right_y*0.5)), v4.duty((mecanum.v4()*mecanum_power)-(sbdbt.right_y*0.5))); + rs422.put(id[counter], v2.duty((mecanum.v2()*mecanum_power)-(sbdbt.right_y*0.8)), v4.duty((mecanum.v4()*mecanum_power)-(sbdbt.right_y*0.8))); counter ++; break; case 2: - rs422.put(id[counter], -1*enc_cylinder.duty_enableWidth(-.0,5.0), 0.0); + rs422.put(id[counter], -1*enc_cylinder.duty_enableWidth(-5.0,5.0), 0.0); counter ++; break; case 3: