|
VR-Engage
2.2
|
This class manages joystick input for rotary-wing aircraft and converts it into appropriate control surface movements. It handles various input devices and maps their values to helicopter control outputs, providing a bridge between the physical joystick and the helicopter flight model.
#include <vreRlJoyController.h>
Public Member Functions | |
| DtVreRlJoyController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtVreRlJoyController () override |
| virtual bool | init () override |
| virtual void | tick () override |
| virtual bool | createPorts () override |
| virtual void | calcAndSetPortValues (const DtString &functionGroup, const DtString &function, double value, bool repeat) override |
| virtual const char * | type () const override |
| virtual DtBooleanOutputPort * | joystickEnabledPort () |
| virtual void | disable () override |
| virtual void | enable () override |
| virtual void | setIsEnabled (bool yes) override |
Public Member Functions inherited from makVre::DtRotaryWingJoyFlightController | |
| DtRotaryWingJoyFlightController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtRotaryWingJoyFlightController () override |
Public Member Functions inherited from vreRtd::DtVreRtdTraitJoyControllerExtension | |
| DtVreRtdTraitJoyControllerExtension () | |
| virtual | ~DtVreRtdTraitJoyControllerExtension () |
| virtual void | tick (bool myJoystickEnabled) |
| virtual bool | createJoystickEnabledPort () |
| virtual void | processSetJoyDeviceSwitch (DtSimMessage *msg) |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
Static Public Member Functions inherited from makVre::DtRotaryWingJoyFlightController | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
Private Member Functions | |
| DtVreRlJoyController (const DtVreRlJoyController &orig) | |
| DtVreRlJoyController & | operator= (const DtVreRlJoyController &orig) |
Private Attributes | |
| const DtVreRlJoyControllerDescriptor * | myDesc |
| DtAnalogOutputPort * | myWheelBrakeOutputPort |
| DtAnalogOutputPort * | myPedalOutputPort |
| DtConstrainedAnalogOutputPort * | myCollectiveOutputPort |
| DtConstrainedDualAxisAnalogOutputPort * | myCyclicOutputPort |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtRotaryWingJoyFlightController | |
| virtual void | calculateGains (const DtReal manuverConst, const DtReal riseTime, DtReal &velGain, DtReal &oriGain) |
| virtual void | joystickConnected () override |
| virtual void | joystickDisconnected () override |
| DtRotaryWingJoyFlightController () | |
| DtRotaryWingJoyFlightController (const DtRotaryWingJoyFlightController &orig) | |
| DtRotaryWingJoyFlightController & | operator= (const DtRotaryWingJoyFlightController &orig) |
Protected Attributes inherited from makVre::DtRotaryWingJoyFlightController | |
| DtReal | myPitchVelGain |
| DtReal | myPitchOriGain |
| DtReal | myRollVelGain |
| DtReal | myRollOriGain |
| DtReal | myYawVelGain |
| DtReal | myYawOriGain |
Protected Attributes inherited from vreRtd::DtVreRtdTraitJoyControllerExtension | |
| DtBooleanOutputPort * | myJoystickEnabledPort |
| bool | myFirstTick |
| bool | myPreviousJoystickState |
| RlCgfVrf::DtVreRlJoyController::DtVreRlJoyController | ( | const DtString & | name, |
| DtLocalObject * | owner, | ||
| DtSimulationServices * | simManager, | ||
| DtComponentDescriptor * | desc = 0, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
| name | The name of the component |
| owner | The local object this component belongs to |
| simManager | The simulation services manager |
| desc | Component descriptor containing configuration |
| parentRegistry | Parent registry for reader/writer functionality |
Initializes a new rotary-wing joystick controller component for VREngage control.
Referenced by DtVreRlJoyController(), and operator=().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the joystick controller component.
|
private |
Copy constructor (not implemented)
| orig | The source object |
References DtVreRlJoyController().
|
overridevirtual |
Initializes the joystick controller.
Performs initial setup of the joystick controller, including configuration loading and port initialization.
Reimplemented from makVre::DtRotaryWingJoyFlightController.
|
overridevirtual |
Performs per-frame processing.
Called once per simulation frame to calculate new control values based on current joystick input and update the output ports.
|
overridevirtual |
Creates component ports.
Creates output ports for cyclic, collective, pedals, and other helicopter controls.
|
overridevirtual |
Calculates and sets port values for a specific joystick function.
| functionGroup | The function group of the joystick input |
| function | The specific function within the group |
| value | The input value from the joystick |
| repeat | Whether this is a repeated input |
Maps joystick inputs to the appropriate helicopter control outputs.
Reimplemented from makVre::DtRotaryWingJoyFlightController.
|
overridevirtual |
Gets the component type.
Returns TS_JoyController as the component type identifier.
Reimplemented from makVre::DtRotaryWingJoyFlightController.
|
virtual |
Gets the joystick enabled output port.
Returns the output port that indicates whether joystick control is enabled.
|
overridevirtual |
Disables the joystick controller.
Disables joystick input processing, usually when player control is deactivated.
Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.
|
overridevirtual |
Enables the joystick controller.
Enables joystick input processing, usually when player control is activated.
Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.
|
overridevirtual |
Sets the enabled state of the joystick controller.
| yes | True to enable the controller, false to disable |
Directly sets the enabled state of the joystick controller.
Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.
|
static |
Component factory function.
| name | The name for the new component |
| owner | The local object the component will belong to |
| simManager | The simulation services manager |
| desc | Component descriptor containing configuration |
| parentRegistry | Parent registry for reader/writer functionality |
Static factory function used for component creation through the component registry.
|
private |
Assignment operator (not implemented)
| orig | The source object |
References DtVreRlJoyController().
|
private |
Component descriptor containing configuration parameters.
|
private |
Output port for wheel brake control.
|
private |
Output port for pedal control (yaw)
Pedal port of VRF rotWingActuator doesn't get any values. Seems to be a bug. Use this port to apply values.
|
private |
Output port for collective control (lift)
|
private |
Output port for cyclic control (pitch/roll)