Timm Murray > UAV-Pilot-0.8 > UAV::Pilot::ARDrone::Control::Event

Download:
UAV-Pilot-0.8.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  2
View/Report Bugs
Source  

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.

syntax highlighting: