HoloLens-based augmented reality unmanned aerial vehicle interaction method and device

By combining HoloLens augmented reality technology with the Unity engine, the virtual and real environments of drone swarms are integrated and interacted, solving the interactivity problem of drone swarm flight simulation platforms and improving experimental efficiency and human-computer interaction comfort.

CN117093071BActive Publication Date: 2026-11-24UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310817294.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-04
Publication Date
2026-11-24
Estimated Expiration
2043-07-04

AI Technical Summary

Technical Problem

Existing drone swarm flight simulation platforms lack interactivity with the real environment, leading to the waste of drone and experimental equipment resources, and requiring repeated trial and error in the real environment to achieve the expected results.

Method used

Employing HoloLens-based augmented reality technology, the system combines HoloLens mixed reality glasses with the Unity engine to achieve seamless interaction between virtual drones and the real environment. It offers multimodal human-computer interaction methods, including gestures, voice, and gaze. Users can choose a simulated flight mode or set their own virtual trajectory and control the drone's flight via Socket communication.

Benefits of technology

It reduces the number of times physical drones need to be started during the trial and error process, reduces the waste of time and resources, improves experimental efficiency and human-computer interaction comfort, and enhances the accuracy and naturalness of the flight state simulation of virtual drone swarms in real environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117093071B_ABST
    Figure CN117093071B_ABST
Patent Text Reader

Abstract

This invention discloses an augmented reality drone interaction method and device based on HoloLens, comprising the following steps: S1: Obtaining the user's selection of the simulated flight mode; when flying according to an externally input trajectory, proceeding to step S2; when flying according to a user-defined virtual trajectory, proceeding to step S3; S2: Calling the externally input trajectory and interpolating it to control the virtual drone's flight; S3: Calling an autonomously drawn trajectory to control the virtual drone's flight, or calling an autonomously drawn trajectory and sending it to an external physical drone to control the physical drone's flight. This drone interaction method and device eliminates the need to actually start the physical drone during trial and error, significantly reducing time, waste of experimental equipment and other resources, and wear and tear on drone equipment. It enables users to adjust the drone swarm's movement without loss of performance according to their intentions, significantly improving experimental efficiency and human-computer interaction performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of drone flight simulation technology, and in particular to an augmented reality drone interaction method and device based on HoloLens. Background Technology

[0002] After years of development, mixed reality technology has made significant progress, and human-computer interaction is a crucial supporting technology for mixed reality. For many years, research in human-computer interaction has focused on exploring more natural and efficient interaction methods. However, the interaction between humans and multiple intelligent agents presents challenges due to the unpredictable movements of these agents. Taking the swarm flight of drones as an example, numerous early experiments easily resulted in resource depletion of drones and other experimental equipment due to unscientifically set trajectories and the inability to predict drone states during flight. Furthermore, existing simulation platforms lack interactivity with real experimental environments, necessitating repeated trial and error in real-world settings to achieve the desired results. Summary of the Invention

[0003] Based on the technical problems existing in the background technology, this invention proposes an augmented reality drone interaction method and device based on HoloLens, which eliminates the need to actually start the physical drone during the trial and error process, greatly reducing time and losses.

[0004] This invention proposes an augmented reality drone interaction method based on HoloLens, comprising the following steps:

[0005] S1: Obtain the user's selection of the simulated flight mode. When flying according to the externally input trajectory, proceed to step S2; when flying according to the virtual trajectory set by the user, proceed to step S3.

[0006] S2: Call the external input trajectory and interpolate it to control the flight of the virtual drone. The external input trajectory is the flight trajectory data of an external physical drone, including its position and speed.

[0007] S3: Call the autonomously drawn trajectory to control the flight of the virtual drone, or call the autonomously drawn trajectory and send it to an external physical drone to control the flight of the physical drone.

[0008] Further, in step S1, the user's selection of the simulated flight mode is obtained, specifically as follows:

[0009] S11: Deploy a Unity-based augmented reality drone interaction system in HoloLens mixed reality glasses. The augmented reality drone interaction system is deployed as an app in HoloLens glasses through Microsoft Visual Studio. Set "Swarm Flying" and "Free Flying" buttons on the interface of the augmented reality drone interaction system. The "Swarm Flying" button indicates flight according to an externally input trajectory, and the "Free Flying" button indicates flight according to a user-defined virtual trajectory.

[0010] S12: Construct a virtual drone model corresponding to the physical drone at a 1:1 scale, and import the virtual drone model into the Unity scene as a game object;

[0011] S13: Mount the "donghua.cs" file to the virtual drone. The "donghua.cs" file contains an "animation.Stop()" file to pause the animation and a "state.speed()" file to modify the rotor speed of the virtual drone.

[0012] S14: Check whether the flag is set at each set time. If it is, determine the button corresponding to the set flag to obtain the selection of the flight simulation mode. If not, continue to check the flag at the next set time. The flag is the click flag corresponding to the "Swarm Flying" button and the "Free Flying" button respectively.

[0013] Furthermore, step S2 specifically includes:

[0014] S21: Receive any external input trajectory from the trajectory library via a txt text document file or a Socket communication interface and store it in the augmented reality drone interaction system. The data format of the external input trajectory is a sequence [x,y,z,v] containing position and velocity information per line. x ,v y ,v z ], for each sequence [x,y,z,v x ,v y ,v z ] Corresponds to feature points on the virtual trajectory of the virtual drone;

[0015] S22: Mount the "WayPoints.cs" file on the virtual drone, convert the data type of the external input trajectory into numerical data, and store it in a two-dimensional array of the virtual trajectory. The number of rows in the two-dimensional array corresponds to the number of state points in flight, and each row corresponds to a sequence containing position and speed information in step S21.

[0016] S23: Obtain the number of rows in the two-dimensional array, get the number of virtual trajectory sampling points, initialize and connect the virtual trajectory sampling points to obtain the visualized virtual trajectory;

[0017] S24: The drone flies using a visualized virtual trajectory as its flight path. The actual distance between the virtual drone and the current sampling point of the virtual trajectory is calculated. If the actual distance is less than the set distance value, proceed to S25. If the actual distance is greater than or equal to the set distance value, proceed to S26.

[0018] S25: Determining whether the virtual drone reaches the current sampling point and proceeds to the next sampling point;

[0019] S26: The virtual drone has not reached the current sampling point. Continue to judge the current sampling point until the actual distance is less than the set distance value, and then proceed to step S25.

[0020] S27: During the movement, the total number of sampling points in step S24 is decremented by 1 each time the virtual drone reaches a sampling point. The movement ends when the variable is finally 0, and the virtual drone has successfully moved from the starting position to the ending position.

[0021] Furthermore, in step S23, interpolation calculations are performed on the virtual trajectory sampling points to optimize the virtual UAV flight trajectory. The interpolation calculation formula is as follows:

[0022]

[0023] Where (x0,y0) and (x1,y1) represent the coordinates of two adjacent sampling points, (x,y) represents the missing trajectory point between (x0,y0) and (x1,y1), and · represents the product.

[0024] Furthermore, in step S3: invoking the autonomous trajectory drawing to control the virtual drone's flight, the specific steps include:

[0025] S301: Set up two types of virtual drones: Expert_UAV for demonstrating expert trajectories and Study_UAV for learning from expert trajectories;

[0026] S302: Place the virtual drone Expert_UAV prefab in the Unity scene beforehand and draw its trajectory at fixed intervals;

[0027] S303: Sample the state points of the drawn trajectory at fixed intervals and store the sampled state points in the trajectory array of the virtual drone Study_UAV;

[0028] S304: Obtain the number of rows in the trajectory array, get the number of virtual trajectory sampling points, initialize and connect the virtual trajectory sampling points to obtain the visualized virtual trajectory, and realize the virtual drone successfully moving from the starting position to the ending position through steps S25 to S27.

[0029] Furthermore, when sampling state points on the drawn trajectory at fixed intervals, delayed sampling is used.

[0030] Furthermore, in step S3: calling the autonomously drawn trajectory and sending it to an external physical drone to control the flight of the physical drone, specifically includes:

[0031] S311: Set up a virtual drone Expert_UAV for expert trajectory demonstration. Place the virtual drone Expert_UAV prefab in the Unity scene in advance and draw its trajectory at fixed intervals.

[0032] S312: Sample the state points of the drawn trajectory at fixed intervals and store the state point samples in a two-dimensional array. Obtain the number of rows in the two-dimensional array to get the number of virtual trajectory sampling points. Initialize the virtual trajectory sampling points and connect them to obtain the visualized virtual trajectory.

[0033] S313: Sends a visualized virtual trajectory to an external physical drone to control the flight of the physical drone.

[0034] An augmented reality drone interaction device based on HoloLens, comprising a mode selection unit, a track-flying unit, an autonomous flight unit, and a physical flight unit;

[0035] The mode selection unit is used to obtain the user's selection of the simulated flight mode. When flying according to the externally input trajectory, it enters the track-flying unit; when flying according to the virtual trajectory set by the user, it enters the autonomous flight unit.

[0036] The track-flying unit is used to call up external input trajectories and interpolate them to control the flight of the virtual drone. The external input trajectory is the flight trajectory data of an external physical drone, including its position and speed.

[0037] The autonomous flight unit is used to invoke autonomously drawn trajectories to control the flight of the virtual drone;

[0038] The physical flight unit is used to call upon the autonomously drawn trajectory and send it to an external physical drone to control the flight of the physical drone.

[0039] The advantages of the HoloLens-based augmented reality drone interaction method and device provided by this invention are as follows: The HoloLens-based augmented reality drone interaction method and device provided in this invention allow users to perform human-computer interaction operations more naturally and efficiently. Furthermore, it has functions such as clearly simulating the flight state of a virtual drone swarm in a real environment after a user sets a trajectory, and transmitting the set virtual trajectory to the real drone. While achieving augmented reality effects, it also helps users adjust the drone swarm's movement according to their intentions without loss of quality, significantly improving experimental efficiency and human-computer interaction performance. In addition, there is no need to actually start the physical drones during the trial-and-error process, greatly reducing time, waste of experimental equipment and other resources, and wear and tear on drone equipment. Moreover, the HoloLens' gesture, gaze, and other multimodal human-computer interaction features truly free the user's hands, improving the comfort of the interaction operation. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the structure of the present invention;

[0041] Figure 2 for Figure 1 Detailed flowchart;

[0042] Figure 3 A schematic diagram of the UI (User Interface) of an augmented reality drone interaction system. Detailed Implementation

[0043] The technical solution of the present invention will now be described in detail through specific embodiments. Many specific details are set forth in the following description to provide a thorough understanding of the invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0044] First, let's explain some nouns and structures:

[0045] The holographic processing unit (HPU) in the Microsoft HoloLens 2 holographic glasses projects holographic images of virtual models onto holographic lenses, achieving a fusion of virtual models and the real world. Combined with SLAM algorithms and technologies such as spatial mapping and spatial anchoring, it overlays the real environment with virtual objects, providing users with a completely new visual and sensory experience that blends the virtual and real worlds. Interaction technologies such as gestures, voice, and gaze allow for various interactions with the virtual model. This technology breaks down the barriers between the real and digital worlds, merging them to create a new experimental environment, thus providing a mixed reality solution for simulating drone swarm movements. In the HoloLens mixed reality glasses, one can simultaneously see the real environment and virtual objects superimposed. Currently, most drone interaction systems are based on tablets or VR technology; methods or technologies using HoloLens and mixed reality to combine virtual and real drone swarms to achieve simulated swarm flight are not yet known.

[0046] The Unity engine is a real-time 3D interactive content creation and operation platform. It encompasses various fields such as game development, art, architecture, automotive design, and film. The Unity platform provides a complete software solution for creating any real-time interactive 2D or 3D content, fully supporting the development of our HoloLens augmented reality platform. Therefore, in this embodiment, Unity will be the primary development platform, specifically version 2020.3.41LTS Long Term Support. On this platform, all functional scripts were written using C#, enabling the creation and invocation of all virtual objects, including flight paths, user interfaces, and virtual drones. It also created all interfaces for external interaction, including TCP / IP protocols and gesture interactions.

[0047] MRTK (Mixed Reality Toolkit) is a mixed reality development toolkit provided by Microsoft, designed to accelerate the development of mixed reality applications. The Unity-based MRTK (MixedRealityToolkit-Unity) provides many APIs to accelerate the development of mixed reality projects, including the HoloLens holographic glasses. By correctly importing the MRTK toolkit into a Unity scene, developers can use its built-in development functions for holographic imaging, such as virtual hands for interacting with nearby objects, hand rays for interacting with distant objects, and dragging virtual objects. The Unity-based MRTK allows developers to perform simulation debugging within the Unity scene, such as testing whether hand dragging and eye gaze functions work correctly, whether voice input works properly, and whether user interface buttons are clickable. The Unity-based MRTK toolkit greatly simplifies the entire development process.

[0048] Microsoft Visual Studio (VS) is a suite of development tools from Microsoft Corporation. VS is a comprehensive development toolset, encompassing most tools needed throughout the software lifecycle, such as UML tools, code management tools, and an integrated development environment (IDE). During development, VS2022 (or VS2019) will be used as our deployment tool to deploy the Unity project to the HoloLens device. This step can be achieved in two ways: USB deployment and LAN deployment (ensuring the computer and HoloLens are connected to the same network). After successful pairing of the computer and HoloLens, deployment can be done via USB cable (USB deployment) or by entering the computer's IP address in the VS project properties (LAN deployment). Upon successful deployment, the augmented reality drone interaction system will exist as an app on the HoloLens.

[0049] A socket is a suite based on the Internet Protocol (IP), connecting the application layer and the transport layer. It's a communication channel established to facilitate communication. In practice, it represents a communication process between a client and a server. These two processes communicate through sockets, using a specified protocol. A socket is a wrapper around the TCP / IP protocol; it's not a protocol itself, but rather a calling interface (API). Only through sockets can we use the TCP / IP protocol. In this system, socket communication will be a crucial core component for communication between our virtual and real-world objects, responsible for all data sending and receiving.

[0050] In view of the existing technical problems, this embodiment discloses an augmented reality drone interaction method and device based on HoloLens.

[0051] like Figures 1 to 3 As shown, the present invention proposes an augmented reality drone interaction method based on HoloLens, which includes the following steps:

[0052] S1: Obtain the user's selection of the simulated flight mode. When flying according to the externally input trajectory, proceed to step S2; when flying according to the virtual trajectory set by the user, proceed to step S3.

[0053] S2: Call the external input trajectory and interpolate it to control the flight of the virtual drone. The external input trajectory is the flight trajectory data of an external physical drone, including its position and speed.

[0054] S3: Call the autonomously drawn trajectory to control the flight of the virtual drone, or call the autonomously drawn trajectory and send it to an external physical drone to control the flight of the physical drone.

[0055] This embodiment introduces mixed reality technology into augmented reality interaction of drone swarms. Compared with traditional interaction methods and simulation methods that rely on computer simulation platforms, this embodiment does not require the actual launch of physical drones during the trial and error process, which greatly reduces the waste of time, experimental equipment and other resources, and the wear and tear on drone equipment. In addition, the use of HoloLens' gesture, gaze and other multimodal human-computer interaction allows users to truly free their hands and improve the comfort of interactive operation.

[0056] By overlaying virtual objects, including drone swarms and user interfaces, onto the real physical environment, this approach combines the virtual and real worlds, offering greater efficiency and convenience than traditional methods and significantly improving realism and natural interactivity. Furthermore, the trajectory of a physical drone can be adjusted by manipulating the trajectory of the virtual drone, whereas traditional methods require complex operations on a computer platform. Therefore, the adjustment method described in this embodiment is more direct and convenient for users.

[0057] In this embodiment, step S1 is implemented through the flight mode selection module, step S2 through the external trajectory input receiving and flight module, step S3 through the user-defined virtual trajectory sending module, steps S1 to S3 are implemented through the virtual-real fusion communication module, and the autonomous trajectory drawing in step S3 is implemented through the multimodal triggered human-computer interaction module. The augmented reality drone interaction system is composed of the flight mode selection module, the external trajectory input receiving and flight module, the user-defined virtual trajectory sending module, the virtual-real fusion communication module, and the multimodal triggered human-computer interaction module. This system is deployed as an app in HoloLens glasses using Microsoft Visual Studio. The following provides a detailed description of each module:

[0058] 1. HoloLens Mixed Reality Glasses

[0059] This is a wireless, portable head-mounted holographic computer device used for camera pose estimation and tracking, spatial mapping of virtual information, real-time gesture capture, eye-tracking gaze, and voice command interaction. It overlays virtual objects onto the real environment to achieve augmented reality effects. The HoloLens mixed reality glasses are the core bridge for this virtual-real fusion. The software system developed in Unity will be deployed as an app within the HoloLens glasses via Microsoft Visual Studio. After the user activates this augmented reality drone interaction system while wearing the HoloLens head-mounted device, a draggable UI interface will appear in front of them, such as... Figure 3 As shown, users can interact with the UI interface through hand gestures, eye movements, and voice to complete all the specific functions developed in the augmented reality drone interaction system.

[0060] 2. Scaled Virtual Drone Model

[0061] A virtual model of the drone is created based on a 1:1 scale model of the physical drone and imported into the Unity scene as a game object. This augmented reality drone interaction system also utilizes Unity's AnimationSystem to control the rotation and stopping of the drone's rotors. First, an "Animation" component is added to the virtual drone. Then, a new C# script file, "donghua.cs," is created and attached to the virtual drone game object. In this script, "animation.Stop()" is used to pause the animation in the initial state settings, and the appropriate drone rotor rotation speed is manually set by modifying the value of "state.speed()". Two button click events are added to the script: "ButtonUVA_ONClick()" and "ButtonUVA_OFFClick()".

[0062] In Unity, click events work as follows: Taking the "ButtonUVA_ONClick()" event as an example, a button on the UI is linked to this click event function. The corresponding function, "public void OnClickExpertDraw()", contains the code intended to run after the button is clicked. Therefore, clicking the button on the UI will execute the corresponding program.

[0063] By writing the commands "animation.Play()" and "animation.Stop()" into their respective functions, the playback and pause of the animation—that is, the rotation and stopping of the virtual drone's rotor—can be controlled via buttons on the UI interface. These two click events on the UI interface correspond to the buttons "UAV_ON" and "UAV_OFF," respectively, meaning that the virtual drone's rotor can be directly controlled through these two buttons on the UI interface.

[0064] Proportional modeling minimizes the difference between virtual and real drones in mixed reality environments, allowing for the accurate replication of environmental influences and flight states in simulated flight experiments. The use of proportional virtual drone models significantly improves the simulation accuracy and naturalness of virtual-real integration in augmented reality drone interaction systems, while also providing users with a more immersive experience.

[0065] 3. Flight Mode Selection Module

[0066] This augmented reality drone interaction system currently offers two flight modes, selectable by tapping the "Swarm Flying" and "Free Flying" buttons on the UI. The "Swarm Flying" button indicates flight along an externally input trajectory, while the "Free Flying" button indicates flight along a user-defined virtual trajectory. A C# script file, "Robot_Move.cs," is attached to the drone swarm. Click events "OnClickRobotswarmFly()" and "OnClickRobotfreeFly()" are added to these two buttons within the script. A flag is set in the corresponding function to indicate whether the button has been clicked, for example: swarmFly = true / false. Since the program is placed within the script's update() function, the algorithm continuously checks the flag 60 times per second to indicate whether the button is pressed. The flag's state directly determines the flight mode selection.

[0067] It's important to understand that Unity's initial script mainly consists of two parts: the "void start()" function and the "void update()" function. The "void start()" function is only called and executed once at the very beginning of the program's runtime; its code is not executed repeatedly during the rest of the program. The "void update()" function, however, is called and executed repeatedly at a frequency of 60 times per second throughout the entire system's operation. You can also define any function other than these two, which will also be executed repeatedly.

[0068] Pressing the “Swarm Flying” button will set the system to the function corresponding to the external trajectory input receiving and flight module. Pressing the “Free Flying” button will set the system to the function corresponding to the user-defined virtual trajectory sending module.

[0069] 4. External trajectory input receiver and flight module

[0070] This mode allows a virtual drone swarm to simulate flight using an externally input, pre-defined trajectory. This requires a virtual-real fusion communication module, whose input format can be a text document of type txt or csv, or data received via a Socket communication interface. The virtual drone swarm will then simulate flight according to the externally input trajectory. Furthermore, this augmented reality drone interaction system allows users to select and store the types of externally input trajectories.

[0071] This module transmits flight trajectory data, including position and velocity, from an external swarm of drones to the interactive system. The system then processes this data further before using it on virtual drones. Taking the flight trajectory of a single drone as an example, the process is similar for others. The actual drone trajectory data is exported as a txt file, with each line containing a sequence of position and velocity information [x, y, z, v]. x ,v y ,v z [x, y, z, v], where each row represents a feature point on the virtual trajectory of the virtual drone. If received via a Socket communication interface, it can also receive a [x, y, z, v] value at regular intervals. x ,v y ,v z The sequence [x, y, z] represents the coordinate attributes of the UAV's flight trajectory, and [v... x ,v y ,v z As the velocity vector of the drone's flight trajectory, it corresponds to the velocity magnitudes in the X, Y, and Z axes, respectively.

[0072] The C# script "WayPoints.cs" is mounted on the virtual drone swarm. In the data processing algorithm, the "TextAsset" component in Unity is first used to obtain TXT text data. This component is mainly used for receiving external text data in Unity. After adding this component to a game object, an input box where a text document can be dragged into the game object's menu will appear. After dragging the TXT document in, Unity can receive the data from it, and then use a delimiter function:

[0073] The `Split(new char[2]{',','\n'},StringSplitOptions.RemoveEmptyEntries)` function removes commas and newlines from data in a txt text document or a Socket communication interface, generating a long string. Then, the C# data type conversion function `float.Parse()` and a for loop are used to convert this long string into numerical data, which is stored in the corresponding two-dimensional array of virtual drone trajectories. Each virtual drone corresponds to a trajectory array of this type. The number of rows in the two-dimensional array corresponds to the number of state points during flight, and each row corresponds to one of the aforementioned flight state sequences. In addition to the aforementioned position and speed data, this array also contains pre-defined quaternions used to control the virtual drone's attitude. Therefore, each [x,y,z,v] received from the outside world... x ,v y ,v zEach sequence corresponds one-to-one with a feature point on the virtual trajectory. Through the data transformation using the above algorithm, real-world data was successfully processed into data that can be used by the virtual drone.

[0074] Furthermore, in practical applications, the sampling frequency of trajectory points from physical drones may be too high. Overly dense trajectory points are detrimental to the simulated flight of virtual drones. Therefore, before storing the data in the array, the system can perform further processing on the data in the txt text document, such as reducing the sampling frequency (e.g., obtaining one feature point every 10 txt text data points). Experiments have shown that sampling one trajectory point every 0.1 seconds is the optimal frequency in the system.

[0075] Once the external trajectory data processing is complete, the algorithm for the virtual drone swarm to fly according to the aforementioned trajectory data can be implemented. The same principle applies to other drones, using a single drone as an example.

[0076] Mount the C# script "Robot_Move.cs" onto the virtual drone swarm. The trajectory array is already defined. First, use the built-in C# function "GetLength(0)" to get the number of rows in the array, i.e., the number of trajectory sampling points, and store it in a variable. Each state point corresponds to a game object in virtual space (we set a small ball "Point" to represent a point). Create an empty game object and mount these "Points". Using the position, velocity, and pose information of each point, use the "GameObject.Instantiate()" function to repeatedly copy "Points" until the number of small balls equals the number of sampling points. The function parentheses contain the new "Point", its position vector, and its pose vector.

[0077] Then, using "Pathline_robot1_1.SetPosition" to initialize the connections based on the trajectory points, connecting each trajectory point with a smooth curve will create a visual virtual trajectory, indicating that the virtual trajectory has been successfully created. "Pathline_robot1_1" is the game object we created corresponding to the trajectory curve.

[0078] Then, the motion determination process for the virtual drone can begin. In the Unity engine, the motion of game objects can be implemented by adding a vector to the "transform.Translate()" function. This position transition vector is dynamically constructed using the differences between points to achieve the motion of the virtual drone. During motion, an "if()" condition is added, using the "Distance(a.position, b.position)" function to calculate the distance between points a and b. When the distance between the virtual drone and a certain state point is less than the set value, it indicates that the drone has reached that state point, and the process proceeds to the next state point. During the motion, the total number of trajectory points is decremented by 1 each time the virtual drone reaches a trajectory point, until the variable finally reaches 0, at which point the motion stops, marking the end of the motion and the virtual drone successfully moving from the starting position to the ending position.

[0079] Furthermore, our algorithm incorporates interpolation algorithms to optimize flight trajectory and flight attitude.

[0080] Since the flight trajectory is discretely composed of many sampling points, to ensure the continuity of the flight trajectory and the consistency of the UAV's flight, we perform interpolation calculations between each sampling point to optimize the flight trajectory. Assuming the coordinates of two points are (x0, y0) and (x1, y1), we use the following formula to complete the missing trajectory segment between the two points:

[0081]

[0082] Here, (x0,y0) and (x1,y1) represent the coordinates of two adjacent sampling points, and (x,y) represents the missing trajectory point between (x0,y0) and (x1,y1). By processing the sampling points with an interpolation algorithm, the continuity of the UAV's flight trajectory is ensured.

[0083] Since each sampling point also contains the drone's velocity and position / attitude information, if only position is interpolated during drone flight, the drone's velocity and attitude will still change discretely. Therefore, a single linear interpolation process is applied to the drone's velocity and attitude. The order of the sampling points is used as the independent variable, and velocity and attitude information are used as dependent variables, for example: (t, Robot_speed) and (t, Robot_rotation). According to the above formula, the required rotation angle and angular velocity of the drone are calculated based on the attitude change between two given trajectory points, ensuring a smooth change in the drone's attitude between the two points. Linear interpolation between the velocity differences between two sampling points prevents the drone from suddenly accelerating or decelerating. This interpolation algorithm for the sampling points not only optimizes the flight trajectory but also ensures the stability of the drone's flight.

[0084] The above can be briefly summarized as follows. In step S2, the specific components include:

[0085] S21: Receive any external input trajectory from the trajectory library via a txt text document file or a Socket communication interface and store it in the augmented reality drone interaction system. The data format of the external input trajectory is a sequence [x,y,z,v] containing position and velocity information per line. x ,v y ,v z ], for each sequence [x,y,z,v x ,v y ,v z ] Corresponds to feature points on the virtual trajectory of the virtual drone;

[0086] S22: Mount the "WayPoints.cs" file on the virtual drone, convert the data type of the external input trajectory into numerical data, and store it in a two-dimensional array of the virtual trajectory. The number of rows in the two-dimensional array corresponds to the number of state points in flight, and each row corresponds to a sequence containing position and speed information in step S21.

[0087] S23: Obtain the number of rows in the two-dimensional array, get the number of virtual trajectory sampling points, initialize and connect the virtual trajectory sampling points to obtain the visualized virtual trajectory;

[0088] S24: The drone flies using a visualized virtual trajectory as its flight path. The actual distance between the virtual drone and the current sampling point of the virtual trajectory is calculated. If the actual distance is less than the set distance value, proceed to S25. If the actual distance is greater than or equal to the set distance value, proceed to S26.

[0089] S25: Determining whether the virtual drone reaches the current sampling point and proceeds to the next sampling point;

[0090] S26: The virtual drone has not reached the current sampling point. Continue to judge the current sampling point until the actual distance is less than the set distance value, and then proceed to step S25.

[0091] S27: During the movement, the total number of sampling points in step S24 is decremented by 1 each time the virtual drone reaches a sampling point. The movement ends when the variable is finally 0, and the virtual drone has successfully moved from the starting position to the ending position.

[0092] 5. User-defined virtual trajectory and transmission module

[0093] This mode allows users to manually set a trajectory using a virtual drone. This trajectory can be either directly followed by the virtual drone "Study_UAV" or transmitted to a physical drone using a virtual-real fusion communication module as its flight path.

[0094] This functional module includes two types of virtual drones: "Expert_UAV" for demonstrating expert trajectories and "Study_UAV" for learning from expert trajectories. The "Expert_UAV" drone prefab is placed in the scene, and a "Box Collider" component is added to it. If the user clicks the "DRAW" button on the UI in the environment, they can drag and drop the pre-placed "Expert_UAV" virtual drone (whose texture is gray and semi-transparent) to create a trajectory.

[0095] This system uses a fixed-time trajectory drawing method. The "StartCoroutine()" function is written into the click event function corresponding to the "DRAW" button, indicating that clicking the button starts the timer, and the expert trajectory must be drawn within the time specified by the system. Of course, this time limit can be changed as needed in our script program.

[0096] State point sampling is performed on the virtual trajectory described above. For game objects in Unity, the position of the game object in the scene can be directly obtained by using "gameobject.transform.position.x / y / z". The trajectory points are sampled at fixed time intervals using Unity's "IEnumerator()" function and the coroutine delay function "yield return new WaitForSecondsRealtime()".

[0097] Passing the parameter 0.2 to the WaitForSecondsRealtime() function above means that the program will wait for 0.2 seconds when this statement is executed. Adding this statement to a loop will make the program execute once every fixed time interval of 0.2 seconds. It is then used to sample the trajectory points of a virtual drone and store the sampled points in the trajectory array of the "Study_UAV" drone (whose texture is that of a normal drone).

[0098] Then, the same trajectory drawing and motion programs as the previous module are used in "Study_UAV" to simulate the flight of the virtual drone. Simultaneously, this data can be transmitted to the real environment via the virtual-real fusion communication module as the flight trajectory of a physical drone.

[0099] Additionally, in step S3: invoking the autonomously drawn trajectory to control the virtual drone's flight, the specific steps include:

[0100] S301: Set up two types of virtual drones: Expert_UAV for demonstrating expert trajectories and Study_UAV for learning from expert trajectories;

[0101] S302: Place the virtual drone Expert_UAV prefab in the Unity scene beforehand and draw its trajectory at fixed intervals;

[0102] S303: Sample the state points of the drawn trajectory at fixed intervals and store the sampled state points in the trajectory array of the virtual drone Study_UAV; when sampling the state points of the drawn trajectory at fixed intervals, delayed sampling is used.

[0103] S304: Obtain the number of rows in the trajectory array, get the number of virtual trajectory sampling points, initialize and connect the virtual trajectory sampling points to obtain the visualized virtual trajectory, and realize the virtual drone successfully moving from the starting position to the ending position through steps S25 to S27.

[0104] Step S3: The autonomously drawn trajectory is invoked and sent to an external physical drone to control its flight. This specifically includes:

[0105] S311: Set up a virtual drone Expert_UAV for expert trajectory demonstration. Place the virtual drone Expert_UAV prefab in the Unity scene in advance and draw its trajectory at fixed intervals.

[0106] S312: Sample the state points of the drawn trajectory at fixed intervals and store the state point samples in a two-dimensional array. Obtain the number of rows in the two-dimensional array to get the number of virtual trajectory sampling points. Initialize the connection of the virtual trajectory sampling points to obtain the visualized virtual trajectory. When sampling the state points of the drawn trajectory at fixed intervals, delayed sampling is used.

[0107] S313: Sends a visualized virtual trajectory to an external physical drone to control the flight of the physical drone.

[0108] 6. Virtual-Real Fusion Communication Module

[0109] Using Socket communication, the HoloLens device acts as the client, and the device controlling the drone's flight path acts as the server. Once their IP addresses and port numbers are configured and the connection is established, bidirectional data transmission is possible. The specific process is as follows: The server program binds a socket to a specified address and port, and uses this socket to wait for and listen for client connection requests. The client program sends a connection request to the server program at the address and port bound to the server. The server accepts the connection request and obtains a new socket. The server communicates with the client by reading and writing to the new socket.

[0110] First, create a client in Unity using `new Socket()`. Then, cast the server's numeric IP address to a standard IP address using `IPAddress.Parse()` and obtain the port number. This establishes the client. Next, start two new threads using `new Thread()`. These threads continuously send and receive messages from the server using a buffer. The statements used for message transmission are `XX.Receive(buffer)` and `XX.Send(buffer)`. Deploy the server and the entire system to HoloLens. A similar approach should be used to deploy the server on the device controlling the physical drone.

[0111] In this process, the server first needs to start and prepare a communication channel, indicating that it can accept client connections at a certain address and port, and wait for client connection requests. After a successful connection, it waits for and receives data sent by the client, processes the client's data, and returns the processing result to the client after processing. This process of receiving data is repeated continuously until the client disconnects, at which point the server can be closed. Similarly, the client needs to open a communication channel and connect to the port prepared by the server. It sends data to the server, waits for and receives the server's processing result. This process of sending data is repeated continuously until all data has been processed, at which point the connection with the server can be closed.

[0112] 7. Multimodal Triggered Human-Computer Interaction Module

[0113] This allows for interaction with the UI and the "Expert_UAV" virtual drone through eye gaze, gestures, hand raycasting, and voice input. These interaction methods are all built into HoloLens 2, and can be configured in Unity using the MRTK plugin. By adding eye, hand, and voice interaction functionality to a Unity scene and then deploying it to HoloLens 2, you can utilize these built-in interaction methods.

[0114] The gaze interaction uses the `physics.Raycast` method to detect whether a ray emitted from the user's HoloLens glasses collides with an object in the scene, thus triggering a gaze event. Gesture interaction uses the HoloLens' 3D depth camera to collect gesture information. Button click events are added to all buttons on the UI and connected to corresponding functions in each script. If the UI is within reach, users can directly interact by clicking the interface with their fingers. If the UI is far away and finger operation is inconvenient, a white ray emitted from the hand can be used to select function buttons on the UI. This can be achieved by clicking with a specified gesture or speaking a corresponding keyword, or by gazing at a function button. When operating the "Expert_UAV" virtual drone, a wide field of view is crucial for global trajectory drawing; therefore, hand raycasting and eye-gazing, which are suitable for long-distance interaction, provide significant convenience during operation.

[0115] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An augmented reality drone interaction method based on HoloLens, comprising the following steps: S1: Obtain the user's selection of the simulated flight mode. When flying according to the externally input trajectory, proceed to step S2; when flying according to the virtual trajectory set by the user, proceed to step S3. S2: Call the external input trajectory and interpolate it to control the flight of the virtual drone. The external input trajectory is the flight trajectory data of an external physical drone, including its position and speed. S3: Call the automatically drawn trajectory to control the flight of the virtual drone; In step S1, the user's selection of the simulated flight mode is obtained, specifically as follows: S11: Deploy a Unity-based augmented reality drone interaction system in HoloLens mixed reality glasses. The augmented reality drone interaction system is deployed as an app in HoloLens glasses through Microsoft Visual Studio. Set "Swarm Flying" and "Free Flying" buttons on the interface of the augmented reality drone interaction system. The "Swarm Flying" button indicates flight according to an externally input trajectory, and the "Free Flying" button indicates flight according to a user-defined virtual trajectory. S12: Construct a virtual drone model corresponding to the physical drone at a 1:1 scale, and import the virtual drone model into the Unity scene as a game object; S13: Mount the "donghua.cs" file to the virtual drone. The "donghua.cs" file contains an "animation.Stop()" file to pause the animation and a "state.speed()" file to modify the rotor speed of the virtual drone. S14: Check whether the flag is set at a set time. If it is, determine the button corresponding to the set flag to obtain the selection of the simulated flight mode. If not, continue to check the flag at the next set time. The flag is the click flag corresponding to the "SwarmFlying" button and the "Free Flying" button respectively. Step S3 specifically includes: S301: Set up two types of virtual drones: Expert_UAV for demonstrating expert trajectories and Study_UAV for learning from expert trajectories; S302: Place the virtual drone Expert_UAV prefab in the Unity scene beforehand and draw its trajectory at fixed intervals; S303: Sample the state points of the drawn trajectory at fixed intervals and store the sampled state points in the trajectory array of the virtual drone Study_UAV; S304: Obtain the number of rows in the trajectory array, get the number of virtual trajectory sampling points, initialize and connect the virtual trajectory sampling points to obtain a visualized virtual trajectory, and realize the virtual drone successfully moving from the starting position to the ending position through step S2.

2. The HoloLens-based augmented reality drone interaction method according to claim 1, characterized in that, Step S2 specifically includes: S21: Receive any external input trajectory from the trajectory library via a txt text file or a Socket communication interface and store it in the augmented reality drone interaction system. The data format of the external input trajectory is a sequence [x, y, z, v] containing position and velocity information per line. x ,v y ,v z ], for each sequence [x, y, z, v x ,v y ,v z ] Corresponds to feature points on the virtual trajectory of the virtual drone; S22: Mount the "WayPoints.cs" file on the virtual drone, convert the data type of the external input trajectory into numerical data, and store it in a two-dimensional array of the virtual trajectory. The number of rows in the two-dimensional array corresponds to the number of state points in flight, and each row corresponds to a sequence containing position and speed information in step S21. S23: Obtain the number of rows in the two-dimensional array, get the number of virtual trajectory sampling points, initialize and connect the virtual trajectory sampling points to obtain the visualized virtual trajectory; S24: The drone flies using a visualized virtual trajectory as its flight path. The actual distance between the virtual drone and the current sampling point of the virtual trajectory is calculated. If the actual distance is less than the set distance value, proceed to S25. If the actual distance is greater than or equal to the set distance value, proceed to S26. S25: Determining whether the virtual drone reaches the current sampling point and proceeds to the next sampling point; S26: The virtual drone has not reached the current sampling point. Continue to judge the current sampling point until the actual distance is less than the set distance value, and then proceed to step S25. S27: During the movement, the total number of sampling points in step S24 is decremented by 1 each time the virtual drone reaches a sampling point. The movement ends when the variable is finally 0, and the virtual drone has successfully moved from the starting position to the ending position.

3. The HoloLens-based augmented reality drone interaction method according to claim 2, characterized in that, In step S23, interpolation calculations are performed on the virtual trajectory sampling points to optimize the virtual UAV flight trajectory. The interpolation calculation formula is as follows: in, and These represent the coordinates of two adjacent sampling points. express and The missing trajectory points between them.

4. The HoloLens-based augmented reality drone interaction method according to claim 1, characterized in that, When sampling state points of the drawn trajectory at fixed intervals, delayed sampling is used.

5. An augmented reality drone interaction method based on HoloLens, comprising the following steps: S1: Obtain the user's selection of the simulated flight mode. When flying according to the externally input trajectory, proceed to step S2; when flying according to the virtual trajectory set by the user, proceed to step S3. S2: Call the external input trajectory and interpolate it to control the flight of the virtual drone. The external input trajectory is the flight trajectory data of an external physical drone, including its position and speed. S3: Call the autonomously drawn trajectory and send it to an external physical drone to control the flight of the physical drone; In step S1, the user's selection of the simulated flight mode is obtained, specifically as follows: S11: Deploy a Unity-based augmented reality drone interaction system in HoloLens mixed reality glasses. The augmented reality drone interaction system is deployed as an app in HoloLens glasses through Microsoft Visual Studio. Set "Swarm Flying" and "Free Flying" buttons on the interface of the augmented reality drone interaction system. The "Swarm Flying" button indicates flight according to an externally input trajectory, and the "Free Flying" button indicates flight according to a user-defined virtual trajectory. S12: Construct a virtual drone model corresponding to the physical drone at a 1:1 scale, and import the virtual drone model into the Unity scene as a game object; S13: Mount the "donghua.cs" file to the virtual drone. The "donghua.cs" file contains an "animation.Stop()" file to pause the animation and a "state.speed()" file to modify the rotor speed of the virtual drone. S14: Check whether the flag is set at a set time. If it is, determine the button corresponding to the set flag to obtain the selection of the simulated flight mode. If not, continue to check the flag at the next set time. The flag is the click flag corresponding to the "SwarmFlying" button and the "Free Flying" button respectively. Step S3 specifically includes: S311: Set up a virtual drone Expert_UAV for expert trajectory demonstration. Place the virtual drone Expert_UAV prefab in the Unity scene in advance and draw its trajectory at fixed intervals. S312: Sample the state points of the drawn trajectory at fixed intervals and store the state point samples in a two-dimensional array. Obtain the number of rows in the two-dimensional array to get the number of virtual trajectory sampling points. Initialize the virtual trajectory sampling points and connect them to obtain the visualized virtual trajectory. S313: Sends a visualized virtual trajectory to an external physical drone to control the flight of the physical drone.

6. An augmented reality drone interaction device based on HoloLens, characterized in that, It includes a mode selection unit, a track-flying unit, and an autonomous flight unit; The mode selection unit is used to obtain the user's selection of the simulated flight mode. When flying according to the externally input trajectory, it enters the track-flying unit; when flying according to the virtual trajectory set by the user, it enters the autonomous flight unit. The track-flying unit is used to call up external input trajectories and interpolate them to control the flight of the virtual drone. The external input trajectory is the flight trajectory data of an external physical drone, including its position and speed. The autonomous flight unit is used to invoke autonomously drawn trajectories to control the flight of the virtual drone; Specifically, the mode selection unit obtains the user's selection of the simulated flight mode as follows: S11: Deploy a Unity-based augmented reality drone interaction system in HoloLens mixed reality glasses. The augmented reality drone interaction system is deployed as an app in HoloLens glasses through Microsoft Visual Studio. Set "Swarm Flying" and "Free Flying" buttons on the interface of the augmented reality drone interaction system. The "Swarm Flying" button indicates flight according to an externally input trajectory, and the "Free Flying" button indicates flight according to a user-defined virtual trajectory. S12: Construct a virtual drone model corresponding to the physical drone at a 1:1 scale, and import the virtual drone model into the Unity scene as a game object; S13: Mount the "donghua.cs" file to the virtual drone. The "donghua.cs" file contains an "animation.Stop()" file to pause the animation and a "state.speed()" file to modify the rotor speed of the virtual drone. S14: Check whether the flag is set at a set time. If it is, determine the button corresponding to the set flag to obtain the selection of the simulated flight mode. If not, continue to check the flag at the next set time. The flag is the click flag corresponding to the "SwarmFlying" button and the "Free Flying" button respectively. In addition, the autonomous flight unit is specifically used for: S301: Set up two types of virtual drones: Expert_UAV for demonstrating expert trajectories and Study_UAV for learning from expert trajectories; S302: Place the virtual drone Expert_UAV prefab in the Unity scene beforehand and draw its trajectory at fixed intervals; S303: Sample the state points of the drawn trajectory at fixed intervals and store the sampled state points in the trajectory array of the virtual drone Study_UAV; S304: Obtain the number of rows in the trajectory array, get the number of virtual trajectory sampling points, initialize and connect the virtual trajectory sampling points to obtain a visualized virtual trajectory, and realize the virtual drone successfully moving from the starting position to the ending position through step S2.

7. An augmented reality drone interaction device based on HoloLens, characterized in that, It includes a mode selection unit, a track-flying unit, and a physical flight unit; The mode selection unit is used to obtain the user's selection of the simulated flight mode. When flying according to the externally input trajectory, it enters the track-flying unit; when flying according to the virtual trajectory set by the user, it enters the physical flight unit. The track-flying unit is used to call up external input trajectories and interpolate them to control the flight of the virtual drone. The external input trajectory is the flight trajectory data of an external physical drone, including its position and speed. The physical flight unit is used to call upon the autonomously drawn trajectory and send it to an external physical drone to control the flight of the physical drone; Specifically, the mode selection unit obtains the user's selection of the simulated flight mode as follows: S11: Deploy a Unity-based augmented reality drone interaction system in HoloLens mixed reality glasses. The augmented reality drone interaction system is deployed as an app in HoloLens glasses through Microsoft Visual Studio. Set "Swarm Flying" and "Free Flying" buttons on the interface of the augmented reality drone interaction system. The "Swarm Flying" button indicates flight according to an externally input trajectory, and the "Free Flying" button indicates flight according to a user-defined virtual trajectory. S12: Construct a virtual drone model corresponding to the physical drone at a 1:1 scale, and import the virtual drone model into the Unity scene as a game object; S13: Mount the "donghua.cs" file to the virtual drone. The "donghua.cs" file contains an "animation.Stop()" file to pause the animation and a "state.speed()" file to modify the rotor speed of the virtual drone. S14: Check whether the flag is set at a set time. If it is, determine the button corresponding to the set flag to obtain the selection of the simulated flight mode. If not, continue to check the flag at the next set time. The flag is the click flag corresponding to the "SwarmFlying" button and the "Free Flying" button respectively. In addition, the physical flight unit is specifically used for: S311: Set up a virtual drone Expert_UAV for expert trajectory demonstration. Place the virtual drone Expert_UAV prefab in the Unity scene in advance and draw its trajectory at fixed intervals. S312: Sample the state points of the drawn trajectory at fixed intervals and store the state point samples in a two-dimensional array. Obtain the number of rows in the two-dimensional array to get the number of virtual trajectory sampling points. Initialize the virtual trajectory sampling points and connect them to obtain the visualized virtual trajectory. S313: Sends a visualized virtual trajectory to an external physical drone to control the flight of the physical drone.

Citation Information

Patent Citations

  • Group control interaction method oriented to unmanned aerial vehicles

    CN108303994A

  • KR1024426370000B1