[Documentation] [TitleIndex] [WordIndex

Proposal

Proposed new joystick message

Proposal 1

Header header
string joystick_name
float32[] axes
int32[] axes_identifier
bool[] buttons
int32[] buttons_identifier
# A bunch of constants for the identifiers.

Proposal 2

Header header
string joystick_name
float32 value
uint8 type
uint32 identifier
# A bunch of constants for the identifiers.

Comments

/*
 * Keys and buttons
 *
 * Most of the keys/buttons are modeled after USB HUT 1.12
 * (see http://www.usb.org/developers/hidpage).
 * Abbreviations in the comments:
 * AC - Application Control
 * AL - Application Launch Button
 * SC - System Control
 */

#define KEY_RESERVED            0
#define KEY_ESC                 1
#define KEY_1                   2
...
#define BTN_MISC                0x100
#define BTN_0                   0x100
#define BTN_1                   0x101
...
#define BTN_LEFT                0x110
#define BTN_RIGHT               0x111
#define BTN_MIDDLE              0x112
#define BTN_SIDE                0x113
...
/*
 * Absolute axes
 */

#define ABS_X                   0x00
#define ABS_Y                   0x01
#define ABS_Z                   0x02
...
#define ABS_THROTTLE            0x06
#define ABS_RUDDER              0x07
#define ABS_WHEEL               0x08
#define ABS_GAS                 0x09

API review

Proposer: Blaise Gassend

Present at review:

Question / concerns / comments

Enter your thoughts on the API and any questions / concerns you have here. Please sign your name. Anything you want to address in the API review should be marked down here before the start of the meeting.

Blaise

Josh

JoyElement.msg:
float32 value
int32 identifier

bool onoff
bool analog

Joy.msg:
JoyElement[] elements

Eric

I think my proposed interface would be quite close to the current one:

Joy.msg:
String joystick_type   #e.g. PS3
float32 axes[] #always -1 to 1, not flipped from original joystick
float32 buttons[] #always 0 to 1, digital buttons just jump between extremes

And I would propose adding a HID message that is event-based, allows relative changes, passes through identifiers, and requires more software support on the other side.

HID.msg:
HIDEvent[] events

HIDEvent.msg:
int32 identifier
int32 value

This is informed by the linux kernel hiddev_event struct

79             struct hiddev_event {
80                 unsigned hid;
81                 signed int value;
82             };

And this would probably have to be paired with some set of service calls which replicate ioctl functionality, but could be mapped directly to have a ros node on one side which reads from an input device and makes it available over ros and have a node on a remote machine which looks like a local hid device, so that this could be used to map mice or anything else cleanly.

Meeting agenda

To be filled out by proposer based on comments gathered during API review period

Conclusion

Stack status change mark change manifest)



2024-11-09 14:36