vistest.cc

来自「该文件是包含了机器人足球比赛中的整个系统的代码」· CC 代码 · 共 44 行

CC
44
字号
#include "VisTest.h"

// Test to see if the modified vision transform works properly (-CM).
VisTest::VisTest() {
  currentTiltBig = 0;
  currentTiltSmall = 15;
  currentPan = 80;
  index = 0;
  leftSwing = true;
}

void VisTest::NewReadyModel() {
  if (currentPan > 79 && !leftSwing) {
    index++;
    currentPan = 79;
    leftSwing = true;
  }

  if (index == 0) {
    currentTiltBig = 0;
    currentTiltSmall = 15;
  } else if (index == 1) {
    currentTiltBig = -20;
    currentTiltSmall = 15;
  } else if (index == 2) {
    currentTiltBig = -20;
    currentTiltSmall = 0; 
  } else if (index == 3) {
    currentTiltBig = 0;
    currentTiltSmall = 25;
  } else {
    return;
  }
  if (leftSwing) currentPan-=1.5;
  else currentPan+=1.5;
  if (currentPan < -79 && leftSwing) leftSwing = false;
  Utilities utils;
  utils.Head_MoveTo(currentTiltBig, currentPan, currentTiltSmall);
}


void VisTest::NewPlayingModel() {
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?