VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
laserLightController.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 
15 #include "vrfutil/scriptGeometry.h"
16 
17 namespace makVrf
18 {
19  class DtArticulatedPartStateRepository;
20 }
21 
22 class DtAnalogOutputPort;
23 class DtAnalogInputPort;
24 class DtIntegerInputPort;
26 class DtStringInputPort;
27 class DtStringOutputPort;
28 class DtVectorOutputPort;
29 class DtVectorInputPort;
31 class DtBooleanInputPort;
36 class DtVrfLaserLight;
37 
38 namespace makVrfEvents
39 {
40  class DtEvent;
41 }
42 
46  , public DtBindableLuaComponent<DtLaserLightController>
47 {
48 
49 public:
50 
53  DtLaserLightController(const DtString& name,
54  DtLocalObject* owner,
55  DtSimulationServices* simManager,
56  DtComponentDescriptor* desc = 0,
57  DtReaderWriterRegistry* parentRegistry = 0);
58 
60  virtual ~DtLaserLightController() override;
61 
62  virtual bool init() override;
63 
64  virtual bool postAddComponentsInit() override;
65 
68  virtual const char* type() const override;
69 
70  virtual void tick() override;
71 
73 
74  static void setAimLaserLightCallback(DtSimMessage * msg, void * usr);
75  virtual void processSetAimLaserLight(DtSimMessage* msg);
77 
79  virtual void clearTask() override;
80 
82 
83 
85  virtual std::string mode() const;
86 
88  virtual double orientation(double& elevation) const;
89 
91  virtual DtLocation3D lookingAt() const;
92 
94 
97  virtual void bindLuaFunctions(lua_State* L) override;
98  virtual void bindLuaGlobals(lua_State* L) override;
99 
103  static DtSimComponent * creator(const DtString& name,
104  DtLocalObject* owner,
105  DtSimulationServices* simManager,
106  DtComponentDescriptor* desc = 0,
107  DtReaderWriterRegistry* parentRegistry = 0);
108 
109 protected:
110  virtual void enable() override;
111  virtual void disable() override;
112 
114  virtual bool targetPoint(const DtTaitBryan& orientation, DtVector& location) const;
115  virtual DtVector localEyepoint() const;
116 
118  virtual bool createPortGroups() override;
119 
121  virtual bool createPorts() override;
122 
124  virtual DtLaserLightControllerPSR* createPSR();
125 
127  virtual void initLaserLight();
128 
129  DtVector bodyLaserLightPosition() const;
130 
131  DtTaitBryan bodyLaserLightOrientation() const;
132 
135  virtual void restoreDefaultAiming();
136 
138  virtual void aimLaserLightAtPoint(const DtVector& worldLocation);
139 
141  virtual void trackObject(const DtSimObject* objectToTrack);
142 
145  virtual void aimLaserLightAtAngle(double azimuth, double elevation);
146 
148  virtual void currentPositionAzimuthAndElevation(DtVector& offset, double& az, double& el) const;
149 
151  virtual void currentWorldLocationAndOrientation(DtVector& location, DtTaitBryan& orientation) const;
152 
154  virtual makVrf::DtArticulatedPartStateRepository* laserLightAzimuthArtPart();
155  virtual const makVrf::DtArticulatedPartStateRepository* laserLightAzimuthArtPart() const;
156 
158  virtual makVrf::DtArticulatedPartStateRepository* laserLightElevationArtPart();
159  virtual const makVrf::DtArticulatedPartStateRepository* laserLightElevationArtPart() const;
160 
163  virtual bool findLocationOfLaserLightAiming(const DtVector& laserLocation,
164  const DtTaitBryan& orientation, DtVector& aimingPoint) const;
165 
167  virtual double minAzimuth() const;
168 
170  virtual double maxAzimuth() const;
171 
173  virtual double minElevation() const;
174 
176  virtual double maxElevation() const;
177 
178 private:
179 
182 
185  DtLaserLightController & orig);
186 
189  const DtLaserLightController & orig);
190 
191 protected:
192 
194 
196 
199 
202 
205 
209 
212 
216 
218 
219 
224 
232 
240 
245 
251 
257 
263 
269 
277 
284 
291 
298 
305 
312 
315 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
bool myDataNeededForAimingPoint
Whether the data is not yet loaded to find the aiming point.
Definition: laserLightController.h:201
Instances of DtStringOutputPort are output ports through which data producers can send a DtString obj...
Definition: stringIOPort.h:52
DtAnalogOutputPort * myOrderedElevationPort
Output Port Name: ordered-elevation Output Port Description: Elevation at which to attempt to aim the...
Definition: laserLightController.h:283
DtVrfLaserLight manages a VR-Link laser light publisher, and sets all the values associated with a la...
Definition: vrfLaserLight.h:27
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
This class is responsible for controlling the aiming of a laser light. Uses Descriptor Type: DtCompon...
Definition: laserLightController.h:45
DtAnalogInputPort * myMinElevationPort
Input Port Name: min-elevation Input Port Description: The minimum elevation at which the light can a...
Definition: laserLightController.h:262
DtBooleanOutputPort * myPowerOnPort
Output Port Name: power-on Output Port Description: Specifies whether the laser light is powered on...
Definition: laserLightController.h:297
Instances of DtLaserLightControllerDescriptor are used to specify the parameters for a DtLaserLightCo...
Definition: laserLightControllerDescriptor.h:18
DtInputPortGroup * myLaserLightOffsetInputPortGroup
Input Port Group Name: laser-light-offset Input Port Group Description: Allows the actuator to commun...
Definition: laserLightController.h:223
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtBooleanInputPort * myOrientationAchievedInputPort
Input Port Name: orientation-achieved Input Port Description: Specifies whether the laser light was a...
Definition: laserLightController.h:276
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
DtOrientationInputPort * myOrientationInputPort
Input Port Name: orientation Input Port Description: Specifies the orientation of the laser relative ...
Definition: laserLightController.h:231
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.
DtIntegerOutputPort * myAzimuthRotationRatePercentagePort
Output Port Name: azimuth-rotation-rate-percentage Output Port Description: Percentage of maximum rot...
Definition: laserLightController.h:311
Contains class declarations for DtStringInputPort, DtStringOutputPort, and DtStringPortData.
Definition: stringIOPort.h:27
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
Definition: bindableLuaComponent.h:56
Contains class declarations for DtIntegerInputPort, DtIntegerOutputPort, and DtIntegerPortData.
Definition: integerIOPort.h:25
DtVrfLaserLight * myLaserLight
The field of view of the laser.
Definition: laserLightController.h:198
DtLaserLightControllerPSR * myProcessState
Definition: laserLightController.h:195
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
DtLaserLightControllerDescriptor * myLaserLightDescriptor
Definition: laserLightController.h:193
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: laserLightController.h:314
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:29
virtual void disable() override
Overridden to 1) remove any task message callbacks registered by this controller 2) call clear task...
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation frame...
DtAnalogInputPort * myMaxAzimuthPort
Input Port Name: max-azimuth Input Port Description: The maximum azimuth at which the light can aim...
Definition: laserLightController.h:256
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtTaitBryan myWorldOrientationForAimingPoint
World location and orientation for determining the aiming point when data was not initially available...
Definition: laserLightController.h:214
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
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
DtVector myWorldLocationForAimingPoint
World location and orientation for determining the aiming point when data was not initially available...
Definition: laserLightController.h:213
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
virtual void enable() override
Overridden to call registerTaskMsgCallbacks().
double myLastSentAzimuth
Last sent azimuth and elevation sent to the actuator. Used to detect false positives with orientation...
Definition: laserLightController.h:206
Input and output ports containing a DtTaitBryan.
Definition: orientationIOPort.h:26
DtIntegerOutputPort * myElevationRotationRatePercentagePort
Output Port Name: elevation-rotation-rate-percentage Output Port Description: Percentage of maximum r...
Definition: laserLightController.h:304
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
Contains class declarations for DtAnalogInputPort, DtAnalogOutputPort, and DtAnalogPortData.
Definition: analogIOPort.h:25
DtInputPortGroup * myLaserLightLimitsPortGroup
Input Port Group Name: laser-light-limits Input Port Group Description: Allows the actuator to commun...
Definition: laserLightController.h:244
DtLaserLightControllerPSR is a process state repository which holds state variables for the DtLaserLi...
Definition: laserLightControllerPSR.h:17
DtAnalogInputPort * myMinAzimuthPort
Input Port Name: min-azimuth Input Port Description: The minimum azimuth at which the light can aim...
Definition: laserLightController.h:250
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
DtAnalogInputPort * myMaxElevationPort
Input Port Name: max-elevation Input Port Description: The maximum elevation at which the light can a...
Definition: laserLightController.h:268
DtAnalogOutputPort * myOrderedAzimuthPort
Output Port Name: ordered-azimuth Output Port Description: Azimuth at which to attempt to aim the lig...
Definition: laserLightController.h:290
DtVectorInputPort * myPositionInputPort
Input Port Name: position Input Port Description: Specifies the position of the laser in body coordin...
Definition: laserLightController.h:239
double myLastSentElevation
Last sent azimuth and elevation sent to the actuator. Used to detect false positives with orientation...
Definition: laserLightController.h:207
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)