VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
examples
radarWarnRx
simpleRdrWrnResp.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2017 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
6
#pragma once
7
8
#include "
vrfmodel/fixedWingPilotController.h
"
9
10
//class DtSimpleRadarWarningResponse:
11
//
12
//Instances of DtSimpleRadarWarningResponse are an example of a controller
13
//that implements a reactive behavior when a it receives sensor input that
14
//a radar has been detected. It receives a list of emitter systems (hostile
15
//radar systems). It takes the first emitter in the list and flys away to
16
//a location in the opposite direction.
17
18
class
DtVrfObject
;
19
class
DtEntityListInputPort
;
20
class
DtUUID
;
21
22
class
DtSimpleRadarWarningResponse
:
public
DtFixedWingPilotController
23
{
24
public
:
25
26
//constructor
27
DtSimpleRadarWarningResponse
(
const
DtString
&
name
,
DtVrfObject
* owner,
28
DtSimManager
*
simManager
,
DtComponentDescriptor
* desc = NULL,
29
DtReaderWriterRegistry
*
const
parentRegistry = 0);
30
31
32
//destructor
33
virtual
~DtSimpleRadarWarningResponse
();
34
35
//This returns a string that uniquely identifies this type of component.
36
//(must be unique with respect to the component types defined in compTypes.h
37
//as well as any additional user-defined components). Returns the string
38
//"simple-radar-warning-response".
39
virtual
const
char
*
type
()
const
;
40
41
//Calculate new control values.
42
virtual
void
tick
();
43
44
//Returns a newly created instance of this class. We need to provide
45
//this function so that we can register this class with the component
46
//factory.
47
static
DtSimComponent
*
creator
(
const
DtString
& name,
DtVrfObject
* owner,
48
DtSimManager
* simManager,
DtComponentDescriptor
* desc,
49
DtReaderWriterRegistry
* parentRegistry);
50
51
protected
:
52
53
//Called by DtSimComponent::init to create myEntityListPort used to manage
54
//multiple sensors that might provide targets to this controller.
55
virtual
bool
createPorts
();
56
57
//Looks up safe control point by name. If the object exists and it has
58
//a valid state repository, returns the object. Otherwise returns NULL.
59
virtual
DtVrfObject
*
getControlPoint
(
const
DtUUID
& name);
60
61
//Returns true if we are in the vicinity of the given position. To be
62
//in the vicinity of the position means that we are within 5 seconds of
63
//the given location, given our ordered speed.
64
virtual
bool
inVicinity
(
const
DtVector
& localPosition);
65
66
protected
:
67
68
//default constructor
69
DtSimpleRadarWarningResponse
();
70
71
//copy constructor, not implemented
72
DtSimpleRadarWarningResponse
(
const
DtSimpleRadarWarningResponse
& orig);
73
74
//assignment operator, not implemented
75
DtSimpleRadarWarningResponse
&
operator=
(
const
DtSimpleRadarWarningResponse
& orig);
76
77
protected
:
78
79
//Port though which the list of hostile emitter systems will be received.
80
DtEntityListInputPort
*
myEmitterListPort
;
81
82
//true while in state of reacting to the detection of an emitter.
83
bool
myReactingToWarning
;
84
85
//Name of the safe location (a control point) we can retreat to.
86
DtUUID
mySafeControlPointName
;
87
88
DtVector
myLocalGoal
;
89
};
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)