A kind of virtual barrier-avoiding method, device, storage medium and robotTechnical field
The present invention relates to field of navigation technology more particularly to a kind of virtual barrier-avoiding method, device, storage medium and machinesPeople.
Background technique
The navigation procedure of robot relies primarily on various sensors (such as laser radar) to perceive the environment on its periphery, exampleSuch as whether there are the information such as barrier.But the light beam of laser radar can penetrate glass, can not detect the transparencies such as glassBody, thus the transparent substances such as glass can be regarded be available free area during the navigation process;In addition, being deposited in certain environmentIn certain dangerous or privacy areas, for example store the room etc. of inflammable and explosive object.For these scenes, it is intended that robotThese regions (glass, danger zone etc.) can independently be got around.Avoidance is carried out using virtual obstacles although having developed at present,But in current Robot Virtual avoidance, it is Chong Die with virtual obstacles to be still faced with robot part body, occurs emptyThe case where quasi- barrier avoidance failure.
Summary of the invention
The purpose of the present invention is to provide a kind of virtual barrier-avoiding method, device, storage medium and robots, to solve in meshIn preceding Robot Virtual avoidance, it is Chong Die with virtual obstacles to be still faced with robot part body, virtual obstacles occursThe problem of the case where avoidance fails.
To achieve this purpose, the present invention adopts the following technical scheme:
A kind of virtual barrier-avoiding method, comprising: add several virtual obstacles on initial map, generate virtual limitation groundFigure;Specifically comprise the following steps:
The virtual obstacles parameter that user draws on initial map is obtained, several virtual obstacles are generated;
The virtual obstacles are optimized, are specifically included: optimizing the shape of the virtual obstacles, fill up empty automaticallyQuasi- barrier edge notches width is less than the sunk area of the current diameter of robot;And/or the virtual obstacles are carried out adjacentDomain is sorted out, and the virtual obstacles that interval is less than the current diameter of robot are grouped together;
Virtual obstacles after optimization are added on initial map, virtual limitation map is generated.
Optionally, the step: adding several virtual obstacles on initial map, after generating virtual limitation map,Further include:
Practical obstacle object addition is entered in virtual limitation map, is generated in real time by real time scan practical obstacle objectFigure;
Each barrier in real-time map is equidistantly expanded outwardly by its profile, generates real-time navigation map, the barrierHindering object includes virtual obstacles and practical obstacle object;
Avoidance is carried out according to each barrier in real-time navigation map.
Optionally, each barrier in real-time map is equidistantly expanded outwardly by its profile, is specifically included:
It is drawn out outside the current outline sideline of barrier around the expansion profile sideline in current outline sideline, expands profileEach point is greater than or equal to the passage radius of robot to the distance in current outline sideline on sideline, forms expansion by expansion profile sidelineBarrier after.
Optionally, the virtual obstacles parameter includes forming the vertex of several virtual obstacles profiles, by successivelyEach vertex is connected into generation virtual obstacles.
Optionally, the step: adding several virtual obstacles on initial map, before generating virtual limitation map,Further include:
Pre-loaded initial map includes several initial obstacle objects on initial map.
A kind of virtual obstacle avoidance apparatus, comprising: virtual obstacles module, for adding several virtual obstacles on initial mapObject generates virtual limitation map;The virtual obstacles module includes:
Virtual obstacles generation unit, the virtual obstacles parameter drawn on initial map for obtaining user generateSeveral virtual obstacles;
Virtual obstacles optimize unit and fill up virtual obstacles side automatically for optimizing the shape of the virtual obstaclesEdge notch width is less than the sunk area of the current diameter of robot;And/or return for carrying out neighborhood to the virtual obstaclesThe virtual obstacles that interval is less than the current diameter of robot are grouped together by class;
Virtual obstacles adding unit: the virtual obstacles after optimization are added on initial map, generate virtual limitationMap.
Optionally, virtual obstacle avoidance apparatus further include: practical obstacle object module is used for real time scan practical obstacle object, by instituteIt states the addition of practical obstacle object to enter in virtual limitation map, generates real-time map;
Barrier expands module, for equidistantly expanding outwardly to each barrier in real-time map by its profile, generatesReal-time navigation map, the barrier include virtual obstacles and practical obstacle object;
Obstacle avoidance module, for carrying out avoidance according to each barrier in real-time navigation map.
A kind of storage medium, the storage medium are stored with a plurality of instruction, and described instruction is suitable for processor and is loaded, withExecute the step in as above any virtual barrier-avoiding method.
A kind of robot, the robot include any virtual obstacle avoidance apparatus as above.
Compared with prior art, the embodiment of the present invention has the advantages that
The present invention is by optimizing virtual obstacles: optimizing the shape of virtual obstacles and merges small spacing obstacleObject reduces operand when robot navigation, while preventing and too small lead to robot part due to being spaced when robot ambulationBody enters barrier region, the problem of avoidance failure occurs.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show belowThere is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only thisSome embodiments of invention without any creative labor, may be used also for those of ordinary skill in the artTo obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of flow chart for virtual barrier-avoiding method that the embodiment of the present invention one provides;
Fig. 2 is the specific flow chart of the step S102 for virtual barrier-avoiding method that the embodiment of the present invention one provides a kind of;
Fig. 3 is a kind of structural schematic diagram of virtual obstacle avoidance apparatus provided by Embodiment 2 of the present invention.
In figure: 10, virtual obstacles module;11, virtual obstacles generation unit;12, virtual obstacles optimize unit;13, virtual obstacles adding unit;20, practical obstacle object module;30, barrier expands module;40, obstacle avoidance module.
Specific embodiment
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present inventionAttached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed belowEmbodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this fieldThose of ordinary skill's all other embodiment obtained without making creative work, belongs to protection of the present inventionRange.
To further illustrate the technical scheme of the present invention below with reference to the accompanying drawings and specific embodiments.
Embodiment one
Referring to FIG. 1, a kind of virtual barrier-avoiding method, includes the following steps:
Step S101: pre-loaded initial map includes several initial obstacle objects on initial map.
Step S102: adding several virtual obstacles on initial map, generates virtual limitation map.
Step S103: real time scan practical obstacle object enters practical obstacle object addition in virtual limitation map, rawAt real-time map.
Step S104: equidistantly being expanded outwardly each barrier in real-time map by its profile, with generating real-time navigationFigure;Wherein, barrier includes initial obstacle object, virtual obstacles and practical obstacle object.
Step S105: avoidance is carried out according to each barrier in real-time navigation map.
Further, step S104 is specifically included: is drawn out outside the current outline sideline of barrier around current outlineThe expansion profile sideline in sideline, the distance for expanding each point to current outline sideline on profile sideline are greater than or equal to the logical of robotRow radius forms the barrier after expansion by expansion profile sideline.
Wherein, the passage radius of robot is the half of required maximum width when robot is current, and the passage of robot is straightDiameter is maximum width required when robot is current.
By expanding to each barrier in real-time map, robot processor in real-time navigation can be reducedBarrier calculation amount reduces the use demand of processor.
Further, referring to FIG. 2, step S102 is specifically included:
Step S1021: starting user setting function, the parameter for allowing user to carry out virtual obstacles on initial map are drawnSystem;Wherein, user can draw the parameters such as the shape of virtual obstacles, size by modes such as point/line/polygons.
Step S1022: the virtual obstacles parameter that user draws on initial map is obtained, several virtual obstacles are generatedObject, and stored.
Wherein, virtual obstacles parameter includes forming the vertex of several virtual obstacles profiles, by successively by each topPoint connects generation virtual obstacles.
Step S1023: optimizing virtual obstacles, specifically:
The shape for optimizing virtual obstacles fills up virtual obstacles edge notches width less than the current diameter of robot automaticallySunk area.
Specifically, if the edge of virtual obstacles has the region of recess, and the width of recess is less than the passage of robotDiameter then fills up the region of recess automatically, it is made to become an entirety with virtual obstacles.
Neighborhood classification is carried out to virtual obstacles, interval is less than the virtual obstacles merger of the current diameter of robot oneIt rises;It specifically includes:
If the spacing between two virtual obstacles is less than the passage diameter of robot, it is merged into a virtual obstaclesObject;If the spacing between virtual obstacles and other adjacent virtual obstacles after merging is less than the passage diameter of robot,Then continue to merge into a virtual obstacles, until the spacing between any two adjacent virtual obstacles is greater than the passage of robotUntil diameter.
By optimize virtual obstacles, when preventing robot ambulation due to interval too it is small cause robot part body intoEnter virtual obstacles object area, the problem of virtual obstacles avoidance failure occurs.
Step S1024: virtual obstacles are added on initial map, generate virtual limitation map.
A kind of virtual barrier-avoiding method provided in this embodiment, by being optimized to virtual obstacles: optimization virtual obstaclesWhen the shape of object and merging small spacing barrier, reduce operand when robot navigation, while preventing robot ambulation byIn be spaced it is too small cause robot part body to enter barrier region, there is the problem of avoidance failure.
Embodiment two
A kind of virtual obstacle avoidance apparatus, comprising: virtual obstacles module 10, for adding several virtual barriers on initial mapHinder object, generates virtual limitation map;The virtual obstacles module includes:
Virtual obstacles generation unit 11, the virtual obstacles parameter drawn on initial map for obtaining user are rawAt several virtual obstacles;
Virtual obstacles optimize unit 12 and fill up virtual obstacles automatically for optimizing the shape of the virtual obstaclesEdge notches width is less than the sunk area of the current diameter of robot;And/or return for carrying out neighborhood to the virtual obstaclesThe virtual obstacles that interval is less than the current diameter of robot are grouped together by class;
Virtual obstacles adding unit 13 is added to initial map for the virtual obstacles after optimizing, and generates virtualLimit map.
Specifically, the virtual obstacle avoidance apparatus of the present embodiment further include: practical obstacle object module 20 is practical for real time scanPractical obstacle object addition is entered in virtual limitation map, generates real-time map by barrier;
Barrier expands module 30, raw for equidistantly expanding outwardly to each barrier in real-time map by its profileAt real-time navigation map, the barrier includes virtual obstacles and practical obstacle object;
Obstacle avoidance module 40, for carrying out avoidance according to each barrier in real-time navigation map.
A kind of virtual obstacle avoidance apparatus provided in this embodiment, by being optimized to virtual obstacles: optimization virtual obstaclesThe shape of object and merge small spacing barrier, it is therefore prevented that when robot ambulation due to be spaced it is too small cause robot part body intoEnter barrier region, the problem of avoidance failure occurs.
Embodiment three
It will appreciated by the skilled person that all or part of the steps in the various methods of above-described embodiment can be withIt is completed by instructing, or relevant hardware is controlled by instruction to complete, which can store computer-readable deposits in oneIn storage media, and is loaded and executed by processor.
For this purpose, the embodiment of the present invention provides a kind of storage medium, wherein being stored with a plurality of instruction, which can be processedDevice is loaded, to execute the step in any human face target distance measuring method provided by the embodiment of the present invention.For example, this refers toOrder can execute following steps:
Several virtual obstacles are added on initial map, generate virtual limitation map;Specifically comprise the following steps:
The virtual obstacles parameter that user draws on initial map is obtained, several virtual obstacles are generated;
The virtual obstacles are optimized, are specifically included: optimizing the shape of the virtual obstacles, fill up empty automaticallyQuasi- barrier edge notches width is less than the sunk area of the current diameter of robot;And/or the virtual obstacles are carried out adjacentDomain is sorted out, and the virtual obstacles that interval is less than the current diameter of robot are grouped together;
Virtual obstacles after optimization are added on initial map, virtual limitation map is generated.
The specific implementation of above each operation can be found in the embodiment of front, and details are not described herein.
Wherein, which may include: read-only memory (ROM, Read Only Memory), random access memoryBody (RAM, Random Access Memory), disk or CD etc..
Example IV
The present embodiment provides a kind of robot, which includes virtual obstacle avoidance apparatus described in embodiment two as above.
The existing specific explanation of the specific structure embodiment two of virtual obstacle avoidance apparatus, details are not described herein.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to beforeStating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to precedingTechnical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And theseIt modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.