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.

PIC:ultrasound_freq = 8<br />

PIC:ultrasound_watchdog = 3<br />

PIC:pic_version = 100925495<br />

VIDEO:camif_fps = 15<br />

VIDEO:camif_buffers = 2<br />

VIDEO:num_trackers = 12<br />

DETECT:enemy_colors = 1<br />

SYSLOG:output = 7<br />

SYSLOG:max_size = 102400<br />

SYSLOG:nb_files = 5<br />

.<br />

8.2 Setting the drone configuration<br />

8.2.1 With AR<strong>Drone</strong>Tool<br />

Use the ARDRONE_TOOL_CONFIGURATION_ADDEVENT macro to set any of the configuration parameters.<br />

This macro makes AR<strong>Drone</strong>Tool queue the new value in an internal buffer, send it to the<br />

drone, and wait for an acknowledgment from the drone.<br />

It takes as a first parameter the name of the parameter (see next sections to get a list or look at<br />

the config_keys.h file in the SDK). The second parameter is the new value to send to the drone.<br />

The third parameter is a callback function that will be called upon completion.<br />

The callback function type is void (*callBack)(unsigned int success). The configuration tool will<br />

call the callback function after any attempt to set the configuration, with zero as the parameter<br />

in case of failure, and one in case of success. In case of failure, the tool will automatically retry<br />

after an amount of time.<br />

Your program must not launch a new ARDRONE_TOOL_CONFIGURATION_ADDEVENT call at each<br />

time the callback function is called with zero as its parameter.<br />

The callback function pointer can be a NULL pointer if your application don’t need any acknowledgment.<br />

Listing 8.2: Example of setting a config. paramter<br />

int enemy_color;<br />

enemy_color = ORANGE_GREEN;<br />

ARDRONE_TOOL_CONFIGURATION_ADDEVENT(enemy_colors, enemy_color, NULL);<br />

57

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

Saved successfully!

Ooh no, something went wrong!