Disclosure of Invention
The application provides a control method, a head-mounted display device, an electronic device and a storage medium, which can obtain the relative position information of a target object in a space where a user is located, and the head-mounted display device determines the current position of the user wearing the head-mounted display device according to the relative position information, so that the user can be accurately positioned.
In order to achieve the above purpose, the present application provides the following technical solutions:
a method of controlling a head mounted display device, the method comprising:
the laser radar sensor rotates in the first plane and transmits laser signals;
the laser radar sensor receives a reflected signal of a target object to the laser signal;
the laser radar sensor obtains relative position information of the target object in the first plane according to the laser signal and the reflection signal;
the laser radar sensor transmits the relative position information to head-mounted display equipment;
and the head-mounted display equipment determines the current position of the wearing user according to the relative position information.
Preferably, the determining, by the head-mounted display device according to the relative position information, the current position of the wearing user includes:
the head-mounted display equipment generates a first plane 2D map according to the relative position information;
generating a three-dimensional model of a space where a user is located according to the 2D map; and the 2D map takes the laser radar sensor as a coordinate origin.
Preferably, the control method further includes:
and the head-mounted display equipment adjusts the content to be displayed according to the three-dimensional model so as to display the adjusted content on a display screen of the head-mounted display equipment.
Preferably, adjusting the content to be displayed according to the three-dimensional model includes:
adjusting the original data of the head-mounted display device to current data according to the three-dimensional model;
rendering the current data to construct a scene that matches the space where the user is actually located.
Preferably, the relative position information is relative position information between the target object and the laser radar sensor; the control method further comprises the following steps:
judging whether the relative position information is not greater than a first preset value;
if yes, sending out an obstacle prompt.
Preferably, the control method further includes:
acquiring a vertical distance value and an included angle value of the two planes relative to the first plane;
constructing the 2D map according to the vertical distance value and the included angle value and by combining the current relative position information of the target object;
and the second plane is a plane where the laser radar sensor rotates up and down or moves up and down relative to the first plane.
Preferably, the 2D map with the center of the display screen of the head-mounted display device as a reference point is constructed according to the distance value a and by combining the current relative position information of the target object;
and the distance value a is the vertical distance between the center of the display screen of the head-mounted display device and the laser radar sensor.
Preferably, the laser radar sensor rotating and transmitting the laser signal within the first plane comprises:
the laser radar sensor transmits laser signals at preset time intervals; or, the laser radar sensor emits a laser signal every time it rotates by a predetermined angle α.
In addition, the application also provides the following technical scheme:
a head-mounted display device, comprising: an IMU sensor, at least one set of lidar sensors mounted on a head-mounted display device, wherein,
the laser radar sensor is connected with a processor of the head-mounted display device;
the laser radar sensor is used for rotating in the first plane and emitting laser signals, receiving reflection signals of the target objects to the laser signals, obtaining relative position information of the target objects in the first plane according to the laser signals and the reflection signals, and transmitting the relative position information to the head-mounted display equipment.
In addition, the application also provides the following technical scheme:
an electronic device comprises a memory and a processor, wherein the memory is used for storing computer instructions, and the processor is used for executing the computer instructions to realize the control method of the embodiment.
In addition, the application also provides the following technical scheme:
a storage medium having stored thereon instructions which, when executed by a processor, implement the control method of the above-described embodiments.
Compared with the prior art, the control method of the head-mounted display device provided by the application comprises the following steps: the laser radar sensor rotates in the first plane and transmits laser signals; the laser radar sensor receives a reflected laser signal of a target object to the laser signal; the laser radar sensor obtains relative position information of the target object in the first plane according to the transmitted laser signal and the reflected laser signal; the lidar sensor transmits the relative position information to a processor of the head-mounted display device.
According to the control method, the head-mounted display device, the electronic device and the storage medium, the relative position information of the target object in the space where the user is located can be obtained, the head-mounted display device determines the current position of the user wearing the head-mounted display device according to the relative position information, and accurate positioning of the user can be achieved.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As can be seen from fig. 1, some embodiments of the present application provide a method for controlling a head-mounted display device, where the head-mounted display device is electrically connected to a lidar sensor, and the lidar sensor may be disposed on the head-mounted display device or may exist separately from the head-mounted display device. The method comprises the following steps:
step S101: the laser radar sensor rotates in the first plane and transmits laser signals;
step S102: a laser signal emitted by the laser radar sensor is reflected by a target object, and a receiving end of the laser radar sensor receives the reflected signal;
step S103: the laser radar sensor obtains relative position information of a target object in the first plane according to the laser signal and the reflected signal;
step S104: the laser radar sensor transmits the relative position information to the head-mounted display device;
step S105: the head-mounted display device determines the current position of the wearing user according to the relative position information.
As shown in fig. 2, step S105 includes:
step S1051: the head-mounted display equipment generates a first-plane 2D map according to the relative position information of the target object;
step S1052: the head-mounted display device generates a three-dimensional model of the space where the user is located according to the 2D map; the coordinate system where the 2D map is located takes the laser radar sensor as the origin of coordinates to position the position of the user in the 2D map.
In step S101, the first plane is a horizontal plane where the initial position of the lidar sensor is located. In some embodiments, the lidar sensor may be disposed on top of the head-mounted display device. The processor built in the lidar sensor is preferably a DSP processor, but may be other types of processors. A micro motor or a micro motor is arranged in the laser radar sensor, the micro motor or the micro motor can drive the laser radar sensor to rotate after receiving the driving signal, and the laser signal is emitted once every preset time interval or every preset rotating angle alpha. For example, the laser signal may be emitted every 10 μ s, 200 μ s, 1ms, or every 5 °, 10 °, 20 ° of rotation. The details may be determined as appropriate.
In step S102, the target object may be any fixed or moving object in space.
In step S103, the relative position information of the target object includes the distance value d and the angle value θ, and may be the relative position information of the target object with respect to the laser radar sensor, or may be the relative position information of the target object with respect to another reference point.
In step S104, the lidar sensor may specifically transmit the relative position information to the head-mounted display device.
According to the control method of the head-mounted display device provided by the embodiment of the invention, the laser radar sensor transmits the laser signal to the target object in the preset space, receives the reflected signal returned by the target object, acquires the relative position information of the target object according to the laser signal and the reflected signal, and transmits the relative position information to the head-mounted display device. Then, the head-mounted display device can determine the current position of the user wearing the head-mounted display device according to the relative position information, and accurate positioning of the user can be achieved.
In other embodiments of the present application, as shown in fig. 3, the method for controlling a head-mounted display device may further include:
step S106: and the head-mounted display equipment adjusts the content to be displayed according to the three-dimensional model so as to display the adjusted content on a display screen of the head-mounted display equipment.
In step S106, adjusting the content to be displayed according to the three-dimensional model includes:
the head-mounted display device adjusts the original data of the head-mounted display device to the current data according to the three-dimensional model;
rendering the current data to construct a scene that matches the space where the user is actually located.
The content ultimately displayed on the display screen of the head-mounted display device can locate the user and the scene is in close spatial proximity to the user, thereby enhancing the user's interaction and immersion with the virtual environment.
When a user uses the head-mounted display device, the head-mounted display device processor acquires the current relative position information of the target object obtained by the laser radar sensor, and updates the content displayed on the display screen of the head-mounted display device according to the current relative position information of the target object.
In some further embodiments of the present application, as shown in fig. 4, the control method shown in fig. 1, fig. 2, or fig. 3 may further include:
step S104: the laser radar sensor transmits the relative position information to the head-mounted display device;
the head-mounted display equipment judges whether the distance value d in the relative position information is not greater than a first preset value; the first preset value can be 1m or 0.5m, and of course, other preset values can also be provided;
if the judgment result of the head-mounted display device is yes, the head-mounted display device sends out an obstacle prompt, and the obstacle prompt can remind a user of obstacles around the user in the form of animation on a display screen of the head-mounted display device through sound, vibration or the fact that the outline of the obstacles is strengthened on the display screen of the head-mounted display device, so that the attention of the user is attracted, and collision is avoided.
In some further embodiments of the present application, as shown in fig. 5, the control method shown in the above embodiments may further include:
step S104: the laser radar sensor transmits the relative position information to the head-mounted display device;
meanwhile, the head-mounted display equipment receives a vertical distance value and an included angle value of two planes which are opposite to the first plane and are obtained by the IMU sensor;
the plane II is a plane where the laser radar sensor is located and moves along with the head of the user, and the plane II rotates up and down or moves up and down relative to the plane I;
step S1051: the head-mounted display equipment constructs a current 2D map according to the received vertical distance value and the included angle value and by combining the current relative position information of the target object, so as to correct the deviation of the constructed 2D map caused by the head movement of the user;
s1052: the head-mounted display device generates a three-dimensional model of the space where the user is located according to the 2D map;
step S106: and the head-mounted display equipment adjusts the content to be displayed according to the three-dimensional model so as to display the adjusted content on a display screen of the head-mounted display equipment.
In some further embodiments of the present application, as shown in fig. 6, the control method shown in the above embodiments may further include:
step S1051: the head-mounted display equipment constructs a 2D map with the center of a display screen of the head-mounted display equipment as a reference point according to the distance value a and by combining the current relative position information of the target object;
the distance value a is the vertical distance between the center of a display screen of the head-mounted display device and the laser radar sensor; compensating for a deviation of the constructed current 2D map due to a distance between the lidar sensor and a center of a display screen of the head mounted display device;
step S1052: the head-mounted display device generates a three-dimensional model of the space where the user is located according to the current 2D map;
step S106: the head-mounted display equipment adjusts the original data of the head-mounted display equipment to the current data according to the current three-dimensional model;
and rendering the current data to construct a scene matched with the space where the user wearing the head-mounted display device is actually located, and displaying the rendered scene on a display screen of the head-mounted display device. The content displayed on the display screen is prevented from deviating, and better interaction between the user and the virtual environment is realized.
Based on the same inventive concept, the present application further provides a head-mounted display device, as shown in fig. 7, the head-mounted display device includes an IMU sensor, at least one set of lidar sensors mounted on the head-mounted display device;
the laser radar sensor is connected with the processor of the head-mounted display device;
the laser radar sensor is used for rotating in the first plane and emitting laser signals, receiving reflection signals of the target object to the laser signals, obtaining relative position information of the target object in the first plane according to the laser signals and the reflection signals, and transmitting the relative position information to the head-mounted display device;
the head mounted display apparatus may implement the control method shown in the above-described embodiments.
In addition, the embodiment of the application can also provide the following scheme:
an electronic device comprises a memory for storing computer instructions and a processor for executing the computer instructions to implement the control method shown in the above embodiments.
It should be noted that the electronic device in this embodiment may be a head-mounted display device, such as a virtual reality head-mounted display device, an augmented reality head-mounted display device, or a mixed reality head-mounted display device.
In addition, the embodiment of the present application may further provide:
a storage medium having stored thereon instructions which, when executed by a processor, can implement the control method shown in the above embodiments. For example, the storage medium may be a ROM, a RAM, or the like.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.