/*
  followLine ‚ÌƒeƒXƒg
  Satofumi KAMIMURA
  $Id: followLine.cpp 286 2008-10-20 09:40:22Z satofumi $
*/

#include "runCtrl.h"
#include <cstdlib>
#include <cstdio>

using namespace VXV;

#define HostName "localhost"


int main(int argc, char *argv[]) {
  try {
    RunCtrl run;
    if (run.connect(argc, argv) < 0) {
    //if (run.connect("192.168.85.15", 9314) < 0) {
      printf("RunCtrl::connect: %s\n", run.what());
      exit(1);
    }

    //run.setStraightRefVel(32);

    run.followLine(Position(1000, 0, deg(0)));
    for (int i = 0; i < 10; ++i) {
      VXV::Position pos = run.getRunPosition();
      printf("%d, %d, %d\n", pos.x, pos.y, pos.zt.to_deg());
      VXV::Delay(100);
    }

    VXV::Delay(5000);

    run.stop();

  } catch (std::exception& e) {
    printf("exception: %s\n", e.what());
  }
  return 0;
}
