Advertisement
Guest User

Untitled

a guest
Jan 25th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.58 KB | None | 0 0
  1.   if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND) && (elementDictionary != NULL))
  2.   {
  3.     ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
  4.     ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
  5.     HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
  6.     if (element != NULL)
  7.     {
  8.       float dX, dY, dZ, dPsi;
  9.       HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DX, arg);
  10.       if (arg != NULL)
  11.       {
  12.         dX = arg->value.Float;
  13.       }
  14.       HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DY, arg);
  15.       if (arg != NULL)
  16.       {
  17.         dY = arg->value.Float;
  18.       }
  19.       HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DZ, arg);
  20.       if (arg != NULL)
  21.       {
  22.         dZ = arg->value.Float;
  23.       }
  24.       HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DPSI, arg);
  25.       if (arg != NULL)
  26.       {
  27.         dPsi = arg->value.Float;
  28.       }
  29.         IHM_PrintMovement(ihm, dX,dY,dZ,counter1++);
  30.         moveCommands(deviceController);
  31.     }
  32.   }
  33. }
  34.  
  35. float commands[NUM_COMMANDS][4] = {{1.0f,0.0f,0.0f,0.0f},{-1.0f,0.0f,0.0f,0.0f}};
  36. void moveCommands(ARCONTROLLER_Device_t *deviceController)
  37. {
  38.   if(!stopCommand){
  39.     deviceController->aRDrone3->sendPilotingMoveBy(deviceController->aRDrone3, commands[pos%NUM_COMMANDS][0], commands[pos%NUM_COMMANDS][1], commands[pos%NUM_COMMANDS][2],commands[pos%NUM_COMMANDS][3]);
  40.     pos++;
  41.   }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement