Summary of the invention
In order to achieve the above object, the invention provides a kind of based on crossing sail into roll away from track connect pairing algorithm, this algorithm uses a set of specific formula, obtains and sets up a kind of rational between track without all tracks and rolling away from route crossing, track sailing into, the connection relation information completed.
Related terms is explained:
1. without lane line crossing
Be generally region, intersection, in region, ground does not have the track in track, as Fig. 2
2. lane number
Along vehicle heading, to all tracks from the leftmost side of road from 1 open numbering, from left to right number consecutively, as Fig. 3.
3. narrow enter wide go out
In a travel direction, the number of track-lines sailing crossing into is less than the number of track-lines rolling crossing away from, be called narrow enter wide go out.
4. wide enter narrow go out
In a travel direction, the number of track-lines sailing crossing into is greater than the number of track-lines rolling crossing away from, be called wide enter narrow go out.
5. etc. to enter etc.
In a travel direction, the number of track-lines sailing crossing into equals the number of track-lines rolling crossing away from, to be called etc. to enter etc.
The technical solution used in the present invention is:
Sail the algorithm rolling track away from and connect pairing into without lane line crossing, to sail into without region, crossing, track and the track rolled away from without region, crossing, track for handling object, the annexation rolled away between track is sailed in foundation into, comprises the following steps:
Step one, acquisition is sailed into without lane line crossing and is rolled track quantity away from;
Step 2, according to sailing track quantity into and rolling interval, quantitative determination crossing, track away from for following three kinds:
(1) narrow enter wide go out
(2) wide enter narrow go out
Etc. (three) to enter etc.
Step 3, calculates one according to crossing classification and sails/roll away from track into and can connect the quantity rolling/sail into track away from, note D;
Step 4, calculates every bar and sails/roll away from the Article 1 lane number that track connects into;
Step 5, the connection Article 1 lane number that the connection track quantity of trying to achieve according to step 3 and step 4 are tried to achieve, obtains all connection tracks.
As preferably, described step 2 specifically comprises:
Step 201, if sailing number of track-lines into is N, rolling number of track-lines away from is M;
Step 202, if N>M, think wide enter narrow go out, if N<M, think narrow enter wide go out, if M=N, to think etc. to enter etc. and;
As preferably, described step 3 specifically comprises:
Step 301, if narrow enter wide artificial situation, then calculate and sail track required connection into and roll track quantity away from;
Step 302, if wide enter narrow artificial situation, then calculate and roll track required connection away from and sail track quantity into;
Step 303, if etc. the artificial situation such as to enter, then sail connection into and roll track quantity away from and be fixed as 1.
As preferably, described step 4 specifically comprises:
Step 401, if narrow enter wide artificial situation, then calculate sail into track connect the minimum lane number rolling track away from;
Step 402, if wide enter narrow artificial situation, then calculate roll away from track connect the minimum lane number of sailing track into;
Step 403, if etc. the artificial situation such as to enter, sail into and connect that to sail the numbering rolling track away from into identical.
As preferably, described step 5 is specially Smallest connection lane number cumulative D time successively, generate all needed for connection track.
As preferably, this algorithm comprises two principle: the annexation 1) set up in crossing is not intersected mutually; 2) ensure that sailing to all possibilities rolled away from into connects.
Compared with prior art, the invention has the beneficial effects as follows:
1, can guarantee anyly in crossing to sail or roll away from track into and to be all associated relation.
2, ensure that from sailing crossing into the feasibility rolling crossing all tracks connection away from.
3, the annexation set up, avoids cross one another phenomenon, ensure that the security of path planning.
4, ensure that every bar sails that track connects into roll track quantity away from consistent, ensure that the balance of annexation.
Embodiment
Below in conjunction with drawings and Examples, the invention will be further described.
As shown in Figure 1, implementation of the present invention, comprises the following steps after start-up:
1) obtain and sail/roll away from track quantity into without lane line crossing, remember that sailing track quantity into is N, rolling track quantity away from is M.
2) according to the magnitude relationship of N, M, calculate every bar and sail the linking number rolling away from and need between track to set up into, linking number symbol is designated as D.
2.1) when N is less than M, for narrow enter wide artificial situation, calculate sail track into rolling the linking number set up required for track away from.Specific algorithm:
D=((M-1)/N)+1
2.2) when N is greater than M, for wide enter narrow artificial situation, calculate roll track away to sailing the linking number set up required for track into.Specific algorithm:
D=((N-1)/M)+1
2.3) N equals the first D=1 of situation of M
3) according to the magnitude relationship of N, M, calculate and sail/roll away from the connected lowest number rolling/sail into track away from into, lowest number symbol is Ps.
3.1) when N is less than M, for narrow enter wide artificial situation, calculate sail into track connect the lowest number rolling track away from.If sailing lane number into current is Pt specific algorithm:
Ps=((Pt-1)*(M/N))+1
3.2) N is greater than in M when, for wide enter narrow artificial situation, calculate roll away from track connect the lowest number of sailing track into.If rolling track label away from current is Pt specific algorithm:
Ps=((Pt-1)*(N/M))+1
3.3) N equals the first Ps=Pt of situation of M
4) D calculated according to the 2nd step, and the 3rd Ps calculated, can obtain sail into/roll away from track connect the sequence rolling/sail into track away from.Suppose narrow enter wide go out occasion, certain enter track to connect the lowest number rolling track away from be Ps, then this enters track and connects and roll lane number sequence away from and be: Ps, Ps+1, Ps+2 ... Ps+D-1}
Example:
Narrow enter narrow go out occasion, as Fig. 5 (a)
N=2;M=4
D=[(M-1)/N]+1=1+1=2
Article 1, sail Ps=((1-1) * (4/2))+1=1 in track into
What then Article 1 sailed that track connects into rolls lane number away from virtual is { 1,2}
Article 2 sails Ps=((2-1) * (4/2))+1=3 in track into
What then Article 2 sailed that track connects into rolls lane number away from virtual is { 3,4}
Narrow enter narrow go out occasion, as Fig. 5 (b)
N=4;M=2
D=[(N-1)/M]+1=1+1=2
Article 1, roll Ps=((1-1) * (4/2))+1=1 in track away from
What then Article 1 sailed that track connects into sails lane number into virtual is { 1,2}
Article 2 rolls Ps=((2-1) * (4/2))+1=3 in track away from
What then Article 2 sailed that track connects into sails lane number into virtual is { 3,4}
Occasion is gone out, as Fig. 5 (c) etc. to enter etc.
N=2;M=2
D=1
Article 1, sail track into roll track away from Article 1 and be connected
Article 2 is sailed track into and is rolled track away from Article 2 and be connected
The part do not set forth in instructions is prior art or common practise.The present embodiment only for illustration of this invention, and is not used in and limits the scope of the invention, and the amendment such as the equivalent replacement that those skilled in the art make for the present invention is all thought to fall in this invention claims institute protection domain.