Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ((commandKey == ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND) && (elementDictionary != NULL))
- {
- ARCONTROLLER_DICTIONARY_ARG_t *arg = NULL;
- ARCONTROLLER_DICTIONARY_ELEMENT_t *element = NULL;
- HASH_FIND_STR (elementDictionary, ARCONTROLLER_DICTIONARY_SINGLE_KEY, element);
- if (element != NULL)
- {
- float dX, dY, dZ, dPsi;
- HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DX, arg);
- if (arg != NULL)
- {
- dX = arg->value.Float;
- }
- HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DY, arg);
- if (arg != NULL)
- {
- dY = arg->value.Float;
- }
- HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DZ, arg);
- if (arg != NULL)
- {
- dZ = arg->value.Float;
- }
- HASH_FIND_STR (element->arguments, ARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGEVENT_MOVEBYEND_DPSI, arg);
- if (arg != NULL)
- {
- dPsi = arg->value.Float;
- }
- IHM_PrintMovement(ihm, dX,dY,dZ,counter1++);
- moveCommands(deviceController);
- }
- }
- }
- float commands[NUM_COMMANDS][4] = {{1.0f,0.0f,0.0f,0.0f},{-1.0f,0.0f,0.0f,0.0f}};
- void moveCommands(ARCONTROLLER_Device_t *deviceController)
- {
- if(!stopCommand){
- 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]);
- pos++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement