FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Switch console input
+ Collaboration diagram for Switch console input:

Reads the crane switch console joystick with SDL device index ConsoleID (OIS JoyStick::getID() until 3.0.0), through SDL (visualization builds only; without visualization the rates stay zero). It opens the joystick in RenderInit and polls it in RenderUpdate. Without the joystick it logs a warning and the rates stay zero.

Mapping from OIS to SDL. The SDL indices are the OIS indices (JoystickInput.h):

Rate OIS SDL
BaseRotation speed axis 2 / MAX_AXIS SDL_JoystickGetAxis(2) / 32767
BaseElevationAngleRate axis 1 / MAX_AXIS SDL_JoystickGetAxis(1) / 32767
JointAngleRate0 axis 3 / MAX_AXIS SDL_JoystickGetAxis(3) / 32767
Telescope 0 speed axis 4 / MAX_AXIS SDL_JoystickGetAxis(4) / 32767
JointAngleRate1 axis 0 / MAX_AXIS SDL_JoystickGetAxis(0) / 32767
Telescope 1 speed slider 0 / MAX_AXIS SDL_JoystickGetAxis(5) / 32767 (slider 0)

The axes are read on any axis or slider change; a rate below 0.05 in magnitude is zero. Buttons (SDL button i = OIS button i): 14 and 17 winch out while held, 15 winch in while held (the winch speed is 0.5 times the number held), 13 enables the crane while held, 12 attaches the cable while held.