Index by title

ardrone_at_set_anim

This method will enable you to play animations.

void ardrone_at_set_anim(int32_t type, int32_t timeout);

Parameters

type
Enum anim_mayday_t defined types of animation.

timeout
duration of the animation in ms.

return
void

Declared In
ardrone_api.h

Enum Mayday scenarii
typedef enum {
ANIM_PHI_M30_DEG= 0,
ANIM_PHI_30_DEG,
ANIM_THETA_M30_DEG,
ANIM_THETA_30_DEG,
ANIM_THETA_20DEG_YAW_200DEG,
ANIM_THETA_20DEG_YAW_M200DEG,
ANIM_TURNAROUND,
ANIM_TURNAROUND_GODOWN,
ANIM_YAW_SHAKE,
NB_ANIM_MAYDAY
} anim_mayday_t;
declared in config.h file.


ardrone_at_set_led_animation

This method will enable you to play led animation.

void ardrone_at_set_led_animation ( LED_ANIMATION_IDS anim_id, float32_t freq, uint32_t duration_sec);

Parameters

anim_id
The following list identifies some led animation ids
BLINK_GREEN_RED, BLINK_GREEN, BLINK_RED, SNAKE_GREEN_RED, FIRE, STANDARD, RED, GREEN, RED_SNAKE.

freq
Duration of the animation.

duration_sec
Number of times the animation will be played. 0, infinity otherwise n times.

return value
void

Declared In
ardrone_api.h

Enum led animation declared in ardrone_api.h file.


ardrone_at_set_mayday

This method will enable you to play animations.

void ardrone_at_set_mayday(int32_t type, int32_t timeout);

Parameters

type
Type of the animation. The following list identifies some animation type
ANIM_MAYDAY0, ANIM_MAYDAY1, ANIM_MAYDAY2, ANIM_MAYDAY3

timeout
duration of the animation in ms.

return
void

Declared In
ardrone_api.h

Enum Mayday scenarii
typedef enum {
ANIM_MAYDAY0 = 0,
ANIM_MAYDAY1,
ANIM_MAYDAY2,
ANIM_MAYDAY3,
ANIM_MAYDAY4,
ANIM_MAYDAY5,
ANIM_MAYDAY6,
ANIM_MAYDAY7,
NB_ANIM_MAYDAY
} anim_mayday_t;
declared in config.h file.


ardrone_at_set_progress_cmd

This functions lets you move the AR.Drone.
It is controlled by giving two bending angles (front/back angle and left/right angle), an ascension speed in millimeters per second, and an angular speed in degrees per second.

The parameters of this function all are a percentage of the maximum bending angles and speeds which are stored in the drone configuration file.

void ardrone_at_set_progress_cmd( int32_t enable, float32_t phi, float32_t theta, float32_t gaz, float32_t yaw )

Parameters

enable
0, disabling progressive commands (the drone then enters hovering mode). 1, enabling progressive commands

phi
To bend backward use values between 0.0 and +1.0, to bend forward use values between 0.0 to -1.0; stay horizontal set to zero.

theta
To strafe left use values between 0.0 and -1.0, to strafe right use values between 0.0 to +1.0; to stay horizontal set to zero.

gaz
To go downward use values between 0.0 and -1.0, to go upward use values between 0.0 and +1.0; to stay at the same altitude set to zero.

yaw
To turn left use values between 0.0 and -1.0, to turn right use values 0.0 to +1.0; to keep the same orientation set to zero.

return value
void

Declared In
ardrone_api.h


ardrone_at_set_progress_cmd

This method will enable you to pilot the AR.Drone with more control.

void ardrone_at_set_progress_cmd( int32_t enable, float32_t phi, float32_t theta, float32_t gaz, float32_t yaw )

Parameters

enable
0, disabling phi and theta commands. 1, enabling phi and theta commands.

phi
To bend backward use values between -1 to -100, to bend forward use values between +1 to +100, to stay horizontal set to zero.

theta
To strafe left use values between -1 to -100, to strafe right use values between 1 to +100, and to stay horizontal set to zero.

gaz
To go downward use values between -1 to -100, to go upward use values between +1 to +100, and to stay at the same altitude set to zero.

yaw
To turn left use values between -1 to -100, to turn right use values +1 to +100 and to keep the same orientation set to zero.

return value
void

Declared In
ardrone_api.h


ardrone_at_zap

This method will enable you to select video channel, which can be embedded frontal and/or vertical camera.

void ardrone_at_zap( ZAP_VIDEO_CHANNEL channel )
Parameters

channel
Select video channel. Displaying horizontal camera, ZAP_CHANNEL_HORI or displaying only vertical camera, ZAP_CHANNEL_VERT or displaying both large horizontal and small vertical camera, ZAP_CHANNEL_LARGE_HORI_SMALL_VERT or displaying both large vertical and small horizontal camera, ZAP_CHANNEL_LARGE_VERT_SMALL_HORI or displaying next channel, ZAP_CHANNEL_NEXT.

return value
void

Declared In
ardrone_api.h

Define video channel
typedef enum
{
   ZAP_CHANNEL_HORI=0,
   ZAP_CHANNEL_VERT,
   ZAP_CHANNEL_LARGE_HORI_SMALL_VERT,
   ZAP_CHANNEL_LARGE_VERT_SMALL_HORI,
   ZAP_CHANNEL_NEXT,
} ZAP_VIDEO_CHANNEL;

declared in ardrone_api.h file.

ardrone_tool_set_ui_pad_ab

To go downward at a predetermined maximum vertical speed.

C_RESULT ardrone_tool_set_ui_pad_ab(int32_t value);

Parameters

value
to go downward, 1 and to keep the same altitude, 0.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_ah

To go upward at a predetermined maximum vertical speed.

C_RESULT ardrone_tool_set_ui_pad_ah(int32_t value);

Parameters

value
to go upward, 1 and to keep the same altitude, 0.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_l1

To turn left at a predetermined maximum angluar velocity.

C_RESULT ardrone_tool_set_ui_pad_l1(int32_t value)

Parameters

value
to trun left, 1 and to keep the same orientation, 0.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_l2

To turn right at a predetermined maximum angluar velocity.

C_RESULT ardrone_tool_set_ui_pad_l2(int32_t value)

Parameters

value
to trun right, 1 and to keep the same orientation, 0.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_r1

To turn right at a predetermined maximum angluar velocity.

C_RESULT ardrone_tool_set_ui_pad_r1(int32_t value)

Parameters

value
to trun right, 1 and to keep the same orientation, 0.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_select

Reset all emergency if the AR.Drone is already in a state of emergency otherwise the AR.Drone stops immediately.

C_RESULT ardrone_tool_set_ui_pad_select(int32_t value)

Parameters

value
1, Emergency processing otherwise nothing.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_start

Takeoff / Landing

C_RESULT ardrone_tool_set_ui_pad_start(int32_t value)

Parameters

value
1, Take off otherwise landing.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_xy

Controlling pitch and roll movements.

C_RESULT ardrone_tool_set_ui_pad_xy(int32_t x, int32_t y)

Parameters
x : +1, to go forward at a predetermined max bending angle. -1, to strafe backward at a predetermined max bending angle. Otherwise keeps the same pitch angle.
y : -1, to bend the AR.Drone to the left at a predetermined max angle. +1, to bend the AR.Drone to the right at a predetermined max angle. Otherwise it keeps the same bending angle.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


Changelog

Release Name Date Size Type Changes
0.1.0 ARDrone_API-0.1.0.tar.gz 04/01/2010 1.4MB tar.gz First release
0.1.1 ARDrone_API-0.1.1.tar.gz 16/03/2010 4.6MB tar.gz Linux and Android examples are included
0.3.1 ARDrone_API-0.3.1.tar.bz2 05/05/2010 15.1MB tar.bz2 Full source code for ARDrone library, new one touch only ace control mode interface, QVGA video stream (frontal camera). This SDK is not compatible with previous SDK and ARDrone firmware (ARDrone firmware upgrade provided here)
1.0.4 ARDrone_API-1.0.4.tar.bz2 23/07/2010 27.7MB tar.bz2 New AT control commands, changed control APIs, Linux example included, new Linux example included: ardrone_navigation
1.5.0 ARDrone_SDK_1_5_Version_20101004.tar.gz 05/10/2010 9MB tar.gz Windows Visual Studio example with keypad and gamepad controls; Android example; new iPhone, AR.FreeFlight 1.5 example including the AR.Drone firmware update 1.3.3 and many important new features; a new Developer Guide
1.6.0 ARDrone_SDK_1_6_20110224.tar.gz 24/02/2011 12MB tar.gz Linux example now uses libudev and allows to detect and configure gamepads; new AR.Drone configuration system with new calling methods; the video stream quality adjusts to the available bandwidth (this feature can be disabled (see the Developer Guide), the decoding algorithm is provided as a source code (documentation in progress)); AR.FreeFlight 1.7.1 example including AR.Drone firmware update 1.5.1; Documentation has been updated.
1.7.0 ARDrone_SDK_Version_1_7_20110525.tar.gz 26/05/2011 12MB tar.gz A new video codec called P264 with a lower bit-rate to increase the available network bandwidth for the control link. The decoding algorithm is provided as a source code. A new AR.Drone multi-configuration system: settings become specific to each iDevice so you can have different settings on your different iDevices. New stripe detections can be activated. AR.FreeFlight 1.8 iOS example includes the latest AR.Drone firmware update 1.6.6 for the AR.Drone. The Linux example has been updated. The Developer Guide has been updated.
1.8.0 ARDrone_SDK_Version_1_8_20110726.tar.gz 26/07/2011 19MB tar.gz AR.FreeFlight 1.9 iOS example includes the latest AR.Drone firmware update 1.7.4 for the AR.Drone. The firmware update 1.7.4 for the AR.Drone turns the AR.Drone Wi-Fi into Access Point mode. The new SDK includes a bugfix for the navdata regarding drone_camera_trans. Hovering on top of the roundel has been improved. A new FTP package developed by Parrot is used to update the AR.Drone from FreeFlight 1.9. The Linux example has been updated.

Developer Guide

Introduction

The ARDrone SDK provides the tools and ressources needed to create native applications for hardware platforms (PC, iPhone, iPad, Android and any host device supporting the Wifi ad-hoc mode). The ARDrone SDK provides reference functionalities that you can customize and extend. The iPhone reference application uses the ARDroneEngine Xcode project. This project provides a reference framework that makes it possible to create a functional application in a matter of minutes.

The core application

Every ARDrone application built using the ARDrone SDK shares the same core architecture. The ARDrone SDK provides the key objects needed to run the application and to coordinate the handling of user input, display the camera video and handling the tags detection. Where applications deviate from one another is in how they configure these default objects and also where they incorporate custom objects to enhance their application’s user interface and behavior.

When you create your own application you should re-use the high level APIs of the SDK. As each application depends on the platform and device used, it is important to understand when it needs customization and when the high level APIs are sufficient. This chapter provides an overview of the core application architecture and the high-level APIs customization points.

Core Application Architecture

Once connected to the AR.Drone, you can re-use the ARDrone SDK to initiate communication with the AR.Drone. Your application should manage the various devices (wifi connection, HMI). The AR.Drone SDK provides tools and methods to send commands, receive information from the AR.Drone and manage the video stream. To manage devices you need to understand the cycles of an AR.Drone application. The following sections describe these cycles and also provide a summary of some of the key design patterns used throughout the development of an ARDrone application.

The Application Life Cycle

The application life cycle is the minimum sequence of events that take place between the launch and termination of your AR.Drone application. You can compile the SDK with or without the main entry point provided with the SDK but your application must comply with the reference AR.Drone application life cycle to work correctly. The application is launched by calling it's main function. At this point, the application life cycle can be started. It initializes different user interfaces and calls custom SDK initialization objects from your application. During the event loop, the AR.Drone SDK calls the registered delegate objects. When the user performs an action that would cause your application to quit, the AR.Drone SDK notifies your application and begins the termination process.

Figure 1 Application life cycle

The Main Function

The main function of an ARDrone application
#include <ardrone_api.h>
#include <ardrone_tool/ardrone_tool.h>

C_RESULT res;

res = ardrone_tool_setup_com( NULL );

if( FAILED(res) )
{
   PRINT("Wifi initialization failed. It means either:\n");
   PRINT("\t* you're not root (you can set up wifi connection only as root)\n");
   PRINT("\t* wifi device is not present (on your pc or on your card)\n");
   PRINT("\t* you set the wrong name for wifi interface (for example rausb0 instead of wlan0) \n");
   PRINT("\t* ap is not up (reboot card or remove wifi usb dongle)\n");
   PRINT("\t* wifi device has no antenna\n");
}
else
{
   res = ardrone_tool_init(argc, argv);

   while( SUCCEED(res) && ardrone_tool_exit() == FALSE )
   {
      res = ardrone_tool_update();
   }

   res = ardrone_tool_shutdown();
}

Minimum requirement to compile your AR.Drone application

To compile your application with the SDK you must integrate some MACRO.

Listing 1.1 Threads table
#include <VP_Api/vp_api_thread_helper.h>

BEGIN_THREAD_TABLE
END_THREAD_TABLE
Listing 1.2 Navdata table
#include <ardrone_tool/Navdata/ardrone_navdata_client.h>

BEGIN_NAVDATA_HANDLER_TABLE
END_NAVDATA_HANDLER_TABLE

Implementing Custom TOOL Schemes

You can register TOOL types for your application that include custom TOOL schemes. A custom TOOL scheme is a mechanism through which you customize specific code for your application and handle registering objects for the SDK.

Registering Custom TOOL Schemes

To register a TOOL type for your application you specify the custom tool methods declared in ardrone_tool.h file which is introduced in "The application life cycle". The following list identifies some methods that you might want to implement in your application. Methods for parsing command line

Details about these methods are explained in more detail later in this document.

Managing threads

You must declare a threads table in vp_api_thread_helper.h file. You can add threads to your application and default threads implemented in the SDK. The listing of the default threads will be described later in this document.

Listing 1.3 Implementing threads table
#include <VP_Api/vp_api_thread_helper.h>
PROTO_THREAD_ROUTINE(your_thread, private_data);

DEFINE_THREAD_ROUTINE(your_thread, private_data)
{
   //your code
}

BEGIN_THREAD_TABLE
  THREAD_TABLE_ENTRY( your_thread, 20 )
  THREAD_TABLE_ENTRY( navdata_update, 20 )
END_THREAD_TABLE

To run and stop the threads, you declare MACRO in vp_api_thread_helper.h file. Use START_THREAD macro to run the thread and JOIN_THREAD macro to stop the thread. START_THREAD must be called in custom implemented method named ardrone_tool_init_custom which was introduced in "Implementing custom tool schemes". JOIN_THREAD is called in custom implemented method named ardrone_tool_shutdown_custom which was introduced in "Implementing custom tool schemes".

Listing 1.4 Managing threads
C_RESULT ardrone_tool_init_custom(int argc, char **argv)
{
  START_THREAD(your_thread, &private_data);

  return C_OK;
}

C_RESULT ardrone_tool_shutdown_custom()
{
  JOIN_THREAD( your_thread );
}                  

Activating default threads by adding in the threads table. The delegate object handles the default threads.

Handling input events

A delegate object handles your input device by implementing init, update and close methods in your application. The delegate object calls the init method when you register a new device in the SDK. During the event loop, the delegate object calls the update method. The delegate object calls shutdown method when the application exit or your application can directly call the ardrone_tool_input_remove method (declared in ardrone_tool_input.h file) to remove your device from the SDK.

This methods are embedded into input_device_t structure declared in ardrone_input.h file :
typedef struct _input_device_t {
  char name[MAX_NAME_LENGTH];

  C_RESULT (*init)(void);
  C_RESULT (*update)(void);
  C_RESULT (*shutdown)(void);
} input_device_t;

A method named ardrone_tool_input_add gives you a means to registering methods by passing the input_device object. Your application must add The method ardrone_tool_input_add in a custom method named ardrone_tool_init_custom which was introduced in "Implementing custom tool schemes". Adding the method ardrone_tool_input_add for each input device.

Listing 1.3 Implementing init, update and close methods

The Following code showing implementing methods for game pad controller.
Implementing update methods by using input methods defined in ardrone_input.h file. Methods are described in section "Methods for controlling the AR.Drone"

#include <ardrone_api.h>
#include <VP_Os/vp_os_types.h>
#include <ardrone_tool/UI/ardrone_input.h>

input_device_t gamepad = {
  "Gamepad",
  open_gamepad,
  update_gamepad,
  close_gamepad
};

C_RESULT open_gamepad(void)
{
  C_RESULT res = C_FAIL;

  FILE* f = fopen("/proc/bus/input/devices", "r");

  if( f != NULL )
  {
    res = parse_proc_input_devices( f, GAMEPAD_LOGICTECH_ID);

    fclose( f );

    if( SUCCEED( res ) && strcmp(gamepad.name, "Gamepad")!=0)
    {
         char dev_path[20]="/dev/input/";
         strcat(dev_path, gamepad.name);
            joy_dev = open(dev_path, O_NONBLOCK | O_RDONLY);
    }
      else
      {
         return C_FAIL;
      }
  }

  return res;
}

C_RESULT update_gamepad(void)
{
  static int32_t x = 0, y = 0;
  static bool_t refresh_values = FALSE;
  ssize_t res;
  static struct js_event js_e_buffer[64];
  static int32_t start = 0;
  input_state_t* input_state;

  static int32_t theta_trim = 0;
  static int32_t phi_trim   = 0;
  static int32_t yaw_trim   = 0;

  res = read(joy_dev, js_e_buffer, sizeof(struct js_event) * 64);

  if( !res || (res < 0 && errno == EAGAIN) )
    return C_OK;

  if( res < 0 )
    return C_FAIL;

  if (res < (int) sizeof(struct js_event))// If non-complete bloc: ignored
    return C_OK;

  // Buffer décomposition in blocs (if the last is incomplete, it's ignored)
  int32_t idx = 0;
  refresh_values = FALSE;
  input_state = ardrone_tool_get_input_state();
  for (idx = 0; idx < res / sizeof(struct js_event); idx++)
  {
    if(js_e_buffer[idx].type & JS_EVENT_INIT )// If Init, the first values are ignored
    {
      break;
    }
    else if(js_e_buffer[idx].type & JS_EVENT_BUTTON )// Event Button detected
    {
      switch( js_e_buffer[idx].number )
      {
        case PAD_AG :
        ardrone_tool_set_ui_pad_ag(js_e_buffer[idx].value);
        break;
        case PAD_AB :
        ardrone_tool_set_ui_pad_ab(js_e_buffer[idx].value);
        break;
        case PAD_AD :
        ardrone_tool_set_ui_pad_ad(js_e_buffer[idx].value);
        break;
        case PAD_AH :
        ardrone_tool_set_ui_pad_ah(js_e_buffer[idx].value);
        break;
        case PAD_L1 :
        if( js_e_buffer[idx].value )
        {
                   ardrone_tool_set_ui_pad_l1(1);
        }
                else
                {
                   ardrone_tool_set_ui_pad_l1(0);
                }
        break;
        case PAD_R1 :
        if( js_e_buffer[idx].value )
        {
                   ardrone_tool_set_ui_pad_r1(1);
        }
                else
                {
                   ardrone_tool_set_ui_pad_r1(0);
                }
        break;
        case PAD_L2 :
        break;
        case PAD_R2 :
        break;
        case PAD_SELECT :
        ardrone_tool_set_ui_pad_select(js_e_buffer[idx].value);
        break;
        case PAD_START :
      if( js_e_buffer[idx].value )
      {
         start ^= 1;
     ardrone_tool_set_ui_pad_start( start );
      }
      break;
        default:
       break;
      }
    }
    else if(js_e_buffer[idx].type & JS_EVENT_AXIS )// Event Axis detected
    {
      refresh_values = TRUE;
      switch( js_e_buffer[idx].number )
      {
        case PAD_X:
          x = ( js_e_buffer[idx].value + 1 ) >> 15;
          break;
        case PAD_Y:
          y = ( js_e_buffer[idx].value + 1 ) >> 15;
          break;
        default:
          break;
      }
    }
    else
    {// TODO: default: ERROR (non-supported)
    }
  }

  if(refresh_values)// Axis values to refresh
    {
       ardrone_tool_set_ui_pad_xy( x, y );
    }
  return C_OK;
}

C_RESULT close_gamepad(void)
{
  close( joy_dev );

  return C_OK;
}

Registering a game controller device

To register a new device for your application, you must call ardrone_tool_input_add method. Call ardrone_tool_input_remove method to unregister device. To add a new device call ardrone_tool_input_add method in your custom implemented method named ardrone_tool_init_custom (see "Implementing custom tool schemes"). To remove your device call ardrone_tool_input_remove method in your custom implemented method named ardrone_tool_shutdown_custom (see "Implementing custom tool schemes").

Listing 1.4 Registering a game controller device
C_RESULT ardrone_tool_init_custom(int argc, char **argv)
{
  // Add inputs
  ardrone_tool_input_add( &gamepad );

  return C_OK;
}

C_RESULT ardrone_tool_shutdown_custom()
{
  ardrone_tool_input_remove( &gamepad );

  return C_OK;
}

Methods for controlling the AR.Drone

The following list identifies some methods for basic controlling commands of the AR.Drone.

Using progressive commands

The ardrone_at_set_progress_cmd method enables you to pilot the AR.Drone with better control. It replaces pitch,roll,gaz and yaw commands which was introduced in the precedent section game-pad emulation. For example, you can use progressive commands to send the accelerometer values or to send radiogp commands.

Handling control commands

A mechanism is provided to handle control commands. That implements, updating software and retrieving settings of the AR.Drone. You can register to the mechanism by implementing "start" and "end" methods. The delegate object calls the "start" method before running the event process and "end" method after that the event process was terminated, in which you know if the process is success or not. The methods are passed into ardrone_control_soft_update_event_t structure. Calling the method ardrone_control_send_event sends the event command.

Objects are declared in <ardrone_tool/Control/ardrone_control.h> file.

The code sends a command to update software.
#include <ardrone_tool/Control/ardrone_control.h>

static void on_update_event_end( ardrone_control_event_t* event )
{
  if( event->status == ARDRONE_CONTROL_EVENT_FINISH_SUCCESS )
  {
    PRINT("Update completed with success\n");
  }
  else
  {
    PRINT("Update failure\n");
  }

  updater_exit = TRUE;
}

{
   static ardrone_control_soft_update_event_t update_event;

   update_event.event        = ARDRONE_UPDATE_CONTROL_MODE;   

   //This value must be large enough to update the software. 
   update_event.num_retries  = 50;     

   update_event.status       = ARDRONE_CONTROL_EVENT_WAITING;
   update_event.ardrone_control_event_start  = NULL; //Not implemented
   update_event.ardrone_control_event_end    = on_update_event_end;
   update_event.ack_received = 0;      
   update_event.sendsize     = 0;
   ardrone_control_send_event( (ardrone_control_event_t*) &update_event );
}

Displaying the video stream

The video stream data are handled using a pipeline. This SDK provides some stages that you can sequentially connect.
The life cycle of a pipeline must realize a minimum sequence.

Listing 1.5 Processing of a pipeline
    #include <VP_Api/vp_api.h>

    res = vp_api_open(&pipeline, &pipeline_handle);

    if( SUCCEED(res) )
    {
      int loop = SUCCESS;
      out.status = VP_API_STATUS_PROCESSING;

      while( !ardrone_tool_exit() && (loop == SUCCESS) )
      {
        if( image_vision_window_view == WINDOW_VISIBLE ) {
          if( SUCCEED(vp_api_run(&pipeline, &out)) ) {
            if( (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING) ) {
              loop = SUCCESS;
            }
          }
          else loop = -1; // Finish this thread
        }
      }

      vp_api_close(&pipeline, &pipeline_handle);

Your application needs to call this in a thread introduced in "Managing threads".

Listing 1.6 Handling the video stream data for an iPhone application

Header files in VP_SDK
#include <VP_Api/vp_api.h> 
#include <VP_Api/vp_api_error.h>
#include <VP_Api/vp_api_stage.h>
#include <VP_Api/vp_api_picture.h>
#include <VP_Stages/vp_stages_yuv2rgb.h>

Header files in VLIB
#include <VLIB/Stages/vlib_stage_decode.h>

Header files in ARDroneLib
#include <ardrone_tool/ardrone_tool.h>
#include <ardrone_tool/Com/config_com.h>
#include <ardrone_tool/Video/video_com_stage.h>

include in header file
PROTO_THREAD_ROUTINE(video_stage, data);

Implementing in source code file 
DEFINE_THREAD_ROUTINE(video_stage, data)
{
C_RESULT res;

vp_api_io_pipeline_t pipeline;
vp_api_io_data_t out;
vp_api_io_stage_t stages[NB_STAGES];

vp_api_picture_t picture;

vlib_stage_decoding_config_t vec;
video_com_config_t           icc;

video_stage_started = TRUE;

vp_os_memset(&icc, 0, sizeof( icc ));
vp_os_memset(&vec, 0, sizeof( vec ));

/// Picture configuration
picture.format = PIX_FMT_RGB565;

picture.width = 512;
picture.height = 512;
picture.framerate = 15;

picture.y_buf = vp_os_malloc( picture.width * picture.height );
picture.cr_buf = vp_os_malloc( picture.width * picture.height / 2 );
picture.cb_buf = vp_os_malloc( picture.width * picture.height / 2 );

picture.y_line_size = picture.width * 2;
picture.cb_line_size = 0;
picture.cr_line_size = 0;

icc.com = COM_VIDEO();
icc.buffer_size = 100000;
icc.protocol = VP_COM_UDP;
COM_CONFIG_SOCKET_VIDEO(&icc.socket, VP_COM_CLIENT, VIDEO_PORT, wifi_ardrone_ip);

vec.width = 512;
vec.height = 512;
vec.picture = &picture;
vec.luma_only = FALSE;
vec.block_mode_enable = TRUE;

pipeline.nb_stages = 0;

stages[pipeline.nb_stages].type = VP_API_INPUT_SOCKET;
stages[pipeline.nb_stages].cfg = (void *)&icc;
stages[pipeline.nb_stages].funcs = video_com_funcs;
pipeline.nb_stages++;

stages[pipeline.nb_stages].type = VP_API_FILTER_DECODER;
stages[pipeline.nb_stages].cfg = (void*)&vec;
stages[pipeline.nb_stages].funcs = vlib_decoding_funcs;
pipeline.nb_stages++;

stages[pipeline.nb_stages].type = VP_API_OUTPUT_LCD;
stages[pipeline.nb_stages].cfg = (void*)&vec;
stages[pipeline.nb_stages].funcs = opengl_video_stage_funcs;
pipeline.nb_stages++;

pipeline.stages = &stages[0];

if( !ardrone_tool_exit() )
{
res = vp_api_open(&pipeline, &pipeline_handle);

if( SUCCEED(res) )
{
int loop = SUCCESS;
out.status = VP_API_STATUS_PROCESSING;

while( !ardrone_tool_exit() && (loop == SUCCESS) )
{
if(!video_stage_started)
{
vp_os_mutex_lock(&video_stage_mutex);
icc.num_retries = VIDEO_MAX_RETRIES;
vp_os_cond_wait(&video_stage_condition);
video_stage_started = TRUE;
vp_os_mutex_unlock(&video_stage_mutex);
}

if( SUCCEED(vp_api_run(&pipeline, &out)) ) {
if( (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING) ) {
loop = SUCCESS;
}
}
else loop = -1; // Finish this thread
}

vp_api_close(&pipeline, &pipeline_handle);
}
}

return (THREAD_RET)0;
}

Toggling the video camera

The ardrone_at_zap method will enable you to select the video from either the horizontal or the vertical camera.

The following figure displays the video channels


Displaying of horizontal video camera


Displaying of vertical video camera


Both, "large horizontal" and "small vertical" video camera


Both, "large vertical" and "small horizontal" video camera

Playing a led animation

The ardrone_at_set_led_animation method enables you to play a led animation.

Playing a flight animation

The ardrone_at_set_anim method will enable you to play flight animations with the AR.Drone.

Receiving Navdata Information

To control the AR.Drone you need to retrieve informations containing alert messages. The following Navdata are important to the user.

The following picture displays a control panel showing alert messages.

Navdata gives you informations about settings of the AR.Drone. The following list identifies some parameters.

With these settings, you can adjust the control of the AR.Drone to your driving style. The following picture displays a settings panel.

To change the setting parameters of the AR. Drone, you must use the corresponding AT commands located in the file ardrone_api.h file. The following list identifies some methods to configure the AR.Drone.

The Navdata are sent periodically (15 times per second). A mechanism is provided to retrieve this data. To handle Navdata you should implement methods (init, process and release) that are embedded in the ardrone_navdata_handler_t structure declared in ardrone_navdata_client.h. A delegate object calls the init method when launching the Navdata client thread. During the event loop, the delegate object calls the process method. The delegate object calls release method when the thread exits. In order to register this method in the client, your application should define a Navdata table which was introduced in "Minimum requirement to compile your AR.Drone application". The following listing code shows an example to handle Navdata.

#include <ardrone_tool/Navdata/ardrone_navdata_client.h>

C_RESULT navdata_init( void* private_data )
{
   //Your code to initialize your local variables.
}

C_RESULT navdata_process( const navdata_unpacked_t* const pnd )
{
  //Retrieves current Navdata unpacked.
}

C_RESULT navdata_release( void )
{
  //Free local variables.
}

//Defines Navdata table in your application
BEGIN_NAVDATA_HANDLER_TABLE
  NAVDATA_HANDLER_TABLE_ENTRY(navdata_init, navdata_process, navdata_release, NULL) //Register your methods to the client
END_NAVDATA_HANDLER_TABLE
The client calls process method with a reference to a structure navdata_unpacked_t declared in ardrone_api.h file. This structure contains other structures. The following list identifies some structures.

Developer Guide

Introduction

The A.R.Drone SDK provides the tools and resources needed to control an A.R.Drone from native applications running on all kinds of hardware platforms (PC, iPhone, iPad, Android and any host device supporting Wifi networks in ad-hoc mode).

It provides reference functionalities that you can customize and extend, plus code examples with their associated projects which allow the users to create a fully functional application in a matter of minutes.

What you can do with the SDK

The functions provided in the SDK allow an user application to very easily control the drone movements, retrieve navigation data like sensors measurements and video streams, and configure the drone behaviour.

Getting started

If you have not done so yet, you can download the SDK package here .

You can then directly compile the provided examples or try to customize them.

The core application

Every ARDrone application built using the ARDrone SDK shares the same core architecture. The ARDrone SDK provides the key objects needed to run the application and to coordinate the handling of user input, display the camera video and handling the tags detection. Where applications deviate from one another is in how they configure these default objects and also where they incorporate custom objects to enhance their application’s user interface and behavior.

When you create your own application you should re-use the high level APIs of the SDK. As each application depends on the platform and device used, it is important to understand when it needs customization and when the high level APIs are sufficient. This chapter provides an overview of the core application architecture and the high-level APIs customization points.

Core Application Architecture

Once connected to the AR.Drone, you can re-use the ARDrone SDK to initiate communication with the AR.Drone. Your application should manage the various devices (wifi connection, HMI). The AR.Drone SDK provides tools and methods to send commands, receive information from the AR.Drone and manage the video stream. To manage devices you need to understand the cycles of an AR.Drone application. The following sections describe these cycles and also provide a summary of some of the key design patterns used throughout the development of an ARDrone application.

The Application Life Cycle

The application life cycle is the minimum sequence of events that take place between the launch and termination of your AR.Drone application. You can compile the SDK with or without the main entry point provided with the SDK but your application must comply with the reference AR.Drone application life cycle to work correctly. The application is launched by calling it's main function. At this point, the application life cycle can be started. It initializes different user interfaces and calls custom SDK initialization objects from your application. During the event loop, the AR.Drone SDK calls the registered delegate objects. When the user performs an action that would cause your application to quit, the AR.Drone SDK notifies your application and begins the termination process.

Figure 1 Application life cycle

The Main Function

The main function of an ARDrone application
#include <ardrone_api.h>
#include <ardrone_tool/ardrone_tool.h>

C_RESULT res;

res = ardrone_tool_setup_com( NULL );

if( FAILED(res) )
{
   PRINT("Wifi initialization failed. It means either:\n");
   PRINT("\t* you're not root (you can set up wifi connection only as root)\n");
   PRINT("\t* wifi device is not present (on your pc or on your card)\n");
   PRINT("\t* you set the wrong name for wifi interface (for example rausb0 instead of wlan0) \n");
   PRINT("\t* ap is not up (reboot card or remove wifi usb dongle)\n");
   PRINT("\t* wifi device has no antenna\n");
}
else
{
   res = ardrone_tool_init(argc, argv);

   while( SUCCEED(res) && ardrone_tool_exit() == FALSE )
   {
      res = ardrone_tool_update();
   }

   res = ardrone_tool_shutdown();
}

Minimum requirement to compile your AR.Drone application

To compile your application with the SDK you must integrate some MACRO.

Listing 1.1 Threads table
#include <VP_Api/vp_api_thread_helper.h>

BEGIN_THREAD_TABLE
END_THREAD_TABLE
Listing 1.2 Navdata table
#include <ardrone_tool/Navdata/ardrone_navdata_client.h>

BEGIN_NAVDATA_HANDLER_TABLE
END_NAVDATA_HANDLER_TABLE

Implementing Custom TOOL Schemes

You can register TOOL types for your application that include custom TOOL schemes. A custom TOOL scheme is a mechanism through which you customize specific code for your application and handle registering objects for the SDK.

Registering Custom TOOL Schemes

To register a TOOL type for your application you specify the custom tool methods declared in ardrone_tool.h file which is introduced in "The application life cycle". The following list identifies some methods that you might want to implement in your application. Methods for parsing command line

Details about these methods are explained in more detail later in this document.

Managing threads

You must declare a threads table in vp_api_thread_helper.h file. You can add threads to your application and default threads implemented in the SDK. The listing of the default threads will be described later in this document.

Listing 1.3 Implementing threads table
#include <VP_Api/vp_api_thread_helper.h>
PROTO_THREAD_ROUTINE(your_thread, private_data);

DEFINE_THREAD_ROUTINE(your_thread, private_data)
{
   //your code
}

BEGIN_THREAD_TABLE
  THREAD_TABLE_ENTRY( your_thread, 20 )
  THREAD_TABLE_ENTRY( navdata_update, 20 )
END_THREAD_TABLE

To run and stop the threads, you declare MACRO in vp_api_thread_helper.h file. Use START_THREAD macro to run the thread and JOIN_THREAD macro to stop the thread. START_THREAD must be called in custom implemented method named ardrone_tool_init_custom which was introduced in "Implementing custom tool schemes". JOIN_THREAD is called in custom implemented method named ardrone_tool_shutdown_custom which was introduced in "Implementing custom tool schemes".

Listing 1.4 Managing threads
C_RESULT ardrone_tool_init_custom(int argc, char **argv)
{
  START_THREAD(your_thread, &private_data);

  return C_OK;
}

C_RESULT ardrone_tool_shutdown_custom()
{
  JOIN_THREAD( your_thread );
}                  

Activating default threads by adding in the threads table. The delegate object handles the default threads.

Handling input events

A delegate object handles your input device by implementing init, update and close methods in your application. The delegate object calls the init method when you register a new device in the SDK. During the event loop, the delegate object calls the update method. The delegate object calls shutdown method when the application exit or your application can directly call the ardrone_tool_input_remove method (declared in ardrone_tool_input.h file) to remove your device from the SDK.

This methods are embedded into input_device_t structure declared in ardrone_input.h file :
typedef struct _input_device_t {
  char name[MAX_NAME_LENGTH];

  C_RESULT (*init)(void);
  C_RESULT (*update)(void);
  C_RESULT (*shutdown)(void);
} input_device_t;

A method named ardrone_tool_input_add gives you a means to registering methods by passing the input_device object. Your application must add The method ardrone_tool_input_add in a custom method named ardrone_tool_init_custom which was introduced in "Implementing custom tool schemes". Adding the method ardrone_tool_input_add for each input device.

Listing 1.3 Implementing init, update and close methods

The Following code showing implementing methods for game pad controller.
Implementing update methods by using input methods defined in ardrone_input.h file. Methods are described in section "Methods for controlling the AR.Drone"

#include <ardrone_api.h>
#include <VP_Os/vp_os_types.h>
#include <ardrone_tool/UI/ardrone_input.h>

input_device_t gamepad = {
  "Gamepad",
  open_gamepad,
  update_gamepad,
  close_gamepad
};

C_RESULT open_gamepad(void)
{
  C_RESULT res = C_FAIL;

  FILE* f = fopen("/proc/bus/input/devices", "r");

  if( f != NULL )
  {
    res = parse_proc_input_devices( f, GAMEPAD_LOGICTECH_ID);

    fclose( f );

    if( SUCCEED( res ) && strcmp(gamepad.name, "Gamepad")!=0)
    {
         char dev_path[20]="/dev/input/";
         strcat(dev_path, gamepad.name);
            joy_dev = open(dev_path, O_NONBLOCK | O_RDONLY);
    }
      else
      {
         return C_FAIL;
      }
  }

  return res;
}

C_RESULT update_gamepad(void)
{
  static int32_t x = 0, y = 0;
  static bool_t refresh_values = FALSE;
  ssize_t res;
  static struct js_event js_e_buffer[64];
  static int32_t start = 0;
  input_state_t* input_state;

  static int32_t theta_trim = 0;
  static int32_t phi_trim   = 0;
  static int32_t yaw_trim   = 0;

  res = read(joy_dev, js_e_buffer, sizeof(struct js_event) * 64);

  if( !res || (res < 0 && errno == EAGAIN) )
    return C_OK;

  if( res < 0 )
    return C_FAIL;

  if (res < (int) sizeof(struct js_event))// If non-complete bloc: ignored
    return C_OK;

  // Buffer décomposition in blocs (if the last is incomplete, it's ignored)
  int32_t idx = 0;
  refresh_values = FALSE;
  input_state = ardrone_tool_get_input_state();
  for (idx = 0; idx < res / sizeof(struct js_event); idx++)
  {
    if(js_e_buffer[idx].type & JS_EVENT_INIT )// If Init, the first values are ignored
    {
      break;
    }
    else if(js_e_buffer[idx].type & JS_EVENT_BUTTON )// Event Button detected
    {
      switch( js_e_buffer[idx].number )
      {
        case PAD_AG :
        ardrone_tool_set_ui_pad_ag(js_e_buffer[idx].value);
        break;
        case PAD_AB :
        ardrone_tool_set_ui_pad_ab(js_e_buffer[idx].value);
        break;
        case PAD_AD :
        ardrone_tool_set_ui_pad_ad(js_e_buffer[idx].value);
        break;
        case PAD_AH :
        ardrone_tool_set_ui_pad_ah(js_e_buffer[idx].value);
        break;
        case PAD_L1 :
        if( js_e_buffer[idx].value )
        {
                   ardrone_tool_set_ui_pad_l1(1);
        }
                else
                {
                   ardrone_tool_set_ui_pad_l1(0);
                }
        break;
        case PAD_R1 :
        if( js_e_buffer[idx].value )
        {
                   ardrone_tool_set_ui_pad_r1(1);
        }
                else
                {
                   ardrone_tool_set_ui_pad_r1(0);
                }
        break;
        case PAD_L2 :
        break;
        case PAD_R2 :
        break;
        case PAD_SELECT :
        ardrone_tool_set_ui_pad_select(js_e_buffer[idx].value);
        break;
        case PAD_START :
      if( js_e_buffer[idx].value )
      {
         start ^= 1;
     ardrone_tool_set_ui_pad_start( start );
      }
      break;
        default:
       break;
      }
    }
    else if(js_e_buffer[idx].type & JS_EVENT_AXIS )// Event Axis detected
    {
      refresh_values = TRUE;
      switch( js_e_buffer[idx].number )
      {
        case PAD_X:
          x = ( js_e_buffer[idx].value + 1 ) >> 15;
          break;
        case PAD_Y:
          y = ( js_e_buffer[idx].value + 1 ) >> 15;
          break;
        default:
          break;
      }
    }
    else
    {// TODO: default: ERROR (non-supported)
    }
  }

  if(refresh_values)// Axis values to refresh
    {
       ardrone_tool_set_ui_pad_xy( x, y );
    }
  return C_OK;
}

C_RESULT close_gamepad(void)
{
  close( joy_dev );

  return C_OK;
}

Registering a game controller device

To register a new device for your application, you must call ardrone_tool_input_add method. Call ardrone_tool_input_remove method to unregister device. To add a new device call ardrone_tool_input_add method in your custom implemented method named ardrone_tool_init_custom (see "Implementing custom tool schemes"). To remove your device call ardrone_tool_input_remove method in your custom implemented method named ardrone_tool_shutdown_custom (see "Implementing custom tool schemes").

Listing 1.4 Registering a game controller device
C_RESULT ardrone_tool_init_custom(int argc, char **argv)
{
  // Add inputs
  ardrone_tool_input_add( &gamepad );

  return C_OK;
}

C_RESULT ardrone_tool_shutdown_custom()
{
  ardrone_tool_input_remove( &gamepad );

  return C_OK;
}

Methods for controlling the AR.Drone

The following list identifies some methods for basic controlling commands of the AR.Drone.

Using progressive commands

The ardrone_at_set_progress_cmd method enables you to pilot the AR.Drone with better control. It replaces pitch,roll,gaz and yaw commands which was introduced in the precedent section game-pad emulation. For example, you can use progressive commands to send the accelerometer values or to send radiogp commands.

Handling control commands

A mechanism is provided to handle control commands. That implements, updating software and retrieving settings of the AR.Drone. You can register to the mechanism by implementing "start" and "end" methods. The delegate object calls the "start" method before running the event process and "end" method after that the event process was terminated, in which you know if the process is success or not. The methods are passed into ardrone_control_soft_update_event_t structure. Calling the method ardrone_control_send_event sends the event command.

Objects are declared in <ardrone_tool/Control/ardrone_control.h> file.

The code sends a command to update software.
#include <ardrone_tool/Control/ardrone_control.h>

static void on_update_event_end( ardrone_control_event_t* event )
{
  if( event->status == ARDRONE_CONTROL_EVENT_FINISH_SUCCESS )
  {
    PRINT("Update completed with success\n");
  }
  else
  {
    PRINT("Update failure\n");
  }

  updater_exit = TRUE;
}

{
   static ardrone_control_soft_update_event_t update_event;

   update_event.event        = ARDRONE_UPDATE_CONTROL_MODE;   

   //This value must be large enough to update the software. 
   update_event.num_retries  = 50;     

   update_event.status       = ARDRONE_CONTROL_EVENT_WAITING;
   update_event.ardrone_control_event_start  = NULL; //Not implemented
   update_event.ardrone_control_event_end    = on_update_event_end;
   update_event.ack_received = 0;      
   update_event.sendsize     = 0;
   ardrone_control_send_event( (ardrone_control_event_t*) &update_event );
}

Displaying the video stream

The video stream data are handled using a pipeline. This SDK provides some stages that you can sequentially connect.
The life cycle of a pipeline must realize a minimum sequence.

Listing 1.5 Processing of a pipeline
    #include <VP_Api/vp_api.h>

    res = vp_api_open(&pipeline, &pipeline_handle);

    if( SUCCEED(res) )
    {
      int loop = SUCCESS;
      out.status = VP_API_STATUS_PROCESSING;

      while( !ardrone_tool_exit() && (loop == SUCCESS) )
      {
        if( image_vision_window_view == WINDOW_VISIBLE ) {
          if( SUCCEED(vp_api_run(&pipeline, &out)) ) {
            if( (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING) ) {
              loop = SUCCESS;
            }
          }
          else loop = -1; // Finish this thread
        }
      }

      vp_api_close(&pipeline, &pipeline_handle);

Your application needs to call this in a thread introduced in "Managing threads".

Listing 1.6 Handling the video stream data for an iPhone application

Header files in VP_SDK
#include <VP_Api/vp_api.h> 
#include <VP_Api/vp_api_error.h>
#include <VP_Api/vp_api_stage.h>
#include <VP_Api/vp_api_picture.h>
#include <VP_Stages/vp_stages_yuv2rgb.h>

Header files in VLIB
#include <VLIB/Stages/vlib_stage_decode.h>

Header files in ARDroneLib
#include <ardrone_tool/ardrone_tool.h>
#include <ardrone_tool/Com/config_com.h>
#include <ardrone_tool/Video/video_com_stage.h>

include in header file
PROTO_THREAD_ROUTINE(video_stage, data);

Implementing in source code file 
DEFINE_THREAD_ROUTINE(video_stage, data)
{
C_RESULT res;

vp_api_io_pipeline_t pipeline;
vp_api_io_data_t out;
vp_api_io_stage_t stages[NB_STAGES];

vp_api_picture_t picture;

vlib_stage_decoding_config_t vec;
video_com_config_t           icc;

video_stage_started = TRUE;

vp_os_memset(&icc, 0, sizeof( icc ));
vp_os_memset(&vec, 0, sizeof( vec ));

/// Picture configuration
picture.format = PIX_FMT_RGB565;

picture.width = 512;
picture.height = 512;
picture.framerate = 15;

picture.y_buf = vp_os_malloc( picture.width * picture.height );
picture.cr_buf = vp_os_malloc( picture.width * picture.height / 2 );
picture.cb_buf = vp_os_malloc( picture.width * picture.height / 2 );

picture.y_line_size = picture.width * 2;
picture.cb_line_size = 0;
picture.cr_line_size = 0;

icc.com = COM_VIDEO();
icc.buffer_size = 100000;
icc.protocol = VP_COM_UDP;
COM_CONFIG_SOCKET_VIDEO(&icc.socket, VP_COM_CLIENT, VIDEO_PORT, wifi_ardrone_ip);

vec.width = 512;
vec.height = 512;
vec.picture = &picture;
vec.luma_only = FALSE;
vec.block_mode_enable = TRUE;

pipeline.nb_stages = 0;

stages[pipeline.nb_stages].type = VP_API_INPUT_SOCKET;
stages[pipeline.nb_stages].cfg = (void *)&icc;
stages[pipeline.nb_stages].funcs = video_com_funcs;
pipeline.nb_stages++;

stages[pipeline.nb_stages].type = VP_API_FILTER_DECODER;
stages[pipeline.nb_stages].cfg = (void*)&vec;
stages[pipeline.nb_stages].funcs = vlib_decoding_funcs;
pipeline.nb_stages++;

stages[pipeline.nb_stages].type = VP_API_OUTPUT_LCD;
stages[pipeline.nb_stages].cfg = (void*)&vec;
stages[pipeline.nb_stages].funcs = opengl_video_stage_funcs;
pipeline.nb_stages++;

pipeline.stages = &stages[0];

if( !ardrone_tool_exit() )
{
res = vp_api_open(&pipeline, &pipeline_handle);

if( SUCCEED(res) )
{
int loop = SUCCESS;
out.status = VP_API_STATUS_PROCESSING;

while( !ardrone_tool_exit() && (loop == SUCCESS) )
{
if(!video_stage_started)
{
vp_os_mutex_lock(&video_stage_mutex);
icc.num_retries = VIDEO_MAX_RETRIES;
vp_os_cond_wait(&video_stage_condition);
video_stage_started = TRUE;
vp_os_mutex_unlock(&video_stage_mutex);
}

if( SUCCEED(vp_api_run(&pipeline, &out)) ) {
if( (out.status == VP_API_STATUS_PROCESSING || out.status == VP_API_STATUS_STILL_RUNNING) ) {
loop = SUCCESS;
}
}
else loop = -1; // Finish this thread
}

vp_api_close(&pipeline, &pipeline_handle);
}
}

return (THREAD_RET)0;
}

Toggling the video camera

The ardrone_at_zap method will enable you to select the video from either the horizontal or the vertical camera.

The following figure displays the video channels


Displaying of horizontal video camera


Displaying of vertical video camera


Both, "large horizontal" and "small vertical" video camera


Both, "large vertical" and "small horizontal" video camera

Playing a led animation

The ardrone_at_set_led_animation method enables you to play a led animation.

Playing a flight animation

The ardrone_at_set_anim method will enable you to play flight animations with the AR.Drone.

Receiving Navdata Information

To control the AR.Drone you need to retrieve informations containing alert messages. The following Navdata are important to the user.

The following picture displays a control panel showing alert messages.

Navdata gives you informations about settings of the AR.Drone. The following list identifies some parameters.

With these settings, you can adjust the control of the AR.Drone to your driving style. The following picture displays a settings panel.

To change the setting parameters of the AR. Drone, you must use the corresponding AT commands located in the file ardrone_api.h file. The following list identifies some methods to configure the AR.Drone.

The Navdata are sent periodically (15 times per second). A mechanism is provided to retrieve this data. To handle Navdata you should implement methods (init, process and release) that are embedded in the ardrone_navdata_handler_t structure declared in ardrone_navdata_client.h. A delegate object calls the init method when launching the Navdata client thread. During the event loop, the delegate object calls the process method. The delegate object calls release method when the thread exits. In order to register this method in the client, your application should define a Navdata table which was introduced in "Minimum requirement to compile your AR.Drone application". The following listing code shows an example to handle Navdata.

#include <ardrone_tool/Navdata/ardrone_navdata_client.h>

C_RESULT navdata_init( void* private_data )
{
   //Your code to initialize your local variables.
}

C_RESULT navdata_process( const navdata_unpacked_t* const pnd )
{
  //Retrieves current Navdata unpacked.
}

C_RESULT navdata_release( void )
{
  //Free local variables.
}

//Defines Navdata table in your application
BEGIN_NAVDATA_HANDLER_TABLE
  NAVDATA_HANDLER_TABLE_ENTRY(navdata_init, navdata_process, navdata_release, NULL) //Register your methods to the client
END_NAVDATA_HANDLER_TABLE
The client calls process method with a reference to a structure navdata_unpacked_t declared in ardrone_api.h file. This structure contains other structures. The following list identifies some structures.

Download

You can get the latest source code of ARDrone API from the Subversion repository:

You can check out the latest development source with the following command:

svn co https://svn.ardrone.org/repo/ARDrone_API

Download SDK

Latest stable release:

Release Name Date Size Type
0.1.0 ARDrone_API-0.1.0.tar.gz 21/12/2009 128 tar.gz

See the Changelog for details.


ARDrone2 Version 2012-09-14 2.2.9 open source software

Here is the link to get more information : https://devzone.parrot.com/wiki/oss-ardrone2/Listing

ARDrone1 Version 2011-04-01 1.7.6 open source software

This document describes the source code used on the ARDrone devices with version 20100809_1_2 of the embedded software, which falls either under the GNU General Public License (the GPL), or the GNU Lesser General Public License (the LGPL).

Source code download

Package License Homepage
Linux kernel 2.6.27 with Parrot patches GPLv2 http://www.kernel.org
Linux kernel config 2.6.27 GPLv2 http://www.kernel.org
G++ Lite 2009q1-203 toolchain for ARM GNU/Linux GPLv2,LGPLv2.1 http://www.codesourcery.com/sgpp/lite/arm/portal/release858
busybox-1.14 GPLv2 http://www.busybox.net
procps-3.2.8 GPLv2 http://procps.sourceforge.net
strace-4.5.20 BSD-like http://sourceforge.net/projects/strace
iptables-1.4.5 GPLv2 http://www.netfilter.org
ethtool-6 GPLv2 http://sourceforge.net/projects/gkernel
wireless_tools-29 GPLv2 http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
dmalloc-5.5.2 License http://dmalloc.com
zlib-1.2.3 License http://zlib.net

Toolchain

The entire ARDrone software for version 20100809_1_2 was built using the following Code Sourcery tools and libc:

Sourcery G++ Lite 2009q1-203 for ARM GNU/Linux, available here,
itself based on the following components:

Parrot applied the following patches to the toolchain binary distribution:


Compiling and installing the example application on the IPhone

You need an iPhone developer certificate and a generic profile for your iPhone.


IPhone interface

Reference iPhone touch interface

The iPhone example features the latest touch interface. There are 2 control modes available: one is for beginners and the other is for experts. To compile with the iPhone SDK and install on your iPhone you need an iPhone developer certificate and a generic profile for your iPhone.

Beginner and expert control modes

You can configure the control mode in the tools sub-menu of the interface.

The beginner interface uses 2 fingers, the left one for triggering iPhone tilt control and the right one for inputting left/right/forward/backward strafe and up/down commands. For both buttons the reference position of the finger is where you first touch and the tilt reference is the iPhone position at first touch.

The "ace" interface uses only one finger. It combines both triggering iPhone tilt control and inputting left/right/forward/backward strafe and up/down commands. The reference position of the finger is where you first touch and the reference tilt angle is the iPhone position when you first touch.

Quick start guide with the iPhone interface


ソフトウェア開発キット(SDK)1.0.4

Wikiのページで新しいSDKをダウンロードできます。新機能や変更点は次のとおりです。

この新バージョンのSDKは、AR.Droneのプロトタイプとは互換性がありません。このSDKで開発したアプリケーションのテストには、AR.Droneの製品版が必要となります。SDKのダウンロード方法や開発に関するドキュメントについては、Wikiのページを参照してください。

AR.Droneの製品版には、新バージョンのSDKで活用できる次のような新機能があります。

AR.Drone APIは、AR.Droneを利用した拡張現実ゲームを開発するためのリファレンスプロジェクトです。SDKの全ソースコード、複数プラットフォームのサンプル、ドキュメントをダウンロードできます。

AR.Drone API は、Open API Platformとして、AR.Droneライセンスの条項にのっとってソースコードを公開しています。

開発者ガイドの参照や、AR.Droneプロジェクトに関するご質問と意見交換には、Wikiページやフォーラム(電子会議室)をご利用ください。

以下をご希望の場合は、当社までお問い合わせください。


ソフトウェア開発キット(SDK)1.0.4

Wikiのページで新しいSDKをダウンロードできます。新機能や変更点は次のとおりです。

この新バージョンのSDKは、AR.Droneのプロトタイプとは互換性がありません。このSDKで開発したアプリケーションのテストには、AR.Droneの製品版が必要となります。SDKのダウンロード方法や開発に関するドキュメントについては、Wikiのページを参照してください。

AR.Droneの製品版には、新バージョンのSDKで活用できる次のような新機能があります。

AR.Drone APIは、AR.Droneを利用した拡張現実ゲームを開発するためのリファレンスプロジェクトです。SDKの全ソースコード、複数プラットフォームのサンプル、ドキュメントをダウンロード できます。

AR.Drone API は、Open API Platformとして、AR.Droneライセンス の条項にのっとってソースコードを公開しています。

開発者ガイドの参照や、AR.Droneプロジェクトに関するご質問と意見交換には、Wikiページやフォーラム(電子会議室) をご利用ください。

以下をご希望の場合は、当社までお問い合わせください。


Japanese-overview

SDK 1.5パッケージを今すぐダウンロード!

SDK 1.5には次のような新機能があります。

iPhone用のサンプル「AR.FreeFlight 1.5」には次のような新機能があります。

AR.Drone APIは、AR.Droneを利用した拡張現実ゲームを開発するためのリファレンスプロジェクトです。SDKの全ソースコード、複数プラットフォームのサンプル、ドキュメント(英語)をダウンロード できます。

AR.Drone API は、Open API Platformとして、AR.Droneライセンス(英語) の条項にのっとってソースコードを公開しています。

開発者ガイドの参照や、AR.Droneプロジェクトに関するご質問と意見交換には、 Wiki(英語) ページやフォーラム=電子会議室(英語) をご利用ください。

以下をご希望の場合は、当社までお問い合わせください(英語)


Japanese-overview-SDK-1-6

SDK 1.6パッケージを今すぐダウンロード!

SDK 1.6には次のような新機能があります。 iPhone用のサンプル「AR.FreeFlight 1.7.1」には次のような新機能があります。

Japanese-overview-SDK-1-8

ダウンロード

SDKパッケージはここ からダウンロードできます。
詳しくはChangelogを参照してください。

SDK 1.8には次のような新機能があります。

SDKドキュメント

iPhone用のサンプル「AR.FreeFlight 1.9」には次のような新機能があります。

AR.Droneの最新版ファームウェア1.7.4が付属

AR.Droneのファームウェア1.7.4のインストール方法

本SDKには、AR.Droneの最新版ファームウェア1.7.4が付属しており、iPhone用のサンプル「AR.FreeFlight 1.9」のリソースディレクトリに入っています。すべての開発者の方々にインストールをお勧めします。AR.Droneのアップデート方法はこちらのページ を参照してください。AR.FreeFlight 1.9は、AR.Droneを操縦するためのリファレンスアプリケーションです。無料アプリケーションとして配布されているため、大半のユーザがアプリケーションの指示に従ってAR.Droneをアップグレードすることが期待されます。

互換性

SDK 1.8はAR.Droneのファームウェア1.7.4およびAR.FreeFlight 1.9に対応しています。


Japanese-top

AR.Drone Open API Platformへようこそ!

Open API Platformは、AR.DroneによるAR(拡張現実)ゲームを開発するためのリファレンスプラットフォームです。AR.Droneを利用して開発できる ゲームとその可能性については、「AR.Droneを利用したゲームの開発」(ホワイトペーパー)(日本語) のドキュメントをダウンロードしてお確かめください。

AR.Droneプロジェクトに関するご質問や意見交換には、フォーラム(電子会議室、英語) をご利用ください。

AR.Drone APIプロジェクト:

AR.Drone APIは、AR.Droneを利用したAR(拡張現実)ゲームを開発するためのリファレンスプロジェクトです。APIのソースコードや、iPhoneなどのプラッ トフォーム用の制御用アプリケーションのサンプルがあります。

SDK 1.6には次のような新機能があります;。

詳しくはAR.DroneAPIプロジェクトの概要 ページをご覧ください。

以下をご希望の場合は、当社までお問い合わせください(英語)

Parrot AR.Droneホーム へ戻る


Code examples for Linux

The A.R. Drone SDK comes with two application examples for Linux.

A first simple one can be found in Examples/linux/sdk_demo. It connects to a drone and allows the user to control it with a gamepad, and see the video from the front camera.

A second example lies in Examples/Linux/Navigation. It also allows controlling the drone, but also displays on graphs the information contained in the navigation data sent by the drone (like its position, status, battery voltage, etc.).

The following sections show you how to compile and test them in an Ubuntu 10.04 environment.

Prerequisites

To compile those examples, you will need to install the Gtk (used to display navdata graphs) and SDL (used to displau the video stream) development libraries.
You can do so by typing
1  sudo apt-get install libsdl-dev

Multiplatform examples

Download latest SK

iPhone example

The iPhone app source code is in Examples/iPhone/ParrotDemo. To install the ParrotDemo app on your iPhone you need to:

After you received your AR.Drone kit, to start flying follow these instructions:

Linux example

You need Linux kernel 2.6.18 or higher and gcc 4. Use a USB gamepad to input commands. The Linux app source code example is in Examples/Linux.

Google Android example

The Android app source code example is in Examples/Android. This is a quick'n'dirty demo app for controlling an AR drone with an Android phone. It was originally based on the "San Angeles" NDK demo app. It was written to quickly test the following implementation choices:

The native application itself is derived from a sample linux PC code (not from the iPhone app), it consists in a few threads:

- the "AT commands" thread sends control frames to AR drone
- the "NAV data" thread receives navigation and status data from AR drone
- the video thread receives a compressed video stream (encoded in a proprietary codec, UVLC) from AR drone

Note: this demo app should not be used as a basis for a real port of the iPhone AR drone application.

HOW TO USE
1) Setup wifi connection to drone in ad-hoc mode (currently not possible in Android), or to an access point, ONLY if drone has been flashed in "PC mode".
2) Launch AR drone app; a video stream should be displayed
3) Hold your phone in landscape mode with the trackball on the left
4) Tap the screen on the bottom left corner to take off/land
5) Touch the right part of the screen to control gas (up/middle/bottom)
6) While touching the screen or pressing the trackball, you can use phone orientation to control flight
7) Press and roll the trackball to control yaw
8) Release touchscreen and trackball to return the drone back into fix-point mode


Releases

Release Name Date Size Type
0.1.0 ARDrone_API-0.1.0.tar.gz 21/12/2009 128 tar.gz

Moderation rules

Do not post any messages that are insulting or defamatory to people or companies;

Respect the privacy of others by not posting any videos or photos of them without their authorization;

Do not mention the first and last names of people when you quote them in posts;
Do not post or send images of a pornographic nature, do not try to justify crimes against humanity, incitement to racial hatred, or incitement to violence, especially violence against women, or any infringements of human dignity,
Do not post any content (text, sound, video) of which you are not the author,

Do not post about the same topic too frequently on the forum just to stir up controversy.

Do not post any information that may allow the Parrot AR.Drone to be used in an unauthorized manner.

Do not promote any use of the drone that does not comply with the user guide.

Do not promote a modification to the Parrot AR.Drone that is not described in the user guide

The site moderator may, at his or her discretion, delete a message or close a topic that does not comply with the rules set forth above.


SDK


Source code

You can download the SDK.

You can get the latest source code of ARDrone API from the Subversion repository (individual SVN account needed):

You can check out the latest development source with the following command:

svn co https://svn.ardrone.org/repo/ARDrone_API

Would like to contribute ? Send application to projects@ardrone.org.


Submissions

Submissions should be written in english.

Submitting a Bug

Before submitting a bug report here, please make sure:

And have a look at the "bug list": and the to see if it has not already been reported.

When filling a bug report, please give the following information with the description of your problem:

Submitting a Feature Request

Before submitting a feature request here, please make sure:

Submitting a Wiki improvement

When you edit a wiki page to improve its content, make sure that you fill the comment field with a descriptive summary of the changes you've made to the page. This way we'll be better able to "monitor" and "maintain" the quality of the actual wiki content.

Submitting a Patch


Video_com_config_t

Handling video communication using VP_SDK library.
typedef struct _video_com_config_t
{
  vp_com_t*             com;

  vp_com_socket_t       socket;
  VP_COM_SOCKET_OPTIONS sockopt;

  uint32_t              buffer_size;

  // Private Datas
  Read                  read;
  Write                 write;
  uint32_t              num_retries;

  VP_COM_SOCKET_PROTOCOL protocol;

} video_com_config_t;

Parameters

com
Using COM_VIDEO() macro.

socket
Using macro COM_CONFIG_SOCKET_VIDEO(&icc.socket, VP_COM_CLIENT, VIDEO_PORT, wifi_ardrone_ip);
wifi_ardrone_ip : IP address's AR.Drone.

sockopt
read
write
num_retries
Only used by the delegate object.

buffer_size
Depends on the bandwidth.

protocol
Using VP_COM_UDP macro.

extern const vp_api_stage_funcs_t video_com_funcs;

Declared in :
<ardrone_tool/Video/video_com_stage.h>

VIDEO_PORT
Declared in:
<config.h>

#define COM_VIDEO()               wifi_com()
#define COM_CONFIG_VIDEO()        wifi_config()
#define COM_CONNECTION_VIDEO()    wifi_connection()
#define COM_CONFIG_SOCKET_VIDEO(socket, type, opt, serverhost)  wifi_config_socket(socket, type, opt, serverhost)

Declared in :
<ardrone_tool/Com/config_com.h> Types of socket (client or server)
typedef enum _VP_COM_SOCKET_TYPE_
{       
  VP_COM_CLIENT,                                            /// Client
  VP_COM_SERVER                                             /// Server
} VP_COM_SOCKET_TYPE;
Protocol for the socket to be opened
typedef enum _VP_COM_SOCKET_PROTOCOL_
{
  VP_COM_RFCOMM,                                            /// Rfcomm (RS232 emulation available only in bluetooth mode)
  VP_COM_TCP,                                               /// TCP/IP
  VP_COM_UDP                                                /// UDP/IP
} VP_COM_SOCKET_PROTOCOL;

Declared in:
<VP_SDK/VP_Com/vp_com.h>
h1. vlib_stage_decoding_config_t
typedef struct _vlib_stage_decoding_config_t
{
  uint32_t width;
  uint32_t height;
  uint32_t num_picture_decoded;

  video_controller_t  controller;
  vp_api_picture_t*   picture;

  bool_t block_mode_enable;
  bool_t luma_only; 

} vlib_stage_decoding_config_t;

Parameters

width
Width image resolutions.

height
Height image resolutions.

num_picture_decoded
controller
Only used by the delegate object.

picture
vp_api_picture_t

block_mode
Value fixed to TRUE.

luma_only
TRUE if you want only luminance (chrominances will be overwritten with a neutral value (0x80))

Declared in:
<VLIB/Stages/vlib_stage_decode.h>


Vp_api_io_data_t

This structure is used by stages to share data in a generic way
typedef struct _vp_api_io_data_
{
  uint32_t         numBuffers;
  int8_t         **buffers;
  uint32_t         indexBuffer;

  int32_t          size;
  int32_t         *lineSize;

  VP_API_IO_STATUS status;

  vp_os_mutex_t    lock;
}
vp_api_io_data_t;

Declared in include file
<VP_SDK/VP_Api/vp_api.h> Stage's state definition:
typedef enum _VP_API_IO_STATUS_
{
  VP_API_STATUS_INIT        = 0, // needs being equal to zero to ease initialization
  VP_API_STATUS_PROCESSING,
  VP_API_STATUS_STILL_RUNNING,
  VP_API_STATUS_ENDED,
  VP_API_STATUS_ERROR
}
VP_API_IO_STATUS;

Declared in include file
<VP_SDK/VP_Api/vp_api.h>


Vp_api_io_pipeline_t

This structure is used to configure the pipeline

typedef struct vp_api_io_pipeline {
uint32_t nb_stages;
vp_api_io_stage_t *stages;
vp_api_handle_msg_t handle_msg;
uint32_t nb_still_running;
vp_api_fifo_t fifo;
}
vp_api_io_pipeline_t;

Parameters

nb_stages
Number of stages to value between 0 and VP_API_MAX_NUM_STAGES.

stages
This is a pointer of an array of stages.

handle_msg
nb_still_running
fifo
Only used by the delegate object.

Declared in include :
<VP_SDK/VP_Api/vp_api.h>


Vp_api_io_stage_t:

This structure is used to configure stages. The cfg field can be used to share data between stages in a specific way.
typedef struct _vp_api_io_stage_
{
  VP_API_IO_TYPE        type;
  void                 *cfg;
  vp_api_stage_funcs_t  funcs;
  vp_api_io_data_t      data;
}
vp_api_io_stage_t;

Declared In
<VP_SDK/VP_Api/vp_api.h>

Available io stages type:
typedef enum _VP_API_IO_TYPES_
{
  // INPUTS
  VP_API_INPUT_BUFFER,
  VP_API_INPUT_CAMIF,
  VP_API_INPUT_FILE,
  VP_API_INPUT_SOCKET,

  // FILTERS
  VP_API_FILTER_ENCODER,
  VP_API_FILTER_DECODER,
  VP_API_FFMPEG_ENCODER,
  VP_API_FFMPEG_DECODER,
  VP_API_FILTER_VISION,
  VP_API_VISION_PREPARE,
  VP_API_FILTER_YUV2RGB,
  VP_API_JPEG_ENCODER,
  VP_API_JPEG_DECODER,
  VP_API_ARWIZ,

  // OUTPUTS
  VP_API_OUTPUT_CONSOLE,
  VP_API_OUTPUT_SDL,
  VP_API_OUTPUT_LCD,
  VP_API_OUTPUT_FILE,
  VP_API_OUTPUT_SOCKET
}
VP_API_IO_TYPE;

Declared In
<VP_SDK/VP_Api/vp_api.h>


h1. vp_api_picture_t
enum PixelFormat {
    PIX_FMT_NONE= -1,
    PIX_FMT_YUV420P,   ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
    PIX_FMT_YUV422,    ///< Packed pixel, Y0 Cb Y1 Cr
    PIX_FMT_RGB24,     ///< Packed pixel, 3 bytes per pixel, RGBRGB...
    PIX_FMT_BGR24,     ///< Packed pixel, 3 bytes per pixel, BGRBGR...
    PIX_FMT_YUV422P,   ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
    PIX_FMT_YUV444P,   ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples)
    PIX_FMT_RGBA32,    ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness
    PIX_FMT_YUV410P,   ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples)
    PIX_FMT_YUV411P,   ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples)
    PIX_FMT_RGB565,    ///< always stored in cpu endianness
    PIX_FMT_RGB555,    ///< always stored in cpu endianness, most significant bit to 1
    PIX_FMT_GRAY8,
    PIX_FMT_MONOWHITE, ///< 0 is white
    PIX_FMT_MONOBLACK, ///< 0 is black
    PIX_FMT_PAL8,      ///< 8 bit with RGBA palette
    PIX_FMT_YUVJ420P,  ///< Planar YUV 4:2:0 full scale (jpeg)
    PIX_FMT_YUVJ422P,  ///< Planar YUV 4:2:2 full scale (jpeg)
    PIX_FMT_YUVJ444P,  ///< Planar YUV 4:4:4 full scale (jpeg)
    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
    PIX_FMT_XVMC_MPEG2_IDCT,
    PIX_FMT_UYVY422,   ///< Packed pixel, Cb Y0 Cr Y1
    PIX_FMT_UYVY411,   ///< Packed pixel, Cb Y0 Y1 Cr Y2 Y3
    PIX_FMT_NB,
};

#define OVERPAD                 16
#define MB_WIDTH_Y              16
#define MB_HEIGHT_Y             MB_WIDTH_Y
#define MB_WIDTH_C              8
#define MB_HEIGHT_C             MB_WIDTH_C

// SQCIF
#define SQCIF_WIDTH             128
#define SQCIF_HEIGHT            96
#define SQCIF_SIZE              (SQCIF_WIDTH * SQCIF_HEIGHT)

// QCIF
#define QCIF_WIDTH              176
#define QCIF_HEIGHT             144
#define QCIF_SIZE               (QCIF_WIDTH * QCIF_HEIGHT)

#define QQVGA_WIDTH             160
#define QQVGA_HEIGHT            120
#define QQVGA_SIZE              (QQVGA_WIDTH * QQVGA_HEIGHT)

// QQCIF
#define QQCIF_WIDTH             88
#define QQCIF_HEIGHT            72
#define QQCIF_SIZE              (QQCIF_WIDTH * QQCIF_HEIGHT)

// QQVGA
#define QQVGA_WIDTH             160
#define QQVGA_HEIGHT            120
#define QQVGA_SIZE              (QQVGA_WIDTH * QQVGA_HEIGHT)

// QVGA
#define QVGA_WIDTH              320
#define QVGA_HEIGHT             240
#define QVGA_SIZE               (QVGA_WIDTH * QVGA_HEIGHT)

// TWEAKY QQVGA
#define TWEAKY_QQVGA_WIDTH      320
#define TWEAKY_QQVGA_HEIGHT     (240-16)
#define TWEAKY_QQVGA_SIZE       (TWEAKY_QQVGA_WIDTH * TWEAKY_QQVGA_HEIGHT)

// CIF
#define CIF_WIDTH               352
#define CIF_HEIGHT              288
#define CIF_SIZE                (CIF_WIDTH * CIF_HEIGHT)

// VGA
#define VGA_WIDTH               640
#define VGA_HEIGHT              480
#define VGA_SIZE                (VGA_WIDTH * VGA_HEIGHT)

typedef struct _vp_api_picture_
{
  enum PixelFormat format;    // camif -> encoder : PIX_FMT_YUV420P

  uint32_t         width;     // camif -> encoder
  uint32_t         height;    // camif -> encoder
  uint32_t         framerate; // camif -> encoder

  uint8_t         *y_buf;     // camif -> encoder
  uint8_t         *cb_buf;    // camif -> encoder
  uint8_t         *cr_buf;    // camif -> encoder

  uint32_t         y_pad;     // 2* camif_config.y_pad
  uint32_t         c_pad;     // 2* camif_config.c_pad

  uint32_t         y_line_size;
  uint32_t         cb_line_size;
  uint32_t         cr_line_size;

  uint32_t         vision_complete;
  uint32_t         complete;
  int32_t          blockline;
}
vp_api_picture_t;

Declared in:
<VP_SDK/VP_Api_vp_api_picture.h>


Vp_api_stage_funcs_t

A structure that contains all functions pointers to handle a stage.

typedef struct vp_api_stage_funcs {
vp_api_stage_handle_msg_t handle_msg;
vp_api_stage_open_t open;
vp_api_stage_transform_t transform;
vp_api_stage_close_t close;
} vp_api_stage_funcs_t;

Parameters

handle_msg
Handling message from the pipeline fifo.

open
transform
close
Methods to managing a stage.

Functions prototypes to open, close and update a stage

typedef C_RESULT (*vp_api_stage_handle_msg_t)(void *cfg, PIPELINE_MSG msg_id, void *callback, void *param);

typedef C_RESULT (*vp_api_stage_open_t)(void *cfg);

typedef C_RESULT (*vp_api_stage_transform_t)(void *cfg, struct vp_api_io_data *in, struct vp_api_io_data *out);

typedef C_RESULT (*vp_api_stage_close_t)(void *cfg);

Declared in :
<VP_SDK/VP_Api/vp_api_stage.h>


Wiki

AR Drone API is the reference project for developing augmented reality games based on the AR Drone. AR Drone API is an open API platform with shared source code released under the terms of the document:"AR.Drone Licence".

SDK 2.0.1

The AR Drone SDK version 2.0.1 is now available.
Support for H264 and MPEG video decoding is now provided by ffmpeg only. The ffmpeg library is a open source software released under the LGPL.

Download

You can download the SDK package here

SDK 2.0.1 features are:

We hope you will enjoy developing with SDK 2.0.1!
The AR.Drone Developer Team

AR Drone API is an open API platform with shared source code released under the terms of the "AR.Drone Licence"https://projects.ardrone.org/attachments/374/PARROTSDKARDRONELicenseJUNE_2011v2_1.pdf.

AR.Drone 2.0 open source software can be found on Parrot DEVZONE website.

To get help and discuss about AR.Drone project, use the forum.

SDK 1.8

AR.Drone APIプロジェクト概要(日本語):SDK1.8パッケージをダウンロード

Download

You can download the SDK package here.

See the Changelog for more details.

SDK new features

SDK Documentation

iOS example AR.FreeFlight 1.9 new features

AR.Drone firmware update 1.7.4 installation

This SDK comes with the AR.Drone firmware update 1.7.4 that can be found in the AR.FreeFlight 1.9 iPhone example ressource directory. It should be installed by all developers. To update your AR.Drone, follow instructions here. AR.FreeFlight 1.9 is the reference control application. AR.FreeFlight 1.9 will be distributed as a free application so expect the majority of users to upgrade their drones when they will be asked to by the app.

Compatibility

The SDK 1.8 is compatible with the AR.Drone firmware update 1.7.4 and AR.FreeFlight 1.9.

SDK 1.7

Download

You can download the SDK package here.

See the Changelog for more details.

SDK new features

SDK Documentation

iOS example AR.FreeFlight 1.8 new features

AR.Drone firmware update 1.6.6 installation

This SDK comes with the AR.Drone firmware update 1.6.6 that can be found in the AR.FreeFlight 1.8 iPhone example ressource directory. It should be installed by all developers. To update your AR.Drone, follow instructions here. AR.FreeFlight 1.8 is the reference control application which new features illustrate the new firmware possibilities. AR.FreeFlight 1.8 will be distributed as a free application so expect the majority of users to upgrade their drones when they will be asked to by the app.

Compatibility

The SDK 1.7 is compatible with the AR.Drone firmware update 1.6.6 and AR.FreeFlight 1.8.

SDK 1.6

概要(日本語)はこちら: Japanese-overview-SDK-1-6

Download

You can download the SDK package here.

See the Changelog for more details.

SDK new features

SDK Documentation

iOS example AR.FreeFlight 1.7.1 new features

AR.Drone firmware update 1.5.1 installation

This SDK comes with the AR.Drone firmware update 1.5.1 that can be found in the AR.FreeFlight 1.7.1 iPhone example ressource directory. It should be installed by all developers. To update your AR.Drone, follow instructions here. AR.FreeFlight 1.7.1 is the reference control application which new features illustrate the new firmware possibilities. AR.FreeFlight 1.7.1 will be distributed as a free application so expect the majority of users to upgrade their drones when they will be asked to by the app.

Compatibility

The SDK 1.6 is compatible with the AR.Drone firmware update 1.5.1 and AR.FreeFlight 1.7.1.

SDK 1.5

概要(日本語)はこちら: Japanese-overview

Download

You can download the SDK package here.

See the Changelog for more details.

SDK new features

SDK Documentation

iPhone example AR.FreeFlight 1.5 new features

AR.Drone firmware update 1.3.3 installation

This SDK comes with the AR.Drone firmware update 1.3.3 that can be found in the AR.FreeFlight 1.5 iPhone example ressource directory. It should be installed by all developers. To update your AR.Drone, follow instructions here. AR.FreeFlight 1.5 is the reference control application which new features illustrate the new firmware possibilities. AR.FreeFlight 1.5 will be distributed as a free application so expect the majority of users to upgrade their drones when they will be asked to by the app.

Compatibility

The SDK 1.5 is compatible with the AR.Drone firmware update 1.3.3 and AR.FreeFlight 1.5.

SDK 1.0.4

ソフトウェア開発キット(SDK)1.0.4: Japanese

Download

You can download the SDK package here. Note that it is not compatible with the AR.Drone prototype. It is compatible only with the final AR.Drone version.

New features are:

See the Changelog for more details.

Compatibility

This new SDK is not compatible with the AR.Drone prototype. You will need the final version of the ARDrone to test applications developed with this SDK. It has the following new features that can be leveraged with SDK 1.0.4:

Documentation

GPL compliancy

The AR.Drone runs various GPL-licensed components. Please read this page for more information.

USB cable

You can find the AR.Drone USB cable chart here. When USB is plugged before starting the AR.Drone it is detected as a slave and this is used internally for flashing. After boot USB is deactivated.

Forum and issues moderation rules

Before you post an issue or a message on the forum read the rules of moderation.

Contribute

Developers are welcome to contribute to the AR.Drone project.
Would like to contribute ? Send application

Support & getting help

For getting help or discussing about AR Drone API project, use the forum.

Before submitting a bug report, a patch or a feature request here, please read the Submissions.

日本語APIホームページはこちら: Japanese-top


ardrone_tool_set_ui_pad_r2

Activating/disabling the trim command. Combined with methods: ardrone_tool_set_ui_pad_xy for theta and phi trim and ardrone_tool_set_ui_pad_l1, ardrone_tool_set_ui_pad_r1 for yaw trim.

C_RESULT ardrone_tool_set_ui_pad_r2(int32_t value)

Parameters

value
1, activating the trim command. 0, disabling the trim command.

Return value
successful C_OK is returned otherwise C_FAIL.

Declared in:
<ardrone_tool/UI/ardrone_input.h>

C_RESULT declared in <ardrone_api.h> file.


ardrone_tool_set_ui_pad_xy:

Change the orientation of the AR.Drone. X-axis represents Roll movement and Y-axis represents Pitch movement.

C_RESULT ardrone_tool_set_ui_pad_xy(int32_t x, int32_t y)

Parameters

x
Condition for Roll movement. strafe left, -1, strafe right, +1 and keep the same orientation set to zero.

y
Condition for Pitch movement. to inclined to backward, +1 to inclined to forward, -1 and keep the same orientation set to zero.

return value
C_OK is already returned.

Declared In
ardrone_tool_input.h
C_RESULT declared in ardrone_api.h file.