A kind of AGV air navigation aids based on kinect visions
Technical field
The present invention relates to a kind of AGV air navigation aids, more particularly to a kind of AGV air navigation aids based on kinect visions.
Background technology
Traditional manpower and semimechanized Factory Logistics mode is of high cost, efficiency is low, is unable to meet production automation and intelligence
The requirement of energyization.AGV (Automated Guided Vehicle) is used as a kind of novel intelligent logistics equipment, has high automatic
Change, high integration, high flexibility the features such as, can very quickly with all kinds of RS/AS entry/exits mouths, production line, assembly line, conveying
The combinations such as line, platform, shelf, setting;It can be realized a variety of different according to different requirements, with different combinations
Function;The logistics turnover period can be shortened to the maximum extent, the turnover consumption of material is reduced, realize supplied materials and processing, logistics and life
The flexible connecting of production, finished product and sale etc. improves the working efficiency of production system, has been widely used in storing in a warehouse to the maximum extent
In the industries such as industry, manufacturing industry.
In recent years, the development of electric business industry is irresistible, and logistics is the sector and its part and parcel, logistics sorting
Efficiency largely affect the development speed of industry.Traditional industry can be gradually substituted, and not catch up with the development of industry, machine
Device people is artificial to replace, and improves efficiency and accuracy, reduces the inexorable trend that cost is development.AGV materials-sorting systems are with greatly
The mobile robot of amount is loaded, carries courier packages, can greatly improve working efficiency.
The current automatic material flow sorting in China is main or against large-scale logistics sorting device, although with higher
Logistics sorting efficiency, but the enlargement of logistics sorting device just determines the enlargement of work-yard, thus greatly
Limit the scope of application of logistics sorting.The development of the automatic material flow sorting in China is mainly fitted also in the stage of enlargement
For bulk storage plant, the automatic material flow sorting that high-volume is wrapped up greatly is carried out.But nowadays, small packet, miniaturization logistics
The application range of sorting is but increasingly wider.
The present logistics sorting in China only has minority to realize automation, such as the logistics public affairs of some large enterprises or large size
Department just has the automatic material flow sorting warehouse of one's own large size.And only in these large-scale automatic material flow warehouses
Just there is the automatic material flow sorting device of profession to complete the automated sorting wrapped up logistics.
In most cases, the logistics sorting in China is all or by being accomplished manually.Goods typically to be sorted
After object reaches warehouse, the bar code on courier packages is scanned by logistics information input system, then in root by logistics staff
Logistics package it will classify one by one by heap according to logistics information, disposably by this pile when a pile quantity of goods is more
Goods handling is to corresponding depot area.But in the case that this it is total often due to the operation error of staff either
It is absent minded that cargo is caused to stack chaotic either cargo damage, may result in this way logistics sorting cargo damage rate and
Error rate greatly increases.
Traditional AGV navigation mode mainly uses electromagnetic navigation and optical guidance.Such navigation mode need to be on ground laying road
Diameter realizes motion control according to the deviation in AGV car bodies central axes and path, and flexibility is poor, and path change and expansion are difficult.
The positioning function of mobile robot be its navigation multiple fields in a most important function, and complete machine
The most basic link of people's navigation task.The accuracy and reliability of positioning directly determines that can mobile robot be correctly completed and leads
Boat function.Generally there are two types of mode --- relative positioning and absolute fixs for AGV positioning:Relative positioning, that is, AGV is determining initial bit
In the case of appearance, using internal sensors such as photoelectric encoder, accelerometers, the pose for calculating current time and last moment becomes
Change to update the relative pose between current state and original state.This is most popular AGV positioning methods.Which is short
There is higher positioning accuracy, but due to using incremental computations mode, position error is with move distance and time during distance is mobile
Increase will continue to accumulate, additional sensors need to be coordinated to eliminate error.Absolute fix, which refers to, in contrast utilizes external sensor
The absolute position for directly calculating AGV, is not present accumulated error, and can solve the problems, such as " kidnappings " of the AGV under non-autonomous movement.
Invention content
The shortcomings that it is an object of the invention to overcome the prior art and deficiency, provide a kind of AGV based on kinect visions
Air navigation aid, compared to the method that dress sensor (such as infrared sensor) carries out avoidance on traditional AGV, the method for the present invention passes through
Kinect visions carry out Global localization, know the ambient condition information of each AGV, can carry out reasonable effective intelligent barrier avoiding.
The purpose of the invention is achieved by the following technical solution:A kind of AGV air navigation aids based on kinect visions, step
It is as follows:
Step S1, walking path is preset for each AGV in AGV scopes of activities;
Step S2, the image of AGV scopes of activities is obtained in real time by being positioned over the kinect instrument above AGV scopes of activities;
Step S3, it is directed to the current frame image for the AGV scopes of activities that kinect instrument is got, according to the frame picture construction
Go out the two-dimensional map of corresponding A GV scopes of activities;
Meanwhile the current frame image of the AGV scopes of activities got for kinect instrument, current frame image is carried out first
Then the processing successively of gray processing and binaryzation extracts contour of object from the image after gray processing and binary conversion treatment, and
And filtering objects profile obtains AGV profiles, is finally obtained according to the two-dimensional map of the AGV scopes of activities constructed under the frame image
To the center-of-mass coordinate of each AGV profiles;
Step S4, according to the center-of-mass coordinate of each AGV profiles extracted in current frame image and previous frame image, with right
Each AGV profiles are into line trace;
Step S5, the every AGV profiles being directed in current frame image, according to the two-dimensional map built under current frame image
The center-of-mass coordinate of the AGV profiles is obtained, while obtaining the barycenter of the AGV profiles according to the two-dimensional map built under previous frame image
Then coordinate calculates the slope of the AGV profiles to wander off, judge whether the slope is more than certain value, if so, control should
AGV carries out the amendment of current run trace;
Meanwhile the barycenter that each AGV profiles in current frame image are obtained according to the two-dimensional map built under current frame image is sat
Mark, according to the center-of-mass coordinate of each AGV profiles and the walking path of each AGV, judges that each position is next in AGV scopes of activities
Whether the moment has multi-section AGV while reaching, if so, controlling each portion AGV successively passes through the position;It is taken turns simultaneously according to each AGV
The walking path of wide center-of-mass coordinate and each AGV, judges whether the distance between adjacent two AGV of same direction of travel are small
In certain value, if so, a control wherein AGV first stops walking;
Step S6, judge whether the current frame image for the AGV scopes of activities that kinect instrument is got is last frame image,
If it is not, then when kinect instrument gets the next frame image of AGV scopes of activities, step S3 is returned to;If so, terminating.
Preferably, in the step S3, the current frame image for the AGV scopes of activities that kinect instrument is got, root are directed to
The detailed process for going out the two-dimensional map of corresponding A GV scopes of activities according to the frame picture construction is as follows:
First against in the current frame image of AGV scopes of activities, according to the frame picture construction image coordinate (u, v), then
Image coordinate is converted into actual coordinate (x, y):
X=au;
Y=bv;
Wherein:
Wherein width is the width of the current frame image of AGV scopes of activities, and higth is the present frame figure of AGV scopes of activities
The length of picture, diatance_x are the developed width on AGV scopes of activities ground, and diatance_y is AGV scopes of activities ground
Physical length.
Preferably, in the step S3, for the current frame image for the AGV scopes of activities that kinect instrument is got, to this
Frame image carries out gray processing and the process of binary conversion treatment is as follows:
After the current frame image for the AGV scopes of activities that kinect instrument is got, it is directed to the frame image and creates a mat
Form picture src by image gray processing and is stored in newly-built mat pictures src then by cvtColor () function;Most
Suitable threshold values is selected by Threshold () function again afterwards, the gray value of the picture src pixels of gray processing is set
It is set to 0 or 255;
The formula of wherein cvtColor () function is as follows:
Gray=0.299R+0.587G+0.114B;
Wherein Gray is the gray value after image gray processing.
Preferably, in institute step S3, after extracting contour of object in the image after gray processing and binary conversion treatment, filtering
The process that contour of object obtains AGV profiles is as follows:
It is directed to each contour of object extracted in image, judges whether the contour of object meets the following conditions:Length
More than first threshold g, and width is more than second threshold h;
If so, judging the contour of object for the AGV profiles in image;
If it is not, then judging the contour of object not for the AGV profiles in image, the contour of object is removed.
Preferably, in the step S4, according to each AGV profiles extracted in current frame image and previous frame image
Center-of-mass coordinate, it is specific as follows to the process of each AGV profiles into line trace:
The distance that each AGV passes by between two field pictures default first is S;
When kinect instrument gets the present image of AGV scopes of activities, every AGV for being directed in current frame image
AGV profiles with the distance between the AGV profiles less than S in previous frame image are regarded as the AGV profiles by profile;If upper one
It is not less than the AGV profiles of S in frame image with the distance between the AGV profiles, then using the AGV profiles as AGV scopes of activities
The new AGV of interior appearance;
The distance between AGV profiles and AGV profiles in current frame image are s wherein in previous frame image:
Coordinate in the two-dimensional map that wherein (x ", y ") builds for the barycenter of certain AGV profile under previous frame image, (x ',
Y ') be the AGV profiles the two-dimensional map that is built under current frame image of barycenter in coordinate.
Further, the S is 6cm.
Preferably, in the step 5, the slope k to wander off for calculating AGV profiles is:
Coordinate in the two-dimensional map that wherein (x2, y2) builds for the barycenter of certain AGV profile under current frame image, (x1,
Y1) the coordinate in the two-dimensional map built under previous frame image for the barycenter of the AGV profiles.
Further, when judging that the slope k of AGV profiles to wander off is more than certain value 0.17, then the AGV is controlled certainly
The dynamic amendment for carrying out run trace.
Preferably, certain value e is 10cm.
Preferably, in the step S1, the walking path of each AGV in AGV scopes of activities is preset by host computer,
The walking path of AGV includes starting point, corner point and target point, and each AGV again returns to starting after reaching target point by starting point
Point;The starting point of each AGV in wherein same AGV scopes of activities is identical;When to receive host computer preset by the AGV in starting point
After walking path information and goods information received success, is moved to target point according to default walking path, reach target point
After unloading, starting point is returned to from target point followed by according to default walking path.
The present invention has the following advantages and effects with respect to the prior art:
(1) a kind of AGV air navigation aids based on kinect visions of the present invention, it is pre- for each AGV in AGV scopes of activities first
If walking path;When the AGV in AGV scopes of activities starts sorting work, by being positioned over above AGV scopes of activities
Kinect instrument obtains the image of AGV scopes of activities in real time, and is constructed in real time according to the image of the AGV scopes of activities got
The two-dimensional map of AGV scopes of activities;The AGV profiles of every frame image of the AGV scopes of activities got by kinect instrument are to each
AGV is tracked.Wherein, when kinect instrument gets the current frame image of AGV scopes of activities, by current frame image and
Previous frame image calculates the slope that each AGV profiles wander off, and the current walking rail to AGV is determined whether to by the slope to wander off
Mark is modified;In addition when kinect instrument gets the current frame image of AGV scopes of activities, by calculating identical walking side
To the distance between adjacent two AGV determine whether to the walking of control AGV, while by judging in AGV scopes of activities often
Whether one position has the walking that multi-section AGV while reaching controls each AGV in subsequent time;From the foregoing, it can be seen that the method for the present invention
Global localization is carried out by Kinect visions, knows the ambient condition information of each AGV, compared to dress sensor (ratio on traditional AGV
Such as infrared sensor) method that carries out avoidance, reasonable effective intelligent barrier avoiding can be carried out.
(2) the present invention is based on the AGV activity models in the AGV air navigation aids of kinect visions, got for kinect instrument
The every frame image enclosed first carries out the frame image processing successively of gray processing and binaryzation, then from gray processing and binaryzation
Contour of object is extracted in treated image;The present invention extracts object wheel by the image after gray processing and binary conversion treatment
AGV and its ambient enviroment effectively can be distinguished obviously, be facilitated and carry out feature extraction to AGV profiles in next step by exterior feature.
Description of the drawings
Fig. 1 is the AGV air navigation aid flow charts the present invention is based on kinect visions.
Fig. 2 is the walking flow chart of each AGV in the method for the present invention.
Fig. 3 is that kinect instrument is positioned over the schematic diagram above AGV scopes of activities in the method for the present invention.
Fig. 4 is walking path schematic diagrames of each AGV in two-dimensional map in the method for the present invention.
Specific implementation mode
Present invention will now be described in further detail with reference to the embodiments and the accompanying drawings, but embodiments of the present invention are unlimited
In this.
The invention discloses a kind of AGV air navigation aids based on kinect visions for embodiment, as shown in Figure 1, steps are as follows:
Step S1, walking path is preset for each AGV in AGV scopes of activities;Wherein, in the present embodiment, by host computer
The walking path of each AGV in AGV scopes of activities is preset, the walking path of AGV includes starting point, corner point and target
Point;As shown in Figure 2, each AGV again returns to starting point after reaching target point by starting point, wherein in same AGV scopes of activities
Each AGV starting point it is identical;When the AGV in starting point receives the default walking path information of host computer transmission and cargo letter
It after ceasing received success, is moved to target point according to default walking path, after reaching target point unloading, followed by according to default
Walking path returns to starting point from target point.Wherein AGV can receive the walking path of host computer by wifi communication modules
Information and goods information.
Step S2, when the AGV in AGV scopes of activities starts sorting work, by being positioned over above AGV scopes of activities
Kinect instrument obtains the image of AGV scopes of activities in real time, and sends host computer to;As shown in figure 3, being positioned over for kinect instrument
Schematic diagram above AGV scopes of activities, wherein in the present embodiment, kinect placing heights are related with its vision coverage rate, best
It is the scope of activities for just covering AGV.
Step S3, it is directed to the current frame image for the AGV scopes of activities that kinect instrument is got, according to the frame picture construction
Go out the two-dimensional map of corresponding A GV scopes of activities;In the present embodiment, host computer is in the AGV activities for receiving the transmission of kinect instrument
After the current frame image of range, the two-dimensional map that AGV scopes of activities are carried out according to the frame image is built, specially:First against
In the present frame RGB image of AGV scopes of activities, image coordinate (u, v) is built according to the frame RGB image, then by image coordinate
It is converted into actual coordinate (x, y):
X=au;
Y=bv;
Wherein:
Wherein width is the width of the current frame image of AGV scopes of activities, and higth is the present frame figure of AGV scopes of activities
The length of picture, diatance_x are the developed width on AGV scopes of activities ground, and diatance_y is AGV scopes of activities ground
Physical length.It is wherein illustrated in figure 4 default walking path schematic diagrames of 6 AGV in two-dimensional map, 6 AGV are respectively
One AGV, the 2nd AGV, the 3rd AGV, the 4th AGV, the 5th AGV and the 6th AGV, each arrow direction are the direction of travel of each AGV,
Wherein the first AGV runs to first object point 2-1 since starting point 1, is then back to starting point from first object point 2-1 again
1;2nd AGV runs to the second target point 2-2 since starting point 1, is then back to starting point 1 from the second target point 2-1 again,
3rd AGV runs to third target point 2-3 since starting point 1, is then back to starting point 1 from third target point 2-3 again, the
Four AGV run to the 4th target point 2-4 since starting point 1, are then back to starting point 1 from the 4th target point 2-4 again, and the 5th
AGV runs to the 5th target point 2-5 since starting point 1, is then back to starting point 1 from the 5th target point 2-5 again, and the 6th
AGV runs to the 6th target point 2-6 since starting point 1, is then back to starting point 1 from the 6th target point 2-6 again.
Meanwhile the current frame image of the AGV scopes of activities got for kinect instrument, current frame image is carried out first
Then the processing successively of gray processing and binaryzation extracts contour of object from the image after gray processing and binary conversion treatment, and
And filtering objects profile obtains AGV profiles, is finally obtained according to the two-dimensional map of the AGV scopes of activities constructed under the frame image
To the center-of-mass coordinate of each AGV profiles;
Wherein in the present embodiment, the current frame image of the AGV scopes of activities got for kinect instrument, to the frame figure
As the process for carrying out gray processing and binary conversion treatment is as follows:
After the present frame RGB image for the AGV scopes of activities that kinect instrument is got, it is newly-built to be directed to the frame RGB image
One mat form picture src by RGB image gray processing and is stored in newly-built mat figures then by cvtColor () function
In piece src;Suitable threshold values is finally selected by Threshold () function again, by the picture src pixels of gray processing
Gray value be set as 0 or 255;The formula of wherein above-mentioned cvtColor () function is as follows:
Gray=0.299R+0.587G+0.114B;
Wherein Gray is the gray value after RGB image gray processing.
Wherein in the present embodiment, in above-mentioned steps, object is extracted from the image after gray processing and binary conversion treatment
After profile, the process that filtering objects profile obtains AGV profiles is as follows:It is directed to each contour of object extracted in image, is sentenced
Whether the disconnected contour of object meets the following conditions:Length is more than first threshold g, and width is more than second threshold h;If so, sentencing
The fixed contour of object is the AGV profiles in image;If it is not, then judging the contour of object not for the AGV profiles in image, removal should
Contour of object.The value of wherein above-mentioned first threshold g and second threshold h is set according to the length and width of practical AGV.
Step S4, according to the center-of-mass coordinate of each AGV profiles extracted in current frame image and previous frame image, with right
Each AGV profiles are into line trace;Specially:
The distance that each AGV passes by between two field pictures default first is S;In the present embodiment, S 6cm.Whenever kinect
When instrument gets the current frame image of AGV scopes of activities, the every AGV profiles being directed in current frame image, by previous frame figure
AGV profiles with the distance between the AGV profiles less than S as in regard as the AGV profiles;If current frame image is kinect instrument
The first frame image of the AGV scopes of activities got is then directly marked each AGV profiles;
The distance between AGV profiles and AGV profiles in current frame image are s wherein in previous frame image:
Coordinate in the two-dimensional map that wherein (x ", y ") builds for the barycenter of certain AGV profile under previous frame image, (x ',
Y ') be the AGV profiles the two-dimensional map that is built under current frame image of barycenter in coordinate.
It in this step, will if not being less than the AGV profiles of S in previous frame image with the distance between the AGV profiles
The AGV profiles are as the new AGV occurred in AGV scopes of activities.
Step S5, the every AGV profiles being directed in current frame image, according to the two-dimensional map built under current frame image
The center-of-mass coordinate of the AGV profiles is obtained, while obtaining the barycenter of the AGV profiles according to the two-dimensional map built under previous frame image
Then coordinate calculates the slope of the AGV profiles to wander off, judge whether the slope of the AGV profiles to wander off is more than certain value,
If so, the amendment that the AGV carries out current run trace is controlled, if it is not, being then not necessarily to carry out the AGV amendment of run trace;
In the present embodiment, every AGV needs to carry out according to above method in the mode walking process of such as Fig. 2 in AGV scopes of activities
The amendment of run trace.
Wherein, in the present embodiment, the slope k of AGV profiles to wander off is:
Coordinate in the two-dimensional map that wherein (x2, y2) builds for the barycenter of certain AGV profile under current frame image, (x1,
Y1) the coordinate in the two-dimensional map built under previous frame image for the barycenter of the AGV profiles.In the present embodiment, judging should
Whether the slope of AGV profiles to wander off is more than certain value 0.17, if so, controlling the amendment that the AGV carries out current run trace.
Meanwhile the barycenter that each AGV profiles in current frame image are obtained according to the two-dimensional map built under current frame image is sat
Mark, judges that each position is next in AGV scopes of activities according to the walking path of the center-of-mass coordinate of each AGV profiles and each AGV
Whether the moment has multi-section AGV while reaching, if so, controlling each portion AGV successively passes through the position;Meanwhile it being taken turns according to each AGV
The walking path of wide center-of-mass coordinate and each AGV, judges whether the distance between adjacent two AGV of same direction of travel are small
In certain value e, if so, a control wherein AGV first stops walking, until the distance between two AGV are more than certain value e;
Certain value e can be set as 10cm in embodiment.In the present embodiment, in AGV scopes of activities every AGV in the side of such as Fig. 2
It in formula walking process, needs to be executed according to above method, to realize multi-section AGV collaborations and avoidance.
Step S6, judge whether the current frame image for the AGV scopes of activities that kinect instrument is got is last frame image,
If it is not, then when kinect instrument gets the next frame image of AGV scopes of activities, step S3 is returned to;If so, terminating.
The above embodiment is a preferred embodiment of the present invention, but embodiments of the present invention are not by above-described embodiment
Limitation, it is other it is any without departing from the spirit and principles of the present invention made by changes, modifications, substitutions, combinations, simplifications,
Equivalent substitute mode is should be, is included within the scope of the present invention.