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

Table of Contents

The Back-End Remote Control 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 create/manipulate VR-Forces scenarios through a simple text interface.

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. Do not load an existing or create new scenario
  3. Open the Ground_DB II.mtf terrain in the GUI
  4. Open a separate command line window and switch to the VR-Forces "/bin64/" directory
  5. Start the remoteControl application as "remoteControlDIS.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 remoteControlDIS.exe - can be copied from the backend command line arguments from the Launcher UI.

  6. In the remoteControl console window - type "help" to display the complete list of commands
  7. In the remoteControl console, create a new scenario by entering 'new "Ground_DB II.mtf"'
  8. Enter commands in the remoteControl console as desired, to create and task entities.

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

  9. 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 remoteControl 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) 2020 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>
using namespace makVrf;
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
//Create an exercise connection
DtExerciseConn* exConn = new DtExerciseConn(appInitializer);
controller->init(exConn);
//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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)