Skip to content

1) Interface Control Document

Francis Maheux edited this page May 10, 2019 · 1 revision

image1

The Motion Cueing Interface plugin is a c++ code sample to help motion system manufacturers with the creation of a plugin that will interface with motion platforms.

In the realm of motion systems, Unreal is the Host, providing data to the Controller, a motion platform. The controller needs to get data at high frequency for quality purposes (100-1000Hz). Unfortunately, the usual Unreal project will run at a lower frequency, usually between 30-60 Hz.

The idea is to collect the necessary data from a virtual moving object in Unreal at low frequency. Then we interpolate between “Previous Data Set” and “Current Data Set” and send it at high frequency to the controller. This solution adds a lag equal to the low frequency interval (33ms/16ms ---> 30/60 Hz). If lag becomes an issue, we can instead interpolate between “Current Data Set” and a “Prediction Data Set”, which is not implemented for now.

Right now, the c++ code is packaged in a plugin called Motion Cueing Interface. It’s structure is meant to support external APIs along with Unreal’s layer. It is composed of 2 modules:

  • MotionCueingInterface: The plugin itself containing:
    • MotionProbe: An actor component that appears under the MotionCueing category
    • MotionData: A generic data structure that store kinematic movements and rotations
    • MotionHost: A class that interface with the manufacturer API
  • TheApi: A module where the manufacturer put its source code and library (.lib/.dll)

Motion Probe

The Motion Probe is an actor component that can be added to a Blueprint, a logical graph, in the Unreal Editor. This is where the end user interface with the controller.

Exposed Parameters

image12

  • Vehicle Type: The controller needs to know which vehicle type it is simulating
  • Interpolation Type: How we interpolate our motion data before sending it to the controller
  • Vibration Input: A user defined input to calculate vibration intensity
  • Output Frequency: Frequency in which we send data to the controller (Hz)
  • Controller IP: IP address to connect to the controller
  • Controller Port: Port number to send data
  • Host Port (receive): Port number to receive data
  • Use Debug Mode: Print out useful info on screen

Motion Data

This is a generic data structure that contains: Kinematic displacement, velocity and acceleration per axis Rotational displacement, velocity and acceleration Vehicle direction, velocity and acceleration Motion State command Counter

This data is in “Vehicle Space” at the root position of the object, where:

  • X axis is the forward direction
  • Y axis is the side vector (left hand)
  • Z axis is the up vector

Motion Host

This is a generic c++ base class that can be derived from to interface between Unreal and your API. You will want to derive from this class and implement:

// Init API
virtual void Initialize()

// Clean up
virtual void Cleanup()

// Remap data from Unreal to your API
virtual void MapData(FMotionData& Data)

// Connect to the controller
virtual void ConnectToController(FString ControllerIP, int ControllerPort, int HostRcvPort)

// Send data to the controller
virtual void SendDataToController(FMotionData& Data)

// Receive data from the controller 
virtual void ReceiveDataFromController()

// Sequence of command to control state machine
virtual void SetStateFlow()

Future Work

  • Implement other interpolation types (ease in, ease out)
  • Implement other types of vehicle reference frame “Handiness”
  • Implement custom recipe to output vibration data [0,1] based on a user input