Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

jolicode/php-ar-drone

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
April 6, 2016 09:23
April 6, 2016 09:23
August 1, 2013 13:44
August 1, 2013 04:24
November 20, 2013 00:19
April 6, 2016 09:43
April 6, 2016 09:43

php-ar-drone

php-ar-drone is a port of node-ar-drone which allows user to control a Parrot AR Drone over PHP. No, isn't a joke.

This library provide the same features that the node library, that's why this documentation is heavy based on the node-ar-drone one. The low level UdpControl API is not implemented yet.

This library is built on the awesome reactphp library which bring non blocking i/o system to PHP.

Installation

Using Composer:

composer require jolicode/php-ar-drone dev-master

Usage

Some examples are located in the examples/ directory. Feel free to test those.

Client API

$client = new \Joli\ArDrone\Client();
// use API service (see below)
$client->start();

$client->takeoff($callback)

Sets the internal fly state to true, $callback is invoked after the drone reports that it is hovering.

$client->land($callback)

Sets the internal fly state to false, $callback is invoked after the drone reports it has landed.

$client->up($speed) / $client->down($speed)

Makes the drone gain or reduce altitude. $speed can be a value from 0 to 1.

$client->clockwise($speed) / $client->counterClockwise($speed)

Causes the drone to spin. $speed can be a value from 0 to 1.

$client->front($speed) / $client->back($speed)

Controls the pitch, which a horizontal movement using the camera as a reference point. $speed can be a value from 0 to 1.

$client->left($speed) / $client->right($speed)

Controls the roll, which is a horizontal movement using the camera as a reference point. $speed can be a value from 0 to 1.

$client->stop()

Sets all drone movement commands to 0, making it effectively hover in place.

Events

A client will emit landed, hovering, flying, landing, batteryChange, and altitudeChange events as long as demo navdata is enabled. Here is a example for catching event:

$client->on('landed', function() {
    // do something
});

About

🚁 Port of node-ar-drone which allows user to control a Parrot AR Drone over PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages