box_path.cpp
00001 #include <runCtrl.h>
00002 #include <vutils.h>
00003 #include <deque>
00004 #ifdef DRAW_PATH
00005 #include <vmonitor.h>
00006 #endif
00007
00008 void pathFollow(RunCtrl& run) {
00009 std::deque<VXV::Position> lines;
00010
00011 lines.push_back(VXV::Position(0, 0, VXV::deg(0)));
00012 lines.push_back(VXV::Position(500, 0, VXV::deg(0)));
00013 lines.push_back(VXV::Position(500, 1000, VXV::deg(90)));
00014 lines.push_back(VXV::Position(2500, 1000, VXV::deg(0)));
00015 lines.push_back(VXV::Position(2500, -1000, VXV::deg(-90)));
00016 lines.push_back(VXV::Position(500, -1000, VXV::deg(180)));
00017 lines.push_back(VXV::Position(500, -50, VXV::deg(90)));
00018 lines.push_back(VXV::Position(0, -50, VXV::deg(180)));
00019
00020 #ifdef DRAW_PATH
00021 std::deque<VXV::Grid3D> draw_lines;
00022 draw_lines.assign(lines.begin(), lines.end());
00023 vmonitor::drawContLine(draw_lines, White);
00024 #endif
00025
00026 int follow_r = run.getCurveRadius();
00027 run.followLine(lines.front());
00028 while (lines.size() > 0) {
00029 VXV::followLinesUpdate(run, lines, follow_r);
00030 VXV::Delay(100);
00031 }
00032 run.stop();
00033 }
00034