VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Back-End Remote Control Aerodromes (remoteControlAerodromes)

Table of Contents

The Back-End Remote Control Aerodromes example demonstrates the following:

How to Run the Example

This example demonstrates how to use the remote control API for controlling a VR-Forces back-end. It is a standalone console application that enables users to manipulate VR-Forces aerodromes scenarios through a simple text interface.

Before using the remoteControlAerodromes application, you need to have a scenario loaded on VR-Forces that already has aerodromes/runways objects created. You can use your own one, or the one provided with that example.

This example now includes simple usage of the DtRemoteEnvironmentController.

Usage

To run the application:

  1. Start VR-Forces GUI and SIM through the "vrfLauncher.exe" - e.g. select the DIS (7) localhost protocol.
  2. Load the scenario developer_toolkit_examples/remoteControlAerodromes/aerodromesScenario.scn
  3. Open a separate command line window and switch to the VR-Forces "/bin64/" directory
  4. Start the remoteControlAerodromes application as "remoteControlAerodromesDIS.exe with the vrfSimDIS command line arguments.

    Note: You need to supply the same set of command line arguments as the ones required to run the vrfSimDIS.exe. The necessary command line arguments for the remoteControlAerodromesDIS.exe - can be copied from the backend command line arguments from the Launcher UI.

  5. In the remoteControlAerodromes console window - type "help" to display the complete list of commands
  6. Enter commands in the remoteControlAerodromes console as desired, to modify or retreive aerodromes/runway objects dats.

    Note that location and point parameters should be entered using the geocentric coordinate system.

  7. The results of the commands will be observable in the VR-Forces GUI. The GUI only being used as a passive display in this example. The remoteControlAerodromes application is the one actually controlling VR-Forces back-end.

Classes

DtRemoteControlInitializerThis subclass of DtVrlApplicationInitializer adds command line options for the HLA version of the example.
DtTextInterfaceThis class allows the user to type in commands that will be parsed and used to supply information to the remote controller.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2021 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#include "textIf.h"
#include "remoteControlInit.h"
//VR-Forces headers
//VR-Link headers
#include <vl/exerciseConn.h>
#include <vlutil/vlProcessControl.h>
int main(int argc, char** argv)
{
//Create initializer object used to provide initialization data to the
//exercise connection, configured through command line arugments.
DtRemoteControlInitializer appInitializer(argc, argv);
appInitializer.parseCmdLine();
//Create the controller. This class used to be a DtVrfRemoteContrller, however, now changed
//to use the specific vrlink version of the remote controller to allow easier creation of
//a DtVrlinkNetworkNetworkInterface class to add to the communication manager
//Create an exercise connection
DtExerciseConn* exConn = new DtExerciseConn(appInitializer);
// If disableRemoteDiscovery is true, then the DtRemoteObjectManager will not be created. There is no need to create this manager (as in
// a remote control example) if the specific DtStateData and DtStateComponents do not want to be discovered. The last parameter disables remote
// discovery
controller->init(exConn, nullptr, nullptr, nullptr, "entity-identifier", true);
controller->vrfMessageInterface()->setSessionId(appInitializer.sessionId());
//Create our text interface so we can enter text commands.
DtTextInterface* textIf = new DtTextInterface(controller);
//Processing: read stdin and call drainInput.
//Calling drainInput() ensures that the controller receives
//necessary feedback from VR-Forces backend applications.
while (!textIf->timeToQuit())
{
textIf->readStdin();
exConn->clock()->setSimTime(exConn->clock()->elapsedRealTime());
controller->tick();
DtSleep(0.1);
}
delete textIf;
delete controller;
delete exConn;
return 0;
}

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)