Ejemplo n.º 1
0
  void print() {
    std::cout << std::string(25, '\n') << std::endl; // act as if the screen is refreshed
    std::cout << '\r'; // clear the current line;
    std::cout << "Welcome to MyoAVG! Myo found and connected!" << std::endl;
    if (onArm) {
      std::string poseString = currentPose.toString();

      std::cout << '[' << (whichArm == myo::armLeft ? "L" : "R") << ']'
		<< '[' << poseString << std::string(14 - poseString.size(), ' ') << ']';

      std::cout << std::endl;
      if (this->avgc->initialized) {
	this->avgc->print_map();
      }
    }
    std::cout << "Your position: " << avgc->c_x << ", " << avgc->c_y << std::endl;
    std::cout << "Your facing: " << avgc->current_facing() << std::endl;
    std::cout << "Your Progress: " << this->game_progress() << std::endl;
    std::cout << std::flush;
  }
 void onPose(myo::Myo* myo, uint64_t timestamp, myo::Pose pose)
 {
     std::cout << "Myo " << identifyMyo(myo) << " switched to pose " << pose.toString() << "." << std::endl;
 }
 // Pose
 void onPose(myo::Myo* myo, uint64_t timestamp, myo::Pose pose)
 {
   this->addEventData(myo, timestamp, "pose", new StringEventData(pose.toString()));
 }