uwreact / frc_control

ROS metapackage enabling FRC teams to use ROS on their robots
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Publish joystick data from Driver Station #51

Open matthew-reynolds opened 5 years ago

matthew-reynolds commented 5 years ago

🚀 Feature Request

Part of #13.

While perhaps less important for our autonomous application, one of the most critical features of the driver station is the ability to interface with USB gamepads and pass the data to the robot.

These will be published in an array of sensor_msgs/Joy msgs, wrapped in a msg that also contains a few bonus fields such as each stick's name and HIDType.

This should be done in a fashion as similar to the real driver station as possible. We want up to 6 USB joysticks, re-orderable in the UI, with a gamepad-viewer debug tool for the currently selected stick. We should take care to ensure that our button, axis, and POV enumeration is identical to that of the NI Driver Station, so that we don't get weirdness when going back and forth.

One hiccup to this parity is the fact that the sensor_msgs/Joy messages do not contain POV hats, only axes and buttons. My suggestion is to append the POV hat state in both the axis and button arrays, since it's kinda neither but also kinda both. Alternatively/additionally, we could pass either info about the POV (ie. "The POV is mapped to axes 4 and 5, as well as buttons 6, 7, 8, and 9") and/or the POV itself alongside the joystick messages.