UAV::Pilot::ARDrone::Control::Event
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
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.
UAV::Pilot::Control::ARDrone
init_event_loop( $cv, $event )
Sets up the event loop. Takes $cv (an AnyEvent::Condvar) and $event (a UAV::Pilot::EasyEvent).
$cv
AnyEvent::Condvar
$event
UAV::Pilot::EasyEvent
Will listen for joystick events.
Stops all movement.
To install UAV::Pilot::ARDrone, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UAV::Pilot::ARDrone
CPAN shell
perl -MCPAN -e shell install UAV::Pilot::ARDrone
For more information on module installation, please visit the detailed CPAN module installation guide.