Пример #1
0
void Main::cmdReceivedCB(const std_msgs::CharConstPtr & cmd)
{
  switch (cmd->data)
    {
    case 'b':
      clearBackground();
      break;
    case 'c':
      stopTracking();
      break;
    case 'l':
      toggleLearning();
      break;
    case 'a':
      alternatingMode();
      break;
    case 'e':
      exportModel();
      break;
    case 'i':
      importModel();
      break;
    case 'r':
      reset();
      break;
    case 'v':
      sendCenterView();
      break;
    default:
      break;
    }
}
Пример #2
0
    //void Main::cmdReceivedCB(const std_msgs::CharConstPtr & cmd)
    void Main::cmdReceivedCB(const std_msgs::StringConstPtr & cmd)
    {
	  char cd=cmd->data.c_str()[0];
      //switch (cmd->data)
      switch (cd)
      {
        case 'b':
          clearBackground();
          break;
        case 'c':
          stopTracking();
          break;
        case 'l':
          toggleLearning();
          break;
        case 'a':
          alternatingMode();
          break;
        case 'e':
          exportModel();
          break;
        case 'i':
          importModel();
          break;
        case 'r':
          reset();
          break;
        default:
          break;
      }
    }