Summary of the invention
In order to address the above problem, of the present invention a kind of buttress type generation method is provided, to satisfy the demand of the high box-shaped stacks of goods type of user's equity, make things convenient for the user to convert self-defining buttress type into working document, the position and the attitude of indicating the robot palletizer goods to put.
A kind of buttress type generation method that is used for transfer robot of the present invention, accomplish through following step:
Step 1: generate buttress type document;
The user imports self-defining buttress type data, comprises that the length and width of pallet are high, length and width height, weight and model, the buttress type number of plies, parity switch and level number, layer goods number and layer goods information of goods; Layer goods information comprise said layer goods information comprise the goods number, each vertex number of bottom surface of each goods, with the angle of rotation under the pallet coordinate and each apex coordinate of bottom surface; The goods information of all goods is stored as corresponding XML buttress type document or text buttress type document, sends to upper computer.
Step 2: resolve buttress type document through upper computer, and judge whether any two box goods bottom surfaces overlap, disturb;
A, set up new system of axes with box goods A bottom surface four edges;
Make four summits of rectangle, box goods A bottom surface be respectively a, b, c, d, then four edges is respectively ab, bc, cd and ad, and wherein ab is limit, the wide place of goods, and bc is limit, the long place of goods; As new coordinate origin O, set up new system of axes O (x, y) with two adjacent edge ab of any box goods A bottom surface in the buttress type, bc intersection point b; Box goods A bottom surface limit ab is dropped on on the x axle positive dirction, and bc drops on the y axle positive dirction, and box goods A bottom surface All Ranges is dropped in the first quartile of new system of axes.
The coordinate on B, four summits under new system of axes, acquisition box goods B bottom surface;
Coordinate (x according to i summit of any box goods B bottom surface of importing in the buttress type data
i, y
i), through formula:
Obtain the coordinate of box goods B bottom surface on new following four summits of system of axes O (x, y); In the formula; N is the anglec of rotation of box goods B bottom surface under new system of axes O (x, y), deducts the angle of rotation of A under the pallet coordinate through B at the angle of rotation under the pallet coordinate and obtains.
C, judge between box goods A and box goods B whether superpose, interfere;
1., new system of axes zone division;
Four sides in box goods A bottom surface under the new system of axes are extended; Thus plane, new system of axes place is divided into 9 zones; This moment, box goods A bottom surface was the central area; Making it is zone 4, then makes by regional 4 lower lefts zone beginning conter clockwise and is respectively area 0,1,2,5,6,7,8,3 around each zone in zone 4, and mark is carried out in the position of box goods B bottom surface each point under new system of axes.
2., the absolute interference judged between box goods A and box goods B;
If summit, box goods B bottom surface is arranged in 4 or two summits, zone and lays respectively at zone 3 and 5, regional 7 and 1 or four summits and lay respectively at area 0,2,6, at 8 o'clock; Then rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data.
3. special interference is judged between box goods A and box goods B;
If area 0,3,6,7,8 is dropped on four summits in the box goods B bottom surface; Then box goods B bottom surface slope is that two limits and the y axle intersection point ordinate of positive number is during less than the length of box goods A bottom surface limit ab; Rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data.
If four summits are dropped on area 0,1,2,5, at 8 o'clock in the box goods B bottom surface; Then box goods B bottom surface slope is that two limits and the x axle intersection point ordinate of positive number is during less than the length of box goods A bottom surface limit bc; Rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data.
If the zone was dropped at 2,5,6,7,8 o'clock in four summits in the box goods B bottom surface; Then box goods B bottom surface slope is that two limits and x axle intersection point horizontal stroke or the ordinate of positive number is during less than the length of box goods A bottom surface limit bc or ab; Rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data.
When if four summits are dropped in the area 0,1,2,3,6 in the box goods B bottom surface; Then box goods B bottom surface slope is that the ordinate of two limits and y axle intersection point of negative was greater than 0 o'clock; Then rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data.
Step 3: box goods A and goods B are carried out adjacent detection;
Respectively 4 limits of box goods A and box goods B bottom surface are judged that each other making limit, box goods A bottom surface is L1, limit, box goods B bottom surface is L2, and then if L2 has an end points in L1, then box goods A is adjacent with box goods B; If L1 has an end points to overlap with L2, if two other end points in coincide point together on one side, then box goods A is adjacent with box goods B; If L1 is in L2, then box goods A is adjacent with box goods B.
Step 4: box goods except that box goods A and box goods B and the interference between goods A are judged;
When box goods A and box goods B do not interfere; If the direction of pointing to the limit L2 in bottom surface along box goods B bottom center is away from box goods A; And the extended line of this limit L2 and box goods A bottom surface rectangle are non-intersect; Then if the limit L2 of limit L3 in box goods C bottom surface and box goods B is adjacent, then box goods C and box goods A do not interfere, and adjacent with the limit L2 of C thus box goods does not all interfere with A.
The invention has the advantages that:
1, buttress type generation method of the present invention, it is adjacent to judge fast whether two big or small box freight holds of any anglec of rotation and any bottom surface take place, and leaves mutually, comprises, and interferes relation;
2, buttress type generation method of the present invention is judged simply, can judge two relations between the rectangle fast;
3, buttress type generation method of the present invention can be extracted the neighbouring relations between the two box goods, and then reduces the number of times of judging;
4, buttress type generation method of the present invention when carrying out any two box goods neighbouring relations, can be stored the neighbouring relations between rectangle, thereby reduces the number of times of judging, improves the efficient of algorithm;
5, buttress type generation method of the present invention for piling work lays the foundation, makes the mutual interference of having avoided freight hold in the piling process, causes the piling failure, cargo damage.
The specific embodiment
Come the present invention is further specified below in conjunction with accompanying drawing.
A kind of buttress type generation method that is used for transfer robot of the present invention, as shown in Figure 1, accomplish through following step:
Step 1: generate buttress type document;
The user imports self-defining buttress type data, comprises pallet information (length and width of pallet are high), goods overall information (length and width height, weight and the model of goods), buttress type attribute (the buttress type number of plies, parity switch) and layer goods information (level number, layer goods number); As shown in Figure 2; Wherein, The input of layer goods information comprises dual mode: first kind of mode is for the goods of importing each goods respectively number, each vertex number of bottom surface, with the coordinate on the angle of rotation under the pallet coordinate and one of them summit, bottom surface; Through apex coordinate of each goods angle of rotation and bottom surface of input, just can obtain each each apex coordinate of goods bottom surface thus, obtain the goods information of all goods thus.Another kind of mode is: as shown in Figure 3; With the method in the mode one confirm a goods goods number, each vertex number of bottom surface, with the coordinate on each summit, bottom surface; This goods is as the benchmark goods; Import the goods information of adjacent goods B with the benchmark goods subsequently; Be specially: the goods of the goods of input reference goods number, directed edge and adjacent goods B number, each vertex number of bottom surface, deviant, angle of rotation, obtain the coordinate on each summit, goods B bottom surface thus, realize the goods information input of goods B.Thus goods B is repeated the goods information input of said process realization and the adjacent goods of benchmark goods as the benchmark goods, thereby obtain the goods information of all goods.The goods information of all goods is stored as corresponding XML buttress type document or text buttress type document, sends to upper computer.
Step 2: resolve buttress type document through upper computer, and judge buttress type data reasonableness (being whether any two box goods bottom surfaces overlap, disturb);
A, set up new system of axes with box goods A bottom surface four edges;
Make four summits of rectangle, box goods A bottom surface be respectively a, b, c, d, then four edges is respectively ab, bc, cd and ad, and wherein ab is limit, the wide place of goods, and bc is limit, the long place of goods; As new coordinate origin O, set up new system of axes O (x, y) with two adjacent edge ab of any box goods A bottom surface in the buttress type, bc intersection point b; Box goods A bottom surface limit ab is dropped on on the x axle positive dirction, and bc drops on the y axle positive dirction, and box goods A bottom surface All Ranges is dropped in the first quartile of new system of axes, and is as shown in Figure 4.
The coordinate on B, four summits under new system of axes, acquisition box goods B bottom surface;
Coordinate (x according to i summit of any box goods B bottom surface of importing in the buttress type data
i, y
i), through formula:
Obtain the coordinate of box goods B bottom surface on new following four summits of system of axes O (x, y); In the formula; N is the anglec of rotation of box goods B bottom surface under new system of axes O (x, y), deducts the angle of rotation of A under the pallet coordinate through B at the angle of rotation under the pallet coordinate and obtains.Make 4 summits of box goods B be respectively a ', b ', c', d', then four apex coordinates in box goods B bottom surface are respectively P
A '(x
1', y
1'), P
B '(x
2', y
2'), P
C'(x
3, y
3), P
D'(x
4, y
4).
C, judge between box goods A and box goods B whether superpose, interfere;
1., new system of axes zone division;
Four sides in box goods A bottom surface under the new system of axes are extended; Thus plane, new system of axes place is divided into 9 zones; This moment, box goods A bottom surface was the central area, and making it is zone 4, then made by zone, regional 4 lower lefts (zone of new system of axes the 3rd quadrant) beginning conter clockwise and was respectively area 0,1,2,5,6,7,8,3 around each zone in zone 4; As shown in Figure 5, and the position of box goods B bottom surface each point under new system of axes carried out mark.Declare one 16 integer variable H, I zone of its I bit representation, wherein, I is 0 to 8.If any summit, box goods B bottom surface is dropped in the area I, then this summit corresponding flag bit in H is changed to 1, that is:
H=H|(0x01<<I)
2., the absolute interference judged between box goods A and box goods B;
If summit, box goods B bottom surface is arranged in 4 or two summits, zone and lays respectively at zone 3 and 5, regional 7 and 1 or four summits and lay respectively at area 0,2,6, at 8 o'clock; Then rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data; As shown in Figure 6, above-mentioned situation, through following formula, the cooresponding functional value of judgement H can be realized:
f(H)=(H&0x28-0x28)&&H&0x82-0x82)&&(H&0x10-0x10)&&(H&0x145-0x145)
As f (H)=0, then interfere between box goods A and box goods B.0x28 representes that box goods B bottom surface drops on 3,5 zones in the formula; 0x82 representes that box goods B bottom surface drops on 1,7 zones, 0x10 and represent that box goods B bottom surface drops on 4 districts, 0x145 and represent that box goods B bottom surface drops on 0,2,6,8 zones.
3. special interference is judged between box goods A and box goods B;
Shown in (a) among Fig. 7; If area 0,3,6,7,8 is dropped on four summits in the box goods B bottom surface; Then box goods B bottom surface slope is that two limits and the y axle intersection point ordinate of positive number is during less than the length of box goods A bottom surface limit ab; Rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data;
Shown in (b) among Fig. 7; If four summits are dropped on area 0,1,2,5, at 8 o'clock in the box goods B bottom surface; Then box goods B bottom surface slope is that two limits and the x axle intersection point ordinate of positive number is during less than the length of box goods A bottom surface limit bc; Rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data;
Shown in (c) among Fig. 7; If the zone was dropped at 2,5,6,7,8 o'clock in four summits in the box goods B bottom surface; Then box goods B bottom surface slope is that two limits and x axle intersection point horizontal stroke or the ordinate of positive number is during less than the length of box goods A bottom surface limit bc or ab; Rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data;
Shown in (d) among Fig. 7; When if four summits are dropped in the area 0,1,2,3,6 in the box goods B bottom surface; Then box goods B bottom surface slope is that the ordinate of two limits and y axle intersection point of negative was greater than 0 o'clock; Then rectangular loads B and rectangular loads A interfere, and then return step 1 and re-enter buttress type data.
Above-mentioned judgement can realize through following manner:
Make function U (M, N, k)=(y2-y1) (k-x1)/(x2-x1)+y1, wherein, M (x1, x2) and N (x2, y2) are respectively the coordinate of limit a'b' or c'd' two-end-point a ', b ' or c ', d '.
Because the limit of box goods A and box goods B bottom surface all is not parallel to each other, then:
Make function D (M, N, k
1, k
2)=U (M, N, k
1)-k
2
When area 0,3,6,7,8 or 0,1,2,5,8 zones are dropped in box goods B bottom surface, if D (P
A', P
B', 0, width)<0 and U (P
D', P
C', length)>0 o'clock, then box goods A and box goods B interfered, otherwise got into step 3;
When area 0,1,2,3,6 or zone 3,5,6,7,8 time, if D (P is dropped in box goods B bottom surface
A', P
D', length, width)<0, U (P
B', P
C', 0)>0, establishment simultaneously then interferes, otherwise gets into step 3;
k
1, k
2Be the one dimension variable, value is width (width), the length (length) or 0 of rectangular loads B.
Step 3: box goods A and goods B are carried out adjacent detection;
Judge rectangle A, whether B is adjacent, and key is to see a certain the limit conllinear of a certain limit there being rectangle A and rectangle B and the overlapping region is arranged.If exist, rectangle A then is described, B is adjacent.So judge the mutually non-conterminous problem of rectangle, can change into and judge two line segments whether conllinear and overlapping problem.The present invention judges 4 limits of box goods A and box goods B bottom surface respectively each other; As shown in Figure 8, making limit, box goods A bottom surface is L1, and limit, box goods B bottom surface is L2; Then if L2 has an end points in L1, then box goods A is adjacent with box goods B; If L1 has an end points to overlap with L2, if two other end points in coincide point together on one side, then box goods A is adjacent with box goods B; If L1 is in L2, then box goods A is adjacent with box goods B.Can realize through following formula:
Make that any two summits are p, q among the box goods A, any two summits are r, s among the box goods B; Then have:
Wherein, Pos (B, r), Pos (B s) representes box goods B bottom surface r, s apex coordinate respectively, Pos (A, p), (A q) representes box goods A bottom surface p, q apex coordinate respectively to Pos.
Can obtain neighbouring relations through following formula and judge unknown quantity λ
1, λ
2, then if λ
1λ
2<0 or 0<λ
1<1 or 0<λ
2<1 or λ
1λ
2=0, λ
1+ λ
2>0 expression box goods A is adjacent with box goods B.
Step 4: box goods except that box goods A and box goods B and the interference between goods A are judged;
When box goods A and box goods B do not interfere; If the direction of pointing to the limit L2 in bottom surface along box goods B bottom center is away from box goods A; And the extended line of this limit L2 and box goods A bottom surface rectangle are non-intersect, and then if the limit L2 of limit L3 in box goods C bottom surface and box goods B is adjacent, then box goods C and box goods A do not interfere; Adjacent with the limit L2 of C thus box goods does not all interfere with A, and is as shown in Figure 9.
Through above-mentioned buttress type generation method, can judge the arbitrarily relation of two box freight holds of size of any anglec of rotation fast, can detection plane on any two rectangles whether take place adjacently, leave mutually, comprise the negotiation relation.For piling work lays the foundation, make the mutual interference of having avoided freight hold in the piling process, cause the piling failure, cargo damage.