The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

  UAV::Pilot::ARDrone::Control::Event

SYNOPSIS

    my $cv = AnyEvent->condvar;
    my $event = UAV::Pilot::EasyEvent->new({
        condvar => $cv,
    });
    
    my $driver = UAV::Pilot::Driver::ARDrone->new( ... );
    $driver->connect;
    my $dev = UAV::Pilot::Control::ARDrone::Event->new({
        driver               => $driver,
        joystick_num         => 0,
        joystick_takeoff_btn => 3,
    });
    $uav->init_event_loop( $cv, $event );

    $dev->pitch( -0.8 );
    $cv->recv; # Will now pitch forward until you kill the process

DESCRIPTION

AnyEvent-based version of UAV::Pilot::Control::ARDrone. With the normal module, you need to send movement commands yourself every 30ms to maintain smooth control. By using an event loop, this module handles the timing for you.

METHODS

init_event_loop

    init_event_loop( $cv, $event )

Sets up the event loop. Takes $cv (an AnyEvent::Condvar) and $event (a UAV::Pilot::EasyEvent).

Will listen for joystick events.

hover

Stops all movement.