NAME
UAV::Pilot::ARDrone::SDLNavOutput
SYNOPSIS
my $condvar = AnyEvent->condvar;
my $events = UAV::Pilot::Events->new({
condvar => $condvar,
});
my $window = UAV::Pilot::SDL::Window->new;
my $sdl_nav = UAV::Pilot::ARDrone::SDLNavOutput->new({
driver => UAV::Pilot::ARDrone::Driver->new( ... ),
window => $window,
});
$events->register( $sdl_nav );
DESCRIPTION
Graphically renders a UAV::Pilot::ARDrone::NavPacket
using SDL.
It does the UAV::Pilot::EventHandler
role, and thus can be processed by UAV::Pilot::Events
. It's recommended to also add the UAV::Pilot::SDL::Events
handler to the events object, as that will take care of the SDL_QUIT
events. Without that, there's no way to stop the process other than kill -9
.
METHODS
new
new({
feeder => ...
})
Constructor. The param feeder
takes a UAV::Pilot::SDL::NavFeeder
object.
render
render( $nav_packet )
Updates the graphic with the given nav packet data.