14.01.2013 Views

A.R.Drone Developer Guide - Abstract

A.R.Drone Developer Guide - Abstract

A.R.Drone Developer Guide - Abstract

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

58<br />

8.2.2 From the Control Engine for iPhone<br />

Using the Control Engine for iPhone, the AR<strong>Drone</strong> instance of your application can accept<br />

messages to control some parts of the configuration.<br />

The message is -(void) executeCommandIn:(ARDRONE_COMMAND_IN)commandId withParameter:(void<br />

*)parameter fromSender:(id)sender.<br />

The first parameter is the ID of the config you want to change. The ID list can be found in the<br />

AR<strong>Drone</strong>Types.h.<br />

The second parameter is the parameter of the command.<br />

As 1.6 SDK, parameter types are the following :<br />

- ARDRONE_COMMAND_ISCLIENT : raw integer casted to (void *).<br />

- ARDRONE_COMMAND_DRONE_ANIM : ARDRONE_ANIMATION_PARAM pointer.<br />

- ARDRONE_COMMAND_DRONE_LED_ANIM : ARDRONE_LED_ANIMATION_PARAM<br />

pointer.<br />

- ARDRONE_COMMAND_VIDEO_CHANNEL : raw integer casted to (void *). Values can be<br />

found in AR<strong>Drone</strong>GeneratedTypes.h file<br />

- ARDRONE_COMMAND_CAMERA_DETECTION : raw integer casted to (void *). Values<br />

can be found in AR<strong>Drone</strong>GeneratedTypes.h file<br />

- ARDRONE_COMMAND_ENEMY_SET_PARAM : ARDRONE_ENEMY_PARAM pointer.<br />

- ARDRONE_COMMAND_ENABLE_COMBINED_YAW : boolean casted to (void *).<br />

- ARDRONE_COMMAND_SET_FLY_MODE : raw integer casted to (void *). Values can be<br />

found in ardrone_api.h file<br />

The third parameter is currently unused (passing nil is ok).<br />

Listing 8.3: Example of setting detection parameters with Control Engine<br />

ARDRONE_ENEMY_PARAM enemyParam;<br />

enemyParam.color = ARDRONE_ENEMY_COLOR_GREEN;<br />

enemyParam.outdoor_shell = 0;<br />

[ardrone executeCommandIn:ARDRONE_COMMAND_ENEMY_SET_PARAM withParam:(void *)&<br />

enemyParam fromSender:nil];<br />

8.2.3 Without AR<strong>Drone</strong>Tool<br />

Use the AT*CONFIG command to send a configuration value to the drone. The command must<br />

be sent with a correct sequence number, the parameter note between double-quotes, and the<br />

parameter value between double-quotes.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!