The JoystickControl module reads the input provided by a joystick and translates this information into a speed and an angle that the module that controls the robotic base can understand. It also publishes the information about the buttons that are pressed on the joystick.
The JoystickControl module reads its main configuration from the pJoystickControl section of a mission file. The parameters read from this section are:
1. <b>AppTick</b>
2. <b>CommsTick</b>
3. <b>max_v:</b> Maximum linear speed (m/s).
4. <b>max_w:</b> Maximum angular speed (deg/s).
The linear speed will be published in the MOTION_CMD_V variable and the angular speed in MOTION_CMD_W. In BUTTONS_CMD a byte with the pressed buttons is published. For JoystickControl to publish this information (and therefore, to control the movement of the robotic base), it is necessary that the JOYSTICK_MODE variable is published and its value is 1. Otherwise, the JoystickControl module will not publish anything and leave the control of the base to some other module (usually the reactive navigator).
This section contains all the information about the development of the module. Read it if you intend to gain insight about the implementation or you plan to improve or debug it.
The module uses the CJoystick object built inside MRPT. It is included in mrpt/hwdrivers/CJoystick.h. JoystickControl periodically requests the CJoystick object for the position of the joystick and the state of the buttons, and publishes the results.
JoystickControl has been tested with a Logitech Cordless Rumblepad 2.
Anonymous