# A 6 DOF Virtual Environment Space Docking Operation with Human Supervision
## 2 Real and Virtual Setup Description
In total, 13 VIs were generated to provide the necessary library for communication and the real-time operation of the real world platform and the virtual platform for mimicking a rendezvous. The LabVIEW platform provides the following features for the real-world 6 DOF platform:  
* Communication with the 6 DOF platform;
* Kinematic calculations of the 6 DOF platform;
* A pinhole camera model;
* Kinect data acquisition;
* Visual data processing;
* Calculations of the platform orientation;
* The combination of the 6 DOF platform communication and visual data. NXOpen is a tool which is mainly used for computer-aided engineering (CAE)-purposes, and it allows the user to operate several functions of NX from a centralized location. In this case, NXOpen is used to allow the control of orientation of the platform in all its degrees of freedom, to set the duration of the simulation and to perform a static and dynamic analysis of the motion of the platform. Apart from taking the user input to control its position, it also allows the direct control of the servo angles and it permits the user to import data from the motion of the real-world platform in order to adapt to its orientation. It also starts the LabVIEW application when the simulation method is chosen. The code behind this graphical user interface (GUI) was written in VB.NET and consists of roughly five parts, with the result given in Figure 5:  
* A part that is responsible for maintaining the GUI;
* An object class to do the necessary calculations;
* A method to export the values retrieved from the virtual sensors in the form of a.csv file;
* A component to configure the motion functions of the servomotors;
* A part that regulates the communication with LabVIEW through the use of registry keys. Figure 4: (**a**) The coordinate system of the Kinect v2 camera and the location of the sensors [15]; (**b**) time-of-flight (ToF) principle used in the Kinect sensor. The sent and received signal are compared to each other in order to determine the phase change and calculate the distance. As observed in Figure 5, the user interface is divided inti three tabs:  
* Export motion is used to configure the attitude and position of the virtual platform. The _ids_ values of servomotors are written in the text box besides the imaginary angles while filling in the values for the platform orientation--this makes it so that the values can still be adjusted before starting the solution. The simulation time defines the duration of the simulation;
* Import motion: In this mode, a sequence of motion of the real-world-platform is imported and transformed to angles of the servomotors using the inverse kinematics, and then every point is plotted to form a motion-function. This motion function is then used as the driving function for the servo drivers;
* Manual override is used to configure the angles of the individual servomotors. This function is primarily provided for testing purposes and has no influence on the real-world simulator. The overview of these three operating modes is illustrated in the flowchart in Figure 6, where the red path represents the manual override mode, the blue path represents the import motion mode and the green path represents the export motion mode. The purple dash arrows represent the registry keys (SimStart, PathReaday, LVMode, ImportPath) that are used to communicate with the LabVIEW application and ensure that the LabVIEW program does not skip steps the next time it executes. The overview of the working application (Figure 6) shows the main steps in the communication and data processing parts necessary to allow the real-time co-simulation of the real world and virtual world platform setups as part of the docking mechanism. Figure 5: The NXOpen interface with all three tabs visible—here, the user can specify supervisory setpoint values to position the platform before docking.