• R/O
  • SSH
  • HTTPS

team-ncxx-sl: Commit


Commit MetaInfo

Revision432 (tree)
Zeit2019-09-15 15:45:46
Autormizutani-f

Log Message

Lコースのガレージの移動距離を変更できる対応

Ändern Zusammenfassung

Diff

--- trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/CommonApp.cpp (revision 431)
+++ trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/CommonApp.cpp (revision 432)
@@ -285,13 +285,13 @@
285285 if(COURSETYPE_LEFT == courseType) {
286286 courseList.push_back(new StartToGoalL());
287287 courseList.push_back(new SingleSeesaw());
288- courseList.push_back(new Garage(courseType));
288+ courseList.push_back(new Garage());
289289 //courseList.push_back();
290290 }
291291 else {
292292 courseList.push_back(new StartToGoalR());
293293 courseList.push_back(new LookupGate());
294- courseList.push_back(new Garage(courseType));
294+ courseList.push_back(new Garage());
295295 //courseList.push_back();
296296 }
297297 }
--- trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/Garage.cpp (revision 431)
+++ trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/Garage.cpp (revision 432)
@@ -5,13 +5,13 @@
55 const int GarageTargetDistance = 250; // 525度で35cm のはず タイヤが大きくなったので変更
66 //const int GarageTargetDistance = 555; // 35cm + 2cm
77
8-Garage::Garage(int courseType)
8+Garage::Garage()
99 : garageState(GarageStateRun)
1010 , m_isFinished(false)
1111 , waitCount(0)
1212 , targetDistance(GarageTargetDistance)
13+ , firstRun(true)
1314 {
14- p_courseType = courseType;
1515 }
1616
1717 Garage::~Garage()
@@ -121,7 +121,10 @@
121121 void Garage::MoveDistance()
122122 {
123123 BaseCourse::Run();
124- if(200 < motor_ang_l)
124+
125+ int targetDistance = (firstRun && COURSETYPE_LEFT == RUN_COURSE) ? 400 : 200;
126+
127+ if(targetDistance < motor_ang_l)
125128 {
126129 garageState = GarageStateStop;
127130 }
@@ -155,7 +158,7 @@
155158 int powerR = 0;
156159 int powerL = 0;
157160
158- if (p_courseType == COURSETYPE_LEFT) {
161+ if (COURSETYPE_LEFT == RUN_COURSE) {
159162 powerR = defaultPower + ((0 < colorDiff) ? additionalPower : 0);
160163 powerL = defaultPower + ((colorDiff < 0) ? additionalPower : 0);
161164 } else
--- trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/Garage.h (revision 431)
+++ trunk/src/hrp2_beta7/sdk/workspace/sample_cpp2/course/Garage.h (revision 432)
@@ -6,7 +6,7 @@
66
77 class Garage : public BaseCourse {
88 public:
9- Garage(int courseType);
9+ Garage();
1010 virtual ~Garage();
1111
1212 void SetPIDData();
@@ -22,7 +22,6 @@
2222 void Adjustment();
2323 void Finish();
2424 bool AngleCheck();
25- int p_courseType;
2625 double GetDistance();
2726 void updatePidValue();
2827
@@ -42,6 +41,7 @@
4241 Stopper stopper;
4342 int waitCount;
4443 int targetDistance;
44+ bool firstRun;
4545
4646 };
4747
Show on old repository browser