VR-Forces 4.8 Class Documentation
 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) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
15 #include "vrfutil/rwColor.h"
16 #include "vrfutil/scriptGeometry.h"
17 
18 class DtAnalogOutputPort;
19 class DtIntegerInputPort;
21 class DtStringInputPort;
22 class DtStringOutputPort;
23 class DtVectorOutputPort;
24 class DtVectorInputPort;
31 class DtEvent;
32 
38  public DtBindableLuaComponent<DtSensorGimbalController>
39 {
40 
41 public:
42 
46  DtVrfObject* owner,
47  DtSimManager* simManager,
48  DtComponentDescriptor* desc = 0,
49  DtReaderWriterRegistry* parentRegistry = 0);
50 
52  virtual ~DtSensorGimbalController();
53 
54  virtual bool init();
55 
56  virtual bool postAddComponentsInit();
57 
60  virtual const char* type() const;
61 
62  virtual void tick();
63 
65 
66  static void setAimGimbalCallback(DtSimMessage * msg, void * usr);
67  virtual void processSetAimGimbal(DtSimMessage* msg);
69 
71 
72  static void setZoomSensorCallback(DtSimMessage * msg, void * usr);
73  virtual void processSetZoomSensor(DtSimMessage* msg);
75 
79 
80  static void setManualControlCallback(DtSimMessage * msg, void * usr);
81  virtual void processSetManualControl(DtSimMessage* msg);
83 
85 
86  static void setFieldOfViewColorCallback(DtSimMessage * msg, void * usr);
87  virtual void processSetFieldOfViewColor(DtSimMessage* msg);
89 
91 
92  static void setLasingCallback(DtSimMessage * msg, void * usr);
93  virtual void processSetLasing(DtSimMessage* msg);
95 
97 
98  static void laseTargetTaskCallback(DtSimMessage *msg, void * usrData);
99  virtual void processLaseTargetTaskMessage(DtSimMessage *msg);
101 
103 
104  static void laseLocationTaskCallback(DtSimMessage *msg, void * usrData);
105  virtual void processLaseLocationTaskMessage(DtSimMessage *msg);
107 
109 
110  virtual void setGimbalControlCallback(const DtEvent&);
111  virtual void processGimbalControl(DtSensorFieldOfViewControlInter* ctrlInter);
113 
115 
116 
118  virtual bool isUnderManualControl() const;
119 
121  virtual std::string mode() const;
122 
124  virtual double orientation(double& elevation) const;
125 
127  virtual DtLocation3D lookingAt() const;
128 
130 
133  virtual void bindLuaFunctions(lua_State* L);
134  virtual void bindLuaGlobals(lua_State* L);
135 
139  static DtSimComponent * creator(const DtString& name,
140  DtVrfObject* owner,
141  DtSimManager* simManager,
142  DtComponentDescriptor* desc = 0,
143  DtReaderWriterRegistry* parentRegistry = 0);
144 
145 protected:
147  virtual bool targetPoint(const DtTaitBryan& orientation, DtVector& location) const;
148  virtual DtVector localEyepoint() const;
149 
151  virtual bool createPortGroups();
152 
154  virtual bool createPorts();
155 
157  virtual DtSensorGimbalControllerPSR* createPSR();
158 
161  virtual void restoreDefaultAiming();
162 
164  virtual void aimSensorAtPoint(const DtVector& worldLocation);
165 
167  virtual void trackObject(const DtVrfObject* objectToTrack);
168 
171  virtual void aimSensorAtAngle(double azimuth, double elevation);
172 
176  virtual void scanSensor();
177 
181  virtual void searchAndTrackObject(const DtVrfObject* objectToTrack);
182 
184  virtual void currentPositionAzimuthAndElevation(DtVector& offset, double& az, double& el) const;
185 
187  virtual void currentWorldLocationAndOrientation(DtVector& location, DtTaitBryan& orientation) const;
188 
190  virtual DtArticulatedPartStateRepository* gimbalAzimuthPart();
191  virtual const DtArticulatedPartStateRepository* gimbalAzimuthPart() const;
192 
194  virtual DtArticulatedPartStateRepository* gimbalElevationPart();
195  virtual const DtArticulatedPartStateRepository* gimbalElevationPart() const;
196 
199  virtual bool findLocationOfSensorAiming(const DtVector& sensorLocation,
200  const DtTaitBryan& orientation, DtVector& aimingPoint) const;
201 
203  virtual const DtVrfObject* getLasingTarget();
204 
205  virtual void calcAndSetPortValues(const DtString& functionGroup, const DtString& function, double value, bool repeat);
206  virtual void joystickConnected();
207  virtual void joystickDisconnected();
208 
210  static DtRwColor randomFieldOfViewColor();
211 
212 private:
213 
216 
219  DtSensorGimbalController & orig);
220 
223  const DtSensorGimbalController & orig);
224 
225 protected:
226 
228 
230 
233 
236 
240 
242 
244 
245 
250 
258 
266 
273 
280 
287 
294 
300 
306 
312 
318 
324 
332 
339 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:144
DtSensorGimbalControllerPSR * myProcessState
Definition: sensorGimbalController.h:229
Instances of DtStringOutputPort are output ports through which data producers can send a DtString obj...
Definition: stringIOPort.h:52
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
bool myJoystickConnected
Definition: sensorGimbalController.h:241
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
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:279
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
DtIntegerOutputPort * myElevationRotationRatePercentagePort
Output Port Name: elevation-rotation-rate-percentage Output Port Description: Percentage of maximum r...
Definition: sensorGimbalController.h:286
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
Instances of DtSensorGimbalControllerDescriptor are used to specify the parameters for a DtSensorGimb...
Definition: sensorGimbalControllerDescriptor.h:18
Definition: bindableLuaComponent.h:53
Contains class declarations for DtIntegerInputPort, DtIntegerOutputPort, and DtIntegerPortData.
Definition: integerIOPort.h:25
DtIntegerOutputPort * myAzimuthRotationRatePercentagePort
Output Port Name: azimuth-rotation-rate-percentage Output Port Description: Percentage of maximum rot...
Definition: sensorGimbalController.h:293
Definition: events.h:47
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:299
DtOrientationInputPort * myOrientationInputPort
Input Port Name: orientation Input Port Description: Specifies the orientation of the sensor relative...
Definition: sensorGimbalController.h:257
DtAnalogOutputPort * myZoomLevelPort
Output Port Name: zoom-level Output Port Description: Current zoom level.
Definition: sensorGimbalController.h:317
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:337
DtAnalogOutputPort * myOrderedElevationPort
Output Port Name: ordered-elevation Output Port Description: Elevation at which to attempt to aim the...
Definition: sensorGimbalController.h:272
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
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
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:27
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:237
virtual void tick()
This gives the thread of control to the component.
DtSensorGimbalControllerDescriptor * mySensorGimbalDescriptor
Definition: sensorGimbalController.h:227
DtVectorOutputPort * myTargetLocationPort
Output Port Name: target-location Output Port Description: Location the sensor is targeting...
Definition: sensorGimbalController.h:305
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:29
DtJoystickControllerInterface & operator=(const DtJoystickControllerInterface &orig)
assignment operator; not implemented.
DtTaitBryan myWorldOrientationForAimingPoint
Definition: sensorGimbalController.h:238
virtual bool createPorts()
Called by init.
DtBooleanOutputPort * myLaserOnPort
Output Port Name: laser-on Output Port Description: Indicates whether the laser attached to this gimb...
Definition: sensorGimbalController.h:331
This class is responsible for controlling the aiming of a sensor on a gimbal.
Definition: sensorGimbalController.h:36
DtInputPortGroup * mySensorOffsetInputPortGroup
Input Port Group Name: sensor-offset Input Port Group Description: Allows the actuator to communicate...
Definition: sensorGimbalController.h:249
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
bool myDataNeededForAimingPoint
Whether the data is not yet loaded to find the aiming point.
Definition: sensorGimbalController.h:232
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:51
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtInputPortGroup is a data port group of a data consumer.
Definition: inputPortGroup.h:32
const char int mode
Definition: ioapi.h:38
DtIntegerOutputPort * myTrackingModePort
Output Port Name: tracking-mode Output Port Description: Tracking mode of the sensor.
Definition: sensorGimbalController.h:311
virtual void calcAndSetPortValues(const DtString &functionGroup, const DtString &function, double value, bool repeat)=0
Override to set.
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
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.
Definition: joystickControllerInterface.h:23
DtSensorGimbalControllerPSR is a process state repository which holds state variables for the DtSenso...
Definition: sensorGimbalControllerPSR.h:23
DtVectorInputPort * myPositionInputPort
Input Port Name: position Input Port Description: Specifies the position of the sensor in body coordi...
Definition: sensorGimbalController.h:265
DtIntegerOutputPort * myFieldOfViewColorPort
Output Port Name: field-of-view-color Output Port Description: Color of the sensor&#39;s field of view...
Definition: sensorGimbalController.h:323
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)