NAME

UAV::Pilot::SDL::Joystick

SYNOPSIS

my $control = UAV::Pilot::Controller::ARDrone->new( ... );
my $condvar = AnyEvent->condvar;
my $joy = UAV::Pilot::SDL::Joystick->new({
    condvar => $condvar,
    controller => $control,
});

my $sdl_events = UAV::Pilot::SDL::Events->new({
    condvar    => $condvar,
    controller => $control,
});
$sdl_events->register( $joy );

DESCRIPTION

Handles joystick control for SDL joysticks. This does the role UAV::Pilot::SDL::EventHandler, so it can be passed to <UAV::Pilot::SDL::Events-register()>>.

Joystick configuration will be loaded from a YAML config file. You can find the path with <UAV::Pilot-default_config_dir()>>. If the file does not exist, it will be created automatically.

CONFIGURATION FILE

The config file is in YAML format. It contains the following keys:

joystick_num

The SDL joystick number to use

pitch_axis

Axis number of joystick to use for pitch.

roll_axis

Axis number of joystick to use for roll.

yaw_axis

Axis number of joystick to use for yaw.

throttle_axis

Axis number of joystick to use for throttle.

takeoff_btn

Button number to use for takeoff/landing.