VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sensorGimbalController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
16 #include "vrfutil/rwColor.h"
17 #include "vrfutil/scriptGeometry.h"
18 
19 namespace makVrf
20 {
21  class DtArticulatedPartStateRepository;
22 }
23 
24 class DtAnalogOutputPort;
25 class DtAnalogInputPort;
26 class DtIntegerInputPort;
28 class DtStringInputPort;
29 class DtStringOutputPort;
30 class DtVectorOutputPort;
31 class DtVectorInputPort;
38 
39 namespace makVrfEvents
40 {
41  class DtEvent;
42  class DtSensorFieldOfViewControlEvent;
43 }
44 
50  public DtBindableLuaComponent<DtSensorGimbalController>
51 {
52 
53 public:
54 
58  DtLocalObject* owner,
59  DtSimulationServices* simManager,
60  DtComponentDescriptor* desc = 0,
61  DtReaderWriterRegistry* parentRegistry = 0);
62 
64  virtual ~DtSensorGimbalController() override;
65 
66  virtual bool init() override;
67 
68  virtual bool postAddComponentsInit() override;
69 
72  virtual const char* type() const override;
73 
74  virtual void tick() override;
75 
77 
78  static void setAimGimbalCallback(DtSimMessage * msg, void * usr);
79  virtual void processSetAimGimbal(DtSimMessage* msg);
81 
83 
84  static void setZoomSensorCallback(DtSimMessage * msg, void * usr);
85  virtual void processSetZoomSensor(DtSimMessage* msg);
87 
91 
92  static void setManualControlCallback(DtSimMessage * msg, void * usr);
93  virtual void processSetManualControl(DtSimMessage* msg);
95 
97 
98  static void setFieldOfViewColorCallback(DtSimMessage * msg, void * usr);
99  virtual void processSetFieldOfViewColor(DtSimMessage* msg);
101 
103 
104  static void setLasingCallback(DtSimMessage * msg, void * usr);
105  virtual void processSetLasing(DtSimMessage* msg);
107 
109 
110  static void laseTargetTaskCallback(DtSimMessage *msg, void * usrData);
111  virtual void processLaseTargetTaskMessage(DtSimMessage *msg);
113 
115  virtual void clearTask() override;
116 
118 
119  virtual void setGimbalControlCallback(const makVrfEvents::DtEvent&);
120  virtual void processGimbalControl(const makVrfEvents::DtSensorFieldOfViewControlEvent* ctrlInter);
122 
124 
125 
127  virtual bool isUnderManualControl() const;
128 
130  virtual std::string mode() const;
131 
133  virtual double orientation(double& elevation) const;
134 
136  virtual DtLocation3D lookingAt() const;
137 
139 
142  virtual void bindLuaFunctions(lua_State* L) override;
143  virtual void bindLuaGlobals(lua_State* L) override;
144 
148  static DtSimComponent * creator(const DtString& name,
149  DtLocalObject* owner,
150  DtSimulationServices* simManager,
151  DtComponentDescriptor* desc = 0,
152  DtReaderWriterRegistry* parentRegistry = 0);
153 
154 protected:
156  virtual bool targetPoint(const DtTaitBryan& orientation, DtVector& location) const;
157  virtual DtVector localEyepoint() const;
158 
160  virtual bool createPortGroups() override;
161 
163  virtual bool createPorts() override;
164 
166  virtual DtSensorGimbalControllerPSR* createPSR();
167 
170  virtual void restoreDefaultAiming();
171 
173  virtual void aimSensorAtPoint(const DtVector& worldLocation);
174 
176  virtual void trackObject(const DtSimObject* objectToTrack);
177 
180  virtual void aimSensorAtAngle(double azimuth, double elevation);
181 
185  virtual void scanSensor();
186 
190  virtual void searchAndTrackObject(const DtSimObject* objectToTrack);
191 
193  virtual void currentPositionAzimuthAndElevation(DtVector& offset, double& az, double& el) const;
194 
196  virtual void currentWorldLocationAndOrientation(DtVector& location, DtTaitBryan& orientation) const;
197 
199  virtual makVrf::DtArticulatedPartStateRepository* gimbalAzimuthPart();
200  virtual const makVrf::DtArticulatedPartStateRepository* gimbalAzimuthPart() const;
201 
203  virtual makVrf::DtArticulatedPartStateRepository* gimbalElevationPart();
204  virtual const makVrf::DtArticulatedPartStateRepository* gimbalElevationPart() const;
205 
208  virtual bool findLocationOfSensorAiming(const DtVector& sensorLocation,
209  const DtTaitBryan& orientation, DtVector& aimingPoint) const;
210 
212  virtual DtSimObjectReference getLasingTarget();
213 
214  virtual void calcAndSetPortValues(
215  const DtString& functionGroup, const DtString& function, double value, bool repeat) override;
216  virtual void joystickConnected() override;
217  virtual void joystickDisconnected() override;
218 
220  virtual double minAzimuth() const;
221 
223  virtual double maxAzimuth() const;
224 
226  virtual double minElevation() const;
227 
229  virtual double maxElevation() const;
230 
234  virtual double leftAzimuthLimit() const;
235 
239  virtual double rightAzimuthLimit() const;
240 
242  virtual void registerTaskMsgCallbacks() override;
243 
245  static DtRwColor randomFieldOfViewColor();
246 
247 private:
248 
251 
254  DtSensorGimbalController & orig);
255 
258  const DtSensorGimbalController & orig);
259 
260 protected:
261 
263 
265 
268 
271 
275 
277 
279 
280 
285 
293 
301 
306 
312 
318 
324 
330 
337 
344 
351 
358 
364 
370 
376 
382 
388 
394 
402 
409 
416 
419 
421  bool myGotTarget = false;
422 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtSensorGimbalControllerPSR * myProcessState
Definition: sensorGimbalController.h:264
Instances of DtStringOutputPort are output ports through which data producers can send a DtString obj...
Definition: stringIOPort.h:52
Definition: sensorFieldOfViewControlEvent.h:15
DtInputPortGroup * myGimbalLimitsPortGroup
Input Port Group Name: gimbal-limits Input Port Group Description: Allows the actuator to communicate...
Definition: sensorGimbalController.h:305
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
DtBooleanOutputPort * myPowerOnPort
Output Port Name: power-on Output Port Description: Indicates whether the gimbaled sensor is on or of...
Definition: sensorGimbalController.h:408
DtAnalogInputPort * myMaxAzimuthPort
Input Port Name: max-azimuth Input Port Description: The maximum azimuth at which the gimbal can aim...
Definition: sensorGimbalController.h:317
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
bool myJoystickConnected
Definition: sensorGimbalController.h:276
virtual void registerTaskMsgCallbacks()
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
virtual void bindLuaFunctions(lua_State *)=0
Override to bind lua functions.
Contains class declarations for DtStringInputPort, DtStringOutputPort, and DtStringPortData.
Definition: stringIOPort.h:27
DtAnalogOutputPort * myOrderedAzimuthPort
Output Port Name: ordered-azimuth Output Port Description: Azimuth at which to attempt to aim the gim...
Definition: sensorGimbalController.h:343
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtIntegerOutputPort * myElevationRotationRatePercentagePort
Output Port Name: elevation-rotation-rate-percentage Output Port Description: Percentage of maximum r...
Definition: sensorGimbalController.h:350
DtAnalogInputPort * myMaxElevationPort
Input Port Name: max-elevation Input Port Description: The maximum elevation at which the gimbal can ...
Definition: sensorGimbalController.h:329
Definition: readerWriterRegistry.h:39
Instances of DtSensorGimbalControllerDescriptor are used to specify the parameters for a DtSensorGimb...
Definition: sensorGimbalControllerDescriptor.h:18
Definition: bindableLuaComponent.h:56
Contains class declarations for DtIntegerInputPort, DtIntegerOutputPort, and DtIntegerPortData.
Definition: integerIOPort.h:25
DtAnalogInputPort * myMinElevationPort
Input Port Name: min-elevation Input Port Description: The minimum elevation at which the gimbal can ...
Definition: sensorGimbalController.h:323
DtIntegerOutputPort * myAzimuthRotationRatePercentagePort
Output Port Name: azimuth-rotation-rate-percentage Output Port Description: Percentage of maximum rot...
Definition: sensorGimbalController.h:357
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
DtStringOutputPort * myTargetObjectPort
Output Port Name: target-object Output Port Description: Name of the object the sensor is targeting...
Definition: sensorGimbalController.h:363
DtOrientationInputPort * myOrientationInputPort
Input Port Name: orientation Input Port Description: Specifies the orientation of the sensor relative...
Definition: sensorGimbalController.h:292
DtAnalogOutputPort * myZoomLevelPort
Output Port Name: zoom-level Output Port Description: Current zoom level. Output Port Range: 1...
Definition: sensorGimbalController.h:387
virtual void joystickDisconnected()=0
Called when joystick is disconnected for this controller.
DtEntityListInputPort * myTargetListPort
Input Port Name: target-list Input Port Description: Specifies the targets for the integrated laser...
Definition: sensorGimbalController.h:414
DtAnalogOutputPort * myOrderedElevationPort
Output Port Name: ordered-elevation Output Port Description: Elevation at which to attempt to aim the...
Definition: sensorGimbalController.h:336
Reader-Writer color specified by red, green, blue components.
Definition: rwColor.h:19
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
DtAnalogInputPort * myMinAzimuthPort
Input Port Name: min-azimuth Input Port Description: The minimum azimuth at which the gimbal can aim...
Definition: sensorGimbalController.h:311
Definition: event.h:13
virtual void joystickConnected()=0
Called when joystick is connected for this controller.
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
DtVectorOutputPort * myTargetObjectOffsetPort
Output Port Name: target-object-offset Output Port Description: Offset of the target object relative ...
Definition: sensorGimbalController.h:369
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:29
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: sensorGimbalController.h:418
File: simMsg.h.
Definition: simMessage.h:35
DtVector myWorldLocationForAimingPoint
World location and orientation for determining the aiming point when data was not initially available...
Definition: sensorGimbalController.h:272
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation frame...
DtSensorGimbalControllerDescriptor * mySensorGimbalDescriptor
Definition: sensorGimbalController.h:262
DtVectorOutputPort * myTargetLocationPort
Output Port Name: target-location Output Port Description: Location the sensor is targeting...
Definition: sensorGimbalController.h:375
DtJoystickControllerInterface & operator=(const DtJoystickControllerInterface &orig)
assignment operator; not implemented.
DtTaitBryan myWorldOrientationForAimingPoint
World location and orientation for determining the aiming point when data was not initially available...
Definition: sensorGimbalController.h:273
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtBooleanOutputPort * myLaserOnPort
Output Port Name: laser-on Output Port Description: Indicates whether the laser attached to this gimb...
Definition: sensorGimbalController.h:401
This class is responsible for controlling the aiming of a sensor on a gimbal. Uses Descriptor Type: D...
Definition: sensorGimbalController.h:48
DtInputPortGroup * mySensorOffsetInputPortGroup
Input Port Group Name: sensor-offset Input Port Group Description: Allows the actuator to communicate...
Definition: sensorGimbalController.h:284
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:80
bool myDataNeededForAimingPoint
Whether the data is not yet loaded to find the aiming point.
Definition: sensorGimbalController.h:267
Input and output ports containing a DtTaitBryan.
Definition: orientationIOPort.h:26
Instances of DtSensorFieldOfViewControlInter are used to store state data for SensorFieldOfViewContro...
Definition: sensorFieldOfViewControlInterDIS.h:30
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:40
const char int mode
Definition: ioapi.h:38
DtIntegerOutputPort * myTrackingModePort
Output Port Name: tracking-mode Output Port Description: Tracking mode of the sensor. Output Port Range: Values specified by DtAimableSystemTrackingMode enum Output Group Parent: .
Definition: sensorGimbalController.h:381
Contains class declarations for DtAnalogInputPort, DtAnalogOutputPort, and DtAnalogPortData.
Definition: analogIOPort.h:25
virtual void calcAndSetPortValues(const DtString &functionGroup, const DtString &function, double value, bool repeat)=0
Override to set.
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
virtual void bindLuaGlobals(lua_State *)=0
Override to bind lua globals.
voidpf uLong offset
Definition: ioapi.h:42
Will manage basic functionality of a joystick controller. Implement pure virtual functions to respons...
Definition: joystickControllerInterface.h:23
DtSensorGimbalControllerPSR is a process state repository which holds state variables for the DtSenso...
Definition: sensorGimbalControllerPSR.h:25
DtVectorInputPort * myPositionInputPort
Input Port Name: position Input Port Description: Specifies the position of the sensor in body coordi...
Definition: sensorGimbalController.h:300
DtIntegerOutputPort * myFieldOfViewColorPort
Output Port Name: field-of-view-color Output Port Description: Color of the sensor&#39;s field of view...
Definition: sensorGimbalController.h:393
A locally simulated VRF object.
Definition: localObject.h:98
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)