Closed nhooram closed 4 years ago
Figured it out. Needed rostopic echo /joy
and see the button indexes for each button. Here's what I've got to get it working with a PS4 Dualshock controller:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Designation for buttons in the joypad.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
enum JoypadButtonIndex
{
A_BUTTON,
B_BUTTON,
X_BUTTON,
Y_BUTTON,
LEFT_BUMPER,
RIGHT_BUMPER,
LEFT_TRIGGER,
RIGHT_TRIGGER,
BACK,
START,
LEFT_JOYSTICK,
RIGHT_JOYSTICK,
LOGITECH,
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Designation for axes in the joypad.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
enum JoypadAxisIndex
{
PRIMARY_X,
PRIMARY_Y,
SECONDARY_X,
SECONDARY_Z,
PRIMARY_Z,
SECONDARY_Y,
DPAD_LEFT_RIGHT,
DPAD_UP_DOWN,
};
I got the openshc stack to work on my 18 dof hexapod using the frankenX configuration, but I'm using a PS4 controller. Most of the keys work okay, but some mapping are off, namely the one to control the angular velocity. I think I'm supposed to touch this file https://github.com/csiro-robotics/syropod_remote/blob/master/include/syropod_remote/syropod_remote.h but I'm not sure how to go about doing it. Any suggestions would be appreciated!