yuto kawamura
/
George_Slave_BOTHMOVE
right and left move at the same time
Diff: main.cpp
- Revision:
- 3:29999b02e940
- Parent:
- 2:db2bc2ae4d20
- Child:
- 4:db1640bd0e89
diff -r db2bc2ae4d20 -r 29999b02e940 main.cpp --- a/main.cpp Mon Apr 29 07:00:04 2019 +0000 +++ b/main.cpp Wed May 01 05:46:53 2019 +0000 @@ -205,7 +205,7 @@ } void Robot::run() { - while (!Leg1_->pid_->IsConvergence_ /*|| !Leg2_->pid_->IsConvergence_*/) //片方が収束していない時*/ + while (!Leg1_->pid_->IsConvergence_ || !Leg2_->pid_->IsConvergence_) //片方が収束していない時*/ { //ticker_time毎にモータに出力する float time_s = timer.read(); @@ -253,6 +253,7 @@ printf("standby ok\n\r"); setup(); + pid_ro.setTolerance(10); pid_ri.setTolerance(10); @@ -269,13 +270,15 @@ robot.setLeg(&leg_ro, &leg_ri); robot.setTickerTime(0.01); //モータ出力間隔 0.01 - motor_ro.setDutyLimit(0.1); - motor_ri.setDutyLimit(0.1); + motor_ro.setDutyLimit(0.5); + motor_ri.setDutyLimit(0.5); reset(); bus_out = 1; printf("start\n\r"); + + float target_ro, target_ri; while(1) { @@ -318,14 +321,14 @@ void reset() { while(switch_ro.read()) { - motor_ro.output(0.13); + motor_ro.output(0.3); } ec_ro.reset(); motor_ro.output(0.0); printf("ro OK\n\r"); - /*while(switch_ri.read()) { - motor_ri.output(0.13); - }*/ + while(switch_ri.read()) { + motor_ri.output(0.3); + } ec_ri.reset(); motor_ri.output(0.0);