VR-Engage  2.2
Loading...
Searching...
No Matches
RlCgfVrf::DtVreRlJoyController Class Reference

Detailed Description

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>

Inheritance diagram for RlCgfVrf::DtVreRlJoyController:
[legend]

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)
 
DtVreRlJoyControlleroperator= (const DtVreRlJoyController &orig)
 

Private Attributes

const DtVreRlJoyControllerDescriptormyDesc
 
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)
 
DtRotaryWingJoyFlightControlleroperator= (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
 

Constructor & Destructor Documentation

◆ DtVreRlJoyController() [1/2]

RlCgfVrf::DtVreRlJoyController::DtVreRlJoyController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of the component
ownerThe local object this component belongs to
simManagerThe simulation services manager
descComponent descriptor containing configuration
parentRegistryParent registry for reader/writer functionality

Initializes a new rotary-wing joystick controller component for VREngage control.

Referenced by DtVreRlJoyController(), and operator=().

◆ ~DtVreRlJoyController()

virtual RlCgfVrf::DtVreRlJoyController::~DtVreRlJoyController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the joystick controller component.

◆ DtVreRlJoyController() [2/2]

RlCgfVrf::DtVreRlJoyController::DtVreRlJoyController ( const DtVreRlJoyController & orig)
private

Copy constructor (not implemented)

Parameters
origThe source object

References DtVreRlJoyController().

Member Function Documentation

◆ init()

virtual bool RlCgfVrf::DtVreRlJoyController::init ( )
overridevirtual

Initializes the joystick controller.

Returns
True if initialization was successful

Performs initial setup of the joystick controller, including configuration loading and port initialization.

Reimplemented from makVre::DtRotaryWingJoyFlightController.

◆ tick()

virtual void RlCgfVrf::DtVreRlJoyController::tick ( )
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.

◆ createPorts()

virtual bool RlCgfVrf::DtVreRlJoyController::createPorts ( )
overridevirtual

Creates component ports.

Returns
True if port creation was successful

Creates output ports for cyclic, collective, pedals, and other helicopter controls.

◆ calcAndSetPortValues()

virtual void RlCgfVrf::DtVreRlJoyController::calcAndSetPortValues ( const DtString & functionGroup,
const DtString & function,
double value,
bool repeat )
overridevirtual

Calculates and sets port values for a specific joystick function.

Parameters
functionGroupThe function group of the joystick input
functionThe specific function within the group
valueThe input value from the joystick
repeatWhether this is a repeated input

Maps joystick inputs to the appropriate helicopter control outputs.

Reimplemented from makVre::DtRotaryWingJoyFlightController.

◆ type()

virtual const char * RlCgfVrf::DtVreRlJoyController::type ( ) const
overridevirtual

Gets the component type.

Returns
The type string for this component

Returns TS_JoyController as the component type identifier.

Reimplemented from makVre::DtRotaryWingJoyFlightController.

◆ joystickEnabledPort()

virtual DtBooleanOutputPort * RlCgfVrf::DtVreRlJoyController::joystickEnabledPort ( )
virtual

Gets the joystick enabled output port.

Returns
Pointer to the joystick enabled output port

Returns the output port that indicates whether joystick control is enabled.

◆ disable()

virtual void RlCgfVrf::DtVreRlJoyController::disable ( )
overridevirtual

Disables the joystick controller.

Disables joystick input processing, usually when player control is deactivated.

Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.

◆ enable()

virtual void RlCgfVrf::DtVreRlJoyController::enable ( )
overridevirtual

Enables the joystick controller.

Enables joystick input processing, usually when player control is activated.

Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.

◆ setIsEnabled()

virtual void RlCgfVrf::DtVreRlJoyController::setIsEnabled ( bool yes)
overridevirtual

Sets the enabled state of the joystick controller.

Parameters
yesTrue to enable the controller, false to disable

Directly sets the enabled state of the joystick controller.

Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.

◆ creator()

static DtSimComponent * RlCgfVrf::DtVreRlJoyController::creator ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )
static

Component factory function.

Parameters
nameThe name for the new component
ownerThe local object the component will belong to
simManagerThe simulation services manager
descComponent descriptor containing configuration
parentRegistryParent registry for reader/writer functionality
Returns
Pointer to the newly created component

Static factory function used for component creation through the component registry.

◆ operator=()

DtVreRlJoyController & RlCgfVrf::DtVreRlJoyController::operator= ( const DtVreRlJoyController & orig)
private

Assignment operator (not implemented)

Parameters
origThe source object
Returns
Reference to this object

References DtVreRlJoyController().

Member Data Documentation

◆ myDesc

const DtVreRlJoyControllerDescriptor* RlCgfVrf::DtVreRlJoyController::myDesc
private

Component descriptor containing configuration parameters.

◆ myWheelBrakeOutputPort

DtAnalogOutputPort* RlCgfVrf::DtVreRlJoyController::myWheelBrakeOutputPort
private

Output port for wheel brake control.

◆ myPedalOutputPort

DtAnalogOutputPort* RlCgfVrf::DtVreRlJoyController::myPedalOutputPort
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.

◆ myCollectiveOutputPort

DtConstrainedAnalogOutputPort* RlCgfVrf::DtVreRlJoyController::myCollectiveOutputPort
private

Output port for collective control (lift)

◆ myCyclicOutputPort

DtConstrainedDualAxisAnalogOutputPort* RlCgfVrf::DtVreRlJoyController::myCyclicOutputPort
private

Output port for cyclic control (pitch/roll)


The documentation for this class was generated from the following file: