This documentation is no longer maintained. For documentation of the current version of emc2, please see http://www.linuxcnc.org/docview/html

HAL_JOYSTICK

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
USAGE
SEE ALSO
BUGS
AUTHOR
REPORTING BUGS
COPYRIGHT

NAME

hal_joystick − (DEPRECATED) control HAL pins with a joystick

SYNOPSIS

hal_joystick [-d device] [-p prefix]

DESCRIPTION

hal_joystick is deprecated. Use hal_input(1) instead. hal_joystick will be removed from a future version of emc.

hal_joystick allows a joystick to generate HAL (Hardware Abstraction Layer) signals. Although not a hard realtime component, it is quite responsive under moderate system load. It provides analog (float) HAL pins for each joystick axis, and digital (bit) pins for each joystick button or trigger.

OPTIONS

-d device

use device as the joystick device (default is /dev/input/js0).

-p prefix

use prefix for the HAL pin names (default is "joystick.0").

USAGE

hal_joystick runs forever until interrupted with SIGINT or SIGTERM. Normally it would be invoked as hal_joystick & to run in the background.

For each joystick axis, it exports a HAL float pin called "<prefix>.axis.<N>" where N is an integer, starting at zero. The value of the pin will range from -1.0 to +1.0 as the axis is moved thru its range of motion.

For each joystick button, it exports a HAL bit pin called "<prefix>.button.<M>" where M is also an integer starting at zero.

The mapping of axis and buttons to N and M are joystick dependent, as is the direction of motion that results in positive values of the axis pin. hal_joystick uses the numbering and direction that is reported by the Linux joystick driver. For modern USB or other digital joysticks, the Linux driver figures out the number of axis and buttons automatically. For older analog joysticks, the driver may need configured by the user. See Linux documentation for more details. Once the Linux driver is properly configured, the HAL driver will configure itself to match automatically.

SEE ALSO

hal_input(1)

BUGS

hal_joystick is incompatible with the way that halcmd waits for components to be ready. This leads to race conditions when connecting signals to hal_joystick’s pins.

Perhaps the analog axes should have a "scale" parameter that could be used to scale the -1.0 to +1.0 range to whatever the user needs. It would also allow the direction of an axis to be reversed by using a negative scale. This can already be done using a HAL scale block, but a built-in scale parameter would be more convenient.

AUTHOR

Written by John Kasunich, as part of the Enhanced Machine Controller (EMC) project.

REPORTING BUGS

Report bugs to jmkasunich AT users DOT sourceforge DOT net

COPYRIGHT

Copyright © 2003 John Kasunich.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.