Disclosure of Invention
In view of the above, it is necessary to provide a positioning method, an apparatus, a computer device and a storage medium capable of improving positioning accuracy.
In a first aspect, a positioning method is provided, which is used in a robot to be positioned, and includes:
acquiring an initial position of the robot in a positioning area; acquiring a real-time moving direction and a real-time moving displacement of the robot after the robot starts to move from the initial position; calculating the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement; the real-time location is shown on an electronic map of the positioning area.
In one embodiment, acquiring an initial position of the robot within the positioning area includes:
determining a target fixed object in a preset range around the robot in an initial state, and acquiring the position of the target fixed object in the positioning area; acquiring the relative position of the robot and the target fixed object; and determining the initial position according to the relative position and the position of the target fixed object in the positioning area.
In one embodiment, the robot is provided with an image sensor, and the method for determining the target fixed object in the preset range around the robot in the initial state comprises the following steps:
in an initial state, shooting a preset range around the robot through the image sensor to obtain an image of the preset range around the robot; and identifying the image to obtain the target fixed object in the preset range around the robot.
In one embodiment, acquiring the position of the target fixation object within the positioning region includes:
acquiring an electronic map of the positioning area; the electronic map comprises the positions of all fixed objects in the positioning area; and extracting the position of the target fixed object in the positioning area from the electronic map.
In one embodiment, the robot is provided with a ranging sensor, and acquiring the relative position of the robot and the target fixed object comprises:
and measuring the distance between the robot and the target fixed object through the ranging sensor to obtain the relative position of the robot and the target fixed object.
In one embodiment, the robot is provided with a motion sensor, the motion sensor comprises a speed sensor, an acceleration sensor and a gyroscope, and the real-time moving direction and the real-time moving displacement of the robot after the robot starts to move from the initial position are acquired, and the method comprises the following steps:
obtaining real-time movement displacement of the robot after the robot starts to move from the initial position through at least one of a speed sensor and an acceleration sensor in the motion sensor; and obtaining the real-time moving direction of the robot after the robot starts to move from the initial position through a gyroscope in the motion sensor.
In one embodiment, calculating the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement includes:
and inputting the initial position, the real-time moving direction and the real-time moving displacement into a positioning algorithm to obtain the real-time position of the robot in the positioning area.
In one embodiment, the method further comprises:
positioning and calibrating the real-time position of the robot in the positioning area according to the preset interval duration; the positioning calibration includes reacquiring an initial position of the robot within a positioning region.
In a second aspect, there is provided a positioning device, the device comprising:
the first acquisition module is used for acquiring the initial position of the robot in the positioning area;
the second acquisition module is used for acquiring the real-time moving direction and the real-time moving displacement of the robot after the robot starts to move from the initial position;
the calculation module is used for calculating the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement;
and the display module is used for displaying the real-time position on the electronic map of the positioning area.
In one embodiment, the first obtaining module is specifically configured to determine, in an initial state, a target fixed object within a preset range around the robot, and obtain a position of the target fixed object in the positioning area; acquiring the relative position of the robot and the target fixed object; and determining the initial position according to the relative position and the position of the target fixed object in the positioning area.
In one embodiment, the robot is provided with an image sensor, and the first acquisition module is specifically configured to capture a preset range around the robot through the image sensor in an initial state to obtain an image of the preset range around the robot; and identifying the image to obtain the target fixed object in the preset range around the robot.
In one embodiment, the first obtaining module is specifically configured to obtain an electronic map of the positioning area; the electronic map comprises the positions of all fixed objects in the positioning area; and extracting the position of the target fixed object in the positioning area from the electronic map.
In one embodiment, the robot is provided with a distance measuring sensor, and the first obtaining module is specifically configured to measure a distance between the robot and the target fixed object through the distance measuring sensor to obtain a relative position between the robot and the target fixed object.
In one embodiment, the robot is provided with a motion sensor, the motion sensor comprises a speed sensor, an acceleration sensor and a gyroscope, and the second acquisition module is specifically configured to obtain a real-time movement displacement of the robot after the robot starts to move from the initial position through at least one of the speed sensor and the acceleration sensor in the motion sensor; and obtaining the real-time moving direction of the robot after the robot starts to move from the initial position through a gyroscope in the motion sensor.
In one embodiment, the calculation module is specifically configured to input the initial position, the real-time moving direction, and the real-time moving displacement into a positioning algorithm to obtain a real-time position of the robot in the positioning area.
In one embodiment, the device further comprises a calibration module, wherein the calibration module is used for positioning and calibrating the real-time position of the robot in the positioning area according to a preset interval duration; the positioning calibration includes reacquiring an initial position of the robot within a positioning region.
In a third aspect, a computer device is provided, comprising a memory storing a computer program and a processor, the processor implementing the positioning method according to any one of the first aspect when executing the computer program.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the positioning method according to any of the first aspect.
According to the positioning method, the positioning device, the computer equipment and the storage medium, the robot to be positioned obtains the initial position of the robot in the positioning area, and obtains the real-time moving direction and the real-time moving displacement after the robot starts to move from the initial position; calculating the real-time position of the user in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement; and finally, displaying the real-time position on the electronic map of the positioning area. That is to say, the positioning method completely realizes the positioning by acquiring various data required by the positioning by the robot and calculating the real-time position of the robot according to the acquired various data, so that the method avoids the problem of inaccurate positioning caused by the interference of electromagnetic signals and the influence of obstacles in the prior art by the autonomous positioning of the robot, and improves the positioning accuracy.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In real life, with the development of artificial intelligence and positioning technology, robots are the best choice to assist or even replace human beings to perform some special tasks that cannot be achieved, for example: for a fire scene, the robot can replace a fireman to enter the fire scene to survey the scene, search victims, determine specific positions of the victims and the like, in actual operation, the fireman who controls the robot can control different motions of the robot through remote control equipment, and can also realize the positioning of the real-time position of the robot through a positioning technology, so that the fireman can timely master the state, the real-time position, the motion track and the like of the robot. In addition, in addition to the above-exemplified robots for assisting fire fighters in conducting fire site surveys, the robots performing special tasks may be any ground robot, unmanned aerial vehicle, underwater robot, or the like.
In the existing positioning technologies, the common positioning technologies mainly include a positioning technology based on electromagnetic signals, a positioning technology based on a pre-established positioning standard, a global satellite positioning technology and a Beidou satellite positioning technology. Wherein the electromagnetic signal based positioning technique determines the actual position of the object by measuring the time, signal angle or signal strength of the electromagnetic signal; taking the measured signal time as an example, a sender adds a timestamp to a sent data frame at a data link layer, a receiver (which may be a base station) returns an Acknowledgement (ACK) frame after correctly receiving the data frame, the sender adds another timestamp after receiving the acknowledgement frame, the difference between the two timestamps can calculate round-trip-time (RTT) time, and further calculate relative displacement and absolute position by combining information such as acceleration and speed; the communication measurement method based on electromagnetic waves is easily affected by the interference of electromagnetic signals and indoor obstacles, and the positioning is inaccurate.
The positioning technology in the embodiment of the application does not need to additionally emit positioning electromagnetic waves, and calculated data are obtained through a motion sensing device, a distance measuring device and a camera device of the robot; in addition, in the embodiment of the application, the robot may further include an electronic map of a positioning area, where the electronic map may include a general geographical electronic map, a building structure diagram of a general building, a ship structure diagram of a ship, a building structure diagram of a drilling platform, a chemical plant, and the like, and may further include position information of a fixed-position object, such as position information of regularly distributed smoke alarms and the like; therefore, the positioning technology in the embodiment of the application adopts autonomous positioning of the robot, and does not need to send and receive electromagnetic waves, so that the problems and disadvantages of the existing electromagnetic wave positioning technology can be avoided, and accurate positioning of the robot is realized.
The positioning method provided by the embodiment of the application can be applied to the robot to be positioned. The robot may include a sensor group, a memory, a processor, and the like. Wherein, the sensor group can comprise a motion sensor, a distance measuring sensor, an image sensor and the like; the motion sensor can comprise a speed sensor, an acceleration sensor, a gyroscope and the like, and can be used for measuring the moving displacement and the moving direction of the robot in real time; the distance measuring sensor can comprise an infrared distance measuring instrument, a laser distance measuring instrument, an ultrasonic distance measuring instrument and the like and can be used for measuring the distance between the distance measuring sensor and a fixed object; the image sensor can be a camera such as a CMOS camera, a CCD camera and the like, and can be used for identifying fixed objects around the robot. An electronic map of the location area may be stored in the memory. A processor may be used to perform the positioning method. In addition, the positioning method of the embodiment of the application can be applied to positioning of other moving objects or people besides the mobile robot.
In an embodiment, as shown in fig. 1, a positioning method is provided, which is described by taking as an example that the method is applied to the robot to be positioned, and includes the following steps:
step 101, the robot acquires the initial position of the robot in the positioning area.
When the robot executes a specific task, a user needs to know the position of the robot in real time, and therefore, a positioning function needs to be added to the robot executing the task so that the user can see the position information and the motion track of the robot in real time on a terminal. Alternatively, when the positioning function is started to perform real-time positioning of the robot, in general, the initial position of the robot before movement needs to be obtained first, that is, the initial position of the robot on the electronic map when the robot starts to perform a task needs to be known, and the user can also clearly see the initial position of the robot through the electronic map displayed by the terminal.
In the following, several alternative ways of acquiring the initial position of the robot will be briefly described in the embodiments of the present application.
In the first mode, a global positioning satellite module or a Beidou satellite positioning module can be installed on the robot, and the position information of the current position of the robot can be acquired through a Global Positioning Satellite (GPS) technology or a Beidou satellite positioning technology; alternatively, the position information may be saved in the robot's own memory for later reference for autonomous positioning of the robot; the location information may also be transmitted to a user terminal so that the terminal can display the location information on an electronic map.
In a second mode, the initial position of the robot can be obtained in a manual given mode; on one hand, an electronic map of a positioning area can be imported into a self memory of the robot, and the electronic map can comprise position information of all fixed objects; alternatively, the position information for the fixed object can be obtained from the electronic map by placing the robot at a certain fixed object position when the robot starts to perform a task, so that the robot starts to move from the fixed object; on the other hand, the robot may be placed at a fixed object position, and the fixed object is selected on the terminal to obtain the position information of the fixed object, so as to obtain the initial position of the robot, or the obtained initial position of the robot may be sent to the robot, so that the robot performs the calculation of self-positioning later.
And 102, acquiring the real-time moving direction and the real-time moving displacement of the robot after the robot starts to move from the initial position.
In an alternative embodiment of the present application, a motion sensor may be disposed on the robot, and the motion sensor may include a speed sensor, an acceleration sensor, a gyroscope, and the like; alternatively, the real-time movement displacement of the robot after starting to move from the initial position may be obtained by at least one of a speed sensor and an acceleration sensor in the motion sensor. The real-time moving speed of the robot can be obtained through a speed sensor, and the real-time moving displacement of the robot can be obtained by performing primary integration on the real-time moving speed; the real-time moving acceleration of the robot can be obtained through an acceleration sensor, and the real-time moving displacement of the robot can be obtained by integrating the real-time moving acceleration twice; the real-time moving displacement obtained by the speed sensor and the real-time moving displacement obtained by the acceleration sensor can be summed and averaged to obtain more accurate real-time moving displacement of the robot, so that the inaccuracy of the measured real-time moving displacement of the robot caused by the detection error of the speed sensor or the acceleration sensor is avoided. In the embodiment of the present application, a method for measuring the real-time movement displacement of the robot is not limited.
In an alternative embodiment of the present application, only the axial linear motion of the robot can be detected by the speed sensor or the acceleration sensor, and the rotational motion of the robot cannot be detected, so that the complete 3D motion of the robot cannot be measured or reconstructed; therefore, in the embodiment of the present application, the real-time moving direction of the robot after moving from the initial position can also be obtained through a gyroscope (angular velocity sensor) in the motion sensor. Optionally, a rotation angular velocity of the robot when the robot rotates or tilts may be measured by a gyroscope, and then a real-time moving direction of the robot may be obtained by the rotation angular velocity.
In an alternative embodiment of the present application, fixed objects around the robot may be identified by the image sensor, and the real-time moving direction and the real-time moving displacement after the robot starts to move from the initial position are determined by the change of each fixed object identified by the mobile robot during the moving process. For example: the real-time moving direction and real-time moving displacement of the robot from the first fixed object to the second fixed object may be determined by the position information of the robot moving to the first fixed object and the position information of the robot moving to the second fixed object.
Step 103, the robot calculates the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement.
Different ways of acquiring the real-time position of the robot may be used, and several alternative ways of acquiring the real-time position of the robot will be briefly described below.
Firstly, the robot can input the initial position, the real-time moving direction and the real-time moving displacement into a positioning algorithm of the robot, and the current position of the robot is calculated and output by the positioning algorithm, so as to obtain the real-time position of the robot in a positioning area.
Secondly, the robot may also calculate the real-time position of the robot in the positioning area by sending the initial position, the real-time moving direction and the real-time moving displacement to the terminal.
Thirdly, the robot can also calculate the real-time position of the robot in the positioning area by the server by sending the initial position, the real-time moving direction and the real-time moving displacement to the server. The embodiment of the application does not limit the manner of acquiring the real-time position of the robot, and the real-time position of the robot can be acquired by adopting one manner or a combination of a plurality of different manners.
Step 104, displaying the real-time position on the electronic map of the positioning area.
In an optional embodiment of the present application, after obtaining the real-time position of the robot in the positioning area, the robot may send the real-time position to the terminal, so that the terminal may display the real-time position on the electronic map of the positioning area, so that the user may view the position and shape of the robot at any time; optionally, the robot and/or the terminal may also construct a motion trajectory of the robot according to the real-time position.
In the positioning method, the robot to be positioned obtains the initial position of the robot in the positioning area, and obtains the real-time moving direction and real-time moving displacement of the robot after the robot starts to move from the initial position; calculating the real-time position of the user in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement; and finally, displaying the real-time position on the electronic map of the positioning area. That is to say, the positioning method completely realizes the positioning by acquiring various data required by the positioning by the robot and calculating the real-time position of the robot according to the acquired various data, so that the method avoids the problem of inaccurate positioning caused by the interference of electromagnetic signals and the influence of obstacles in the prior art by the autonomous positioning of the robot, and improves the positioning accuracy.
As can be seen from the above description, the memory of the robot itself may store an electronic map of the positioning area, and the electronic map may include the position information of all fixed objects in the positioning area; accordingly, the initial position of the robot can be determined by acquiring the position information of the fixed object.
Referring to fig. 2, which is a schematic diagram illustrating an exemplary method for acquiring an initial position of a robot, as shown in fig. 2, the exemplary method for acquiring an initial position of a robot is to acquire an initial position of the robot based on positioning assistance of various sensor elements of the robot itself.
Step 201, the robot determines a target fixed object within a preset range around the robot in an initial state, and obtains a position of the target fixed object in the positioning area.
In an alternative embodiment of the present application, the robot may be provided with an image sensor, and the commonly used image sensor may have a camera such as a CMOS or CCD; optionally, in an initial state, the preset range around the robot may be photographed by the image sensor to obtain an image of the preset range around the robot; and carrying out feature extraction and identification on the image to obtain a target fixed object in a preset range around the robot. Alternatively, if the robot is a robot moving on the ground, the image sensor may be disposed in front of the robot, a video or photo image in front of the robot may be captured, feature extraction may be performed on the video or photo image, and a target fixed object in the video or photo image may be identified, where the target fixed object may be one or multiple fixed objects. Optionally, if the robot is an unmanned aerial vehicle, the image sensor may be disposed below the robot, and a video or photo image located below the robot may be captured. The embodiment of the present application does not limit the position of the image sensor on the robot.
In an optional embodiment of the present application, the position of the target fixed object in the positioning area may be extracted from the electronic map by acquiring the electronic map of the positioning area; for example: and may include, but is not limited to, walls, doors, windows, traffic signs, road signs, buildings, and other fixed-featured and fixed-location objects within the localized area.
In step 202, the robot acquires its relative position to the target stationary object.
In an alternative embodiment of the present application, the initial position of the robot may be at the target stationary object or at a position around the target stationary object; when the initial position of the robot is at the target fixed object, the position information of the target fixed object is the initial position of the robot; when the initial position of the robot is at a position around the target fixed object, the relative position between the robot and the target fixed object needs to be known to determine the initial position of the robot. Optionally, a distance measuring sensor can be arranged on the robot, and the distance measuring sensor can be one or more of an infrared distance measuring instrument, a laser distance measuring instrument or an ultrasonic distance measuring instrument; alternatively, the distance between the robot and the target fixed object may be measured by the ranging sensor, and the relative position between the robot and the target fixed object is obtained. For example: when a road sign is identified in front of the robot through the image sensor, the direction of the road sign identified by the robot is the north direction, and the distance between the robot and the road sign obtained through the distance measuring sensor is 2 meters, so that the relative position of the robot relative to the road sign is the south direction of 2 meters.
Step 203, the robot determines the initial position according to the relative position and the position of the target fixed object in the positioning area.
After the target fixed objects around the robot and the relative positions of the robot and the target fixed objects are obtained, optionally, according to the relative positions and the positions of the target fixed objects in the positioning area, the initial position of the robot may be determined through an auxiliary positioning algorithm of the robot. Based on the above example, assuming that the position information of the landmark is (264,127), and the relative position of the robot with respect to the landmark is at 2 meters in the south-plus-south direction, the initial position of the robot is (264,125).
In this embodiment, the robot determines a target fixed object within a preset range around the robot in an initial state, and obtains a position of the target fixed object in the positioning area; acquiring the relative position of the target fixed object and the self; determining the initial position of the user in the positioning area according to the relative position and the position of the target fixed object in the positioning area; the sensor group carried by the sensor group can be used for identifying, sensing and ranging the fixed object so as to determine the initial position of the sensor group in the positioning area; the initial position is not required to be obtained by sending electromagnetic waves outwards, the positioning accuracy is improved, and the application range of the positioning method can be enlarged. In addition, the electronic map adopted in this embodiment is based on a building or landmark map constructed according to a unified standard drawing at present, and map data can be quickly imported into the robot by using a unified program, so that the electronic map used in the embodiment of the present application is converted, and no additional surveying and mapping operation is required, so that the portability of the positioning system to which the positioning method in this embodiment is applied can be improved, and the adaptability is strong.
In an optional embodiment of the present application, during the movement of the robot, the real-time position of the robot during the movement may also be calibrated, so as to ensure that the positioning error of the robot can be kept within a certain range when the robot is continuously positioned. According to the above description, in the process of measuring the real-time moving direction and the real-time moving displacement of the robot after the robot starts to move from the initial position in real time by the motion sensor carried by the robot, the accumulated error of the real-time moving direction and the real-time moving displacement of the robot measured by the motion sensor becomes larger and larger along with the continuous increase of the calculation time; taking an acceleration sensor as an example, the average error of the acceleration sensor is about 0.08% -0.36% (the measurement range is 0.1-0.4 g, g is the gravity acceleration), and when the real-time movement displacement of the robot is calculated by adopting the acceleration, the error is obviously increased along with the increase of time, so that the positioning is inaccurate, and the positioning precision is further deteriorated. Therefore, in order to ensure the positioning accuracy and reduce the positioning error, the embodiment of the application calibrates the real-time position of the robot after a period of time; optionally, the real-time position of the robot in the positioning area may be positioned and calibrated according to a preset interval duration; the positioning calibration may be to obtain an initial position of the robot in a positioning area again, and the initial position of the robot in the positioning area may be obtained again by using the above-mentioned satellite or beidou positioning, or by using a fixed object identification and ranging method, where the initial position is a current position of the robot when performing the positioning calibration, and is not an initial position of the robot when starting to perform a task.
In an alternative embodiment of the present application, the preset interval duration may be determined according to the requirement for the positioning accuracy of the robot; optionally, the accuracy of the sensor of the robot can be determined, and a high-accuracy sensor can correspond to a high positioning accuracy; or a plurality of preset calibration points or fixed reference objects are arranged in the positioning area, the real-time position of the robot is calibrated through the preset calibration points or the fixed reference objects, when the robot moves to a certain calibration point or a fixed reference object, the position information of the calibration point or the fixed reference object can be used as the initial position of the robot to realize position calibration, and the positioning precision under the method can depend on the position interval of each calibration point or fixed reference object; the positioning accuracy may also depend on the computational power of the processor and the highest sampling frequency of the sensor. In the embodiment of the application, according to different positioning accuracy requirements, different preset interval durations may be adopted to calibrate the real-time position of the robot, and optionally, the higher the positioning accuracy requirement is, the shorter the preset interval duration for performing positioning calibration is.
In the embodiment, the positioning accuracy of the robot can be improved, the positioning error is reduced and the positioning accuracy of the robot can be improved by carrying out position calibration on the real-time position measured by the robot in the moving process; in addition, according to the requirements of different positioning accuracy, different preset interval durations can be set to calibrate the position of the robot in real time, the controllability of the positioning accuracy can be realized, and then different positioning accuracy can be adopted according to the positioning requirements of different occasions, so that the positioning is more targeted, and the best effect is obtained with the least occupied resources.
It should be understood that although the various steps in the flow charts of fig. 1-2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-2 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 3, there is provided a positioning device comprising: a first obtaining module 301, a second obtaining module 302, a calculating module 303 and a presenting module 304, wherein:
a first obtaining module 301, configured to obtain an initial position of the robot in a positioning area;
a second obtaining module 302, configured to obtain a real-time moving direction and a real-time moving displacement after the robot starts to move from the initial position;
a calculating module 303, configured to calculate a real-time position of the robot in the positioning area according to the initial position, the real-time moving direction, and the real-time moving displacement;
a displaying module 304, configured to display the real-time location on the electronic map of the positioning area.
In one embodiment, the first obtaining module 301 is specifically configured to determine, in an initial state, a target fixed object within a preset range around the robot, and obtain a position of the target fixed object in the positioning area; acquiring the relative position of the robot and the target fixed object; and determining the initial position according to the relative position and the position of the target fixed object in the positioning area.
In one embodiment, the robot is provided with an image sensor, and the first obtaining module 301 is specifically configured to, in an initial state, shoot a preset range around the robot through the image sensor to obtain an image of the preset range around the robot; and identifying the image to obtain the target fixed object in the preset range around the robot.
In one embodiment, the first obtaining module 301 is specifically configured to obtain an electronic map of the positioning area; the electronic map comprises the positions of all fixed objects in the positioning area; and extracting the position of the target fixed object in the positioning area from the electronic map.
In one embodiment, the robot is provided with a distance measuring sensor, and the first obtaining module 301 is specifically configured to measure a distance between the robot and the target fixed object through the distance measuring sensor to obtain a relative position between the robot and the target fixed object.
In one embodiment, the robot is provided with a motion sensor, the motion sensor includes a speed sensor, an acceleration sensor and a gyroscope, and the second obtaining module 302 is specifically configured to obtain a real-time movement displacement of the robot after the robot starts to move from the initial position through at least one of the speed sensor and the acceleration sensor in the motion sensor; and obtaining the real-time moving direction of the robot after the robot starts to move from the initial position through a gyroscope in the motion sensor.
In one embodiment, the calculating module 303 is specifically configured to input the initial position, the real-time moving direction, and the real-time moving displacement into a positioning algorithm to obtain a real-time position of the robot in the positioning area.
In one embodiment, the apparatus further comprises a calibration module; the calibration module is used for positioning and calibrating the real-time position of the robot in the positioning area according to the preset interval duration; the positioning calibration includes reacquiring an initial position of the robot within a positioning region.
For the specific definition of the positioning device, reference may be made to the above definition of the positioning method, which is not described herein again. The modules in the positioning device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a robot, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing electronic map data of the positioning area. The network interface of the computer device is used for connecting and communicating with an external terminal device through a network. The computer program is executed by a processor to implement a positioning method.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring an initial position of the robot in a positioning area; acquiring a real-time moving direction and a real-time moving displacement of the robot after the robot starts to move from the initial position; calculating the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement; the real-time location is shown on an electronic map of the positioning area.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring an initial position of the robot in a positioning area, comprising: determining a target fixed object in a preset range around the robot in an initial state, and acquiring the position of the target fixed object in the positioning area; acquiring the relative position of the robot and the target fixed object; and determining the initial position according to the relative position and the position of the target fixed object in the positioning area.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the robot is provided with an image sensor, determines a target fixed object in a preset range around the robot in an initial state, and comprises: in an initial state, shooting a preset range around the robot through the image sensor to obtain an image of the preset range around the robot; and identifying the image to obtain the target fixed object in the preset range around the robot.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the position of the target fixed object in the positioning area, including: acquiring an electronic map of the positioning area; the electronic map comprises the positions of all fixed objects in the positioning area; and extracting the position of the target fixed object in the positioning area from the electronic map.
In one embodiment, the processor, when executing the computer program, further performs the steps of: this robot is provided with range finding sensor, acquires the relative position of this robot and the fixed object of this target, includes: and measuring the distance between the robot and the target fixed object through the ranging sensor to obtain the relative position of the robot and the target fixed object.
In one embodiment, the processor, when executing the computer program, further performs the steps of: this robot is provided with motion sensor, and this motion sensor includes velocity sensor, acceleration sensor and gyroscope, acquires the real-time moving direction and the real-time displacement of removing after this robot begins to remove from this initial position, includes: obtaining real-time movement displacement of the robot after the robot starts to move from the initial position through at least one of a speed sensor and an acceleration sensor in the motion sensor; and obtaining the real-time moving direction of the robot after the robot starts to move from the initial position through a gyroscope in the motion sensor.
In one embodiment, the processor, when executing the computer program, further performs the steps of: calculating the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement, including: and inputting the initial position, the real-time moving direction and the real-time moving displacement into a positioning algorithm to obtain the real-time position of the robot in the positioning area.
In one embodiment, the processor, when executing the computer program, further performs the steps of: positioning and calibrating the real-time position of the robot in the positioning area according to the preset interval duration; the positioning calibration includes reacquiring an initial position of the robot within a positioning region.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring an initial position of the robot in a positioning area;
acquiring a real-time moving direction and a real-time moving displacement of the robot after the robot starts to move from the initial position;
calculating the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement;
the real-time location is shown on an electronic map of the positioning area.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring an initial position of the robot in a positioning area, comprising: determining a target fixed object in a preset range around the robot in an initial state, and acquiring the position of the target fixed object in the positioning area; acquiring the relative position of the robot and the target fixed object; and determining the initial position according to the relative position and the position of the target fixed object in the positioning area.
In one embodiment, the computer program when executed by the processor further performs the steps of: the robot is provided with an image sensor, determines a target fixed object in a preset range around the robot in an initial state, and comprises: in an initial state, shooting a preset range around the robot through the image sensor to obtain an image of the preset range around the robot; and identifying the image to obtain the target fixed object in the preset range around the robot.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the position of the target fixed object in the positioning area, including: acquiring an electronic map of the positioning area; the electronic map comprises the positions of all fixed objects in the positioning area; and extracting the position of the target fixed object in the positioning area from the electronic map.
In one embodiment, the computer program when executed by the processor further performs the steps of: this robot is provided with range finding sensor, acquires the relative position of this robot and the fixed object of this target, includes: and measuring the distance between the robot and the target fixed object through the ranging sensor to obtain the relative position of the robot and the target fixed object.
In one embodiment, the computer program when executed by the processor further performs the steps of: this robot is provided with motion sensor, and this motion sensor includes velocity sensor, acceleration sensor and gyroscope, acquires the real-time moving direction and the real-time displacement of removing after this robot begins to remove from this initial position, includes: obtaining real-time movement displacement of the robot after the robot starts to move from the initial position through at least one of a speed sensor and an acceleration sensor in the motion sensor; and obtaining the real-time moving direction of the robot after the robot starts to move from the initial position through a gyroscope in the motion sensor.
In one embodiment, the computer program when executed by the processor further performs the steps of: calculating the real-time position of the robot in the positioning area according to the initial position, the real-time moving direction and the real-time moving displacement, including: and inputting the initial position, the real-time moving direction and the real-time moving displacement into a positioning algorithm to obtain the real-time position of the robot in the positioning area.
In one embodiment, the computer program when executed by the processor further performs the steps of: positioning and calibrating the real-time position of the robot in the positioning area according to the preset interval duration; the positioning calibration includes reacquiring an initial position of the robot within a positioning region.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.