Disclosure of Invention
The embodiment of the invention provides a method and a device for determining relationship information between vehicles, electronic equipment and a computer readable storage medium, and aims to solve the problem that a relative relationship determination mode between vehicles in the prior art is difficult to process.
In a first aspect, an embodiment of the present invention provides a method for determining relationship information between vehicles, where the method includes:
acquiring first course information and first position information of a first vehicle, and acquiring second course information and second position information of a second vehicle;
determining orientation information of the second vehicle relative to the first vehicle according to the first position information and the second position information;
determining the position relation of the second vehicle relative to the first vehicle according to the first course information and the azimuth information;
and determining the running relation of the second vehicle relative to the first vehicle according to the first course information, the second course information and the position relation.
In the above solution, the step of determining the position relationship of the second vehicle with respect to the first vehicle according to the first heading information and the direction information includes:
determining target angle information corresponding to the first vehicle according to the first course information;
determining the position relation of the second vehicle relative to the first vehicle according to the target angle information and the azimuth information;
the target angle information is used for indicating a preset visual angle range in front of the first vehicle, the target angle information comprises a lower limit angle and an upper limit angle of the preset visual angle range, and reference lines of the lower limit angle and the upper limit angle are the same as reference lines of angles corresponding to the first course information.
In the foregoing aspect, the reference line of the angle corresponding to the azimuth information is the same as the reference line of the lower limit angle and the upper limit angle, and the step of determining the positional relationship of the second vehicle with respect to the first vehicle according to the target angle information and the azimuth information includes:
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is larger than a second angle and the orientation information corresponding angle is between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where a first angle is larger than a second angle and the orientation information corresponding angle is not between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where the first angle is smaller than a second angle and the orientation information corresponding angle is between the first angle and the second angle;
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is smaller than a second angle and the azimuth information corresponding angle is not between the first angle and the second angle;
wherein the first angle corresponds to the lower limit angle, the second angle corresponds to the upper limit angle, and both the first angle and the second angle are in an angle range of 0 to 2 pi.
In the above solution, the step of determining the driving relationship of the second vehicle with respect to the first vehicle according to the first heading information, the second heading information, and the position relationship includes:
according to the first course information and the second course information, determining angle information of the course of the first vehicle relative to the course of the second vehicle;
determining a travel relationship of the second vehicle with respect to the first vehicle based on the angle information and the positional relationship.
In the above aspect, the step of determining the travel relationship of the second vehicle with respect to the first vehicle based on the angle information and the positional relationship includes:
determining the running relationship as that the second vehicle and the first vehicle run in the same direction under the condition that the angle corresponding to the angle information is in a first quadrant or a fourth quadrant in a preset coordinate system;
determining the running relationship as that the second vehicle and the first vehicle run in opposite directions under the condition that the position relationship represents that the second vehicle is in front of the first vehicle and the angle corresponding to the angle information is in a second quadrant or a third quadrant in a preset coordinate system;
and determining the running relationship as that the second vehicle and the first vehicle run in the reverse direction under the condition that the position relationship represents that the second vehicle is behind the first vehicle and the corresponding angle of the angle information is in a second quadrant or a third quadrant in a preset coordinate system.
In a second aspect, an embodiment of the present invention provides an inter-vehicle relationship information determination apparatus, including:
the acquisition module is used for acquiring first course information and first position information of a first vehicle and acquiring second course information and second position information of a second vehicle;
a first determining module, configured to determine, according to the first location information and the second location information, orientation information of the second vehicle with respect to the first vehicle;
the second determining module is used for determining the position relation of the second vehicle relative to the first vehicle according to the first course information and the direction information;
and the third determining module is used for determining the running relation of the second vehicle relative to the first vehicle according to the first course information, the second course information and the position relation.
In the foregoing solution, the second determining module includes:
the first determining unit is used for determining target angle information corresponding to the first vehicle according to the first course information;
a second determination unit configured to determine a positional relationship of the second vehicle with respect to the first vehicle based on the target angle information and the azimuth information;
the target angle information is used for indicating a preset visual angle range in front of the first vehicle, the target angle information comprises a lower limit angle and an upper limit angle of the preset visual angle range, and reference lines of the lower limit angle and the upper limit angle are the same as reference lines of angles corresponding to the first course information.
In the foregoing solution, the reference line of the angle corresponding to the azimuth information is the same as the reference lines of the lower limit angle and the upper limit angle, and the second determining unit is specifically configured to:
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is larger than a second angle and the orientation information corresponding angle is between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where a first angle is larger than a second angle and the orientation information corresponding angle is not between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where the first angle is smaller than a second angle and the orientation information corresponding angle is between the first angle and the second angle;
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is smaller than a second angle and the azimuth information corresponding angle is not between the first angle and the second angle;
wherein the first angle corresponds to the lower limit angle, the second angle corresponds to the upper limit angle, and both the first angle and the second angle are in an angle range of 0 to 2 pi.
In the foregoing solution, the third determining module includes:
the third determining unit is used for determining the angle information of the course of the first vehicle relative to the course of the second vehicle according to the first course information and the second course information;
a fourth determination unit configured to determine a travel relationship of the second vehicle with respect to the first vehicle based on the angle information and the positional relationship.
In the foregoing solution, the fourth determining unit is specifically configured to:
determining the running relationship as that the second vehicle and the first vehicle run in the same direction under the condition that the angle corresponding to the angle information is in a first quadrant or a fourth quadrant in a preset coordinate system;
determining the running relationship as that the second vehicle and the first vehicle run in opposite directions under the condition that the position relationship represents that the second vehicle is in front of the first vehicle and the angle corresponding to the angle information is in a second quadrant or a third quadrant in a preset coordinate system;
and determining the running relationship as that the second vehicle and the first vehicle run in the reverse direction under the condition that the position relationship represents that the second vehicle is behind the first vehicle and the corresponding angle of the angle information is in a second quadrant or a third quadrant in a preset coordinate system.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and operable on the processor, where the computer program, when executed by the processor, implements the steps of the inter-vehicle relationship information determination method described above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing the steps of the above-mentioned inter-vehicle relationship information determination method.
In the embodiment of the invention, the first course information and the first position information of a first vehicle are obtained, and the second course information and the second position information of a second vehicle are obtained; determining orientation information of the second vehicle relative to the first vehicle according to the first position information and the second position information; determining the position relation of the second vehicle relative to the first vehicle according to the first course information and the direction information; and determining the running relation of the second vehicle relative to the first vehicle according to the first course information, the second course information and the position relation. Therefore, the relative position relation and the driving relation of the two vehicles can be determined directly according to the direction information of the two vehicles and the course information of each vehicle, so that the processing difficulty is reduced, and the processing speed is increased.
Detailed Description
In the background art, the existing method for determining the relative relationship between vehicles has the problem of high processing difficulty.
For example, in the related art, the receiver receives the first position coordinates transmitted by the first vehicle and the second position coordinates transmitted by the second vehicle through the vehicle-mounted communication terminal; the processor determines a reference line according to the first position coordinate and the second position coordinate, wherein the reference line passes through the first position coordinate or the second position coordinate; the processor determines a second included angle between the connecting line direction of the first vehicle and the second vehicle and the reference line according to the first position coordinate, the second position coordinate and a third position coordinate of the auxiliary point on the reference line; and the processor determines the relative position of the first vehicle and the second vehicle according to a first included angle and a second included angle between the lane direction and the reference line.
In the above scheme, in the process of determining the relative relationship between the vehicles, the reference line needs to be calibrated and the lane direction needs to be obtained, so that the processing difficulty is high.
Based on the above, the embodiment of the invention provides a new scheme for determining the relationship information between the vehicles.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
First, a method for determining relationship information between vehicles according to an embodiment of the present invention will be described.
It should be noted that the method for determining relationship information between vehicles provided by the embodiment of the present invention relates to the technical field of data processing, in particular to the technical field of vehicle data processing, and can be widely applied to a plurality of scenes such as vehicle automatic driving, assistant driving, traffic monitoring, and the like. The method may be executed by the inter-vehicle relationship information determination apparatus of the embodiment of the invention. The inter-vehicle relationship information determining apparatus may be configured in any electronic device to execute the inter-vehicle relationship information determining method, and the electronic device may be a server or a terminal, and is not particularly limited herein.
Referring to fig. 1, a schematic flow chart of a method for determining relationship information between vehicles according to an embodiment of the present invention is shown. As shown in fig. 1, the method may include the steps of:
step 101, acquiring first course information and first position information of a first vehicle, and acquiring second course information and second position information of a second vehicle.
Here, the first vehicle and the second vehicle may be two different vehicles, and a relative distance therebetween may be smaller than a preset threshold, and the preset threshold may be set according to an actual situation. For example, in a scenario such as automatic driving, attention is usually paid to the relative relationship between another vehicle at a relatively long distance and the host vehicle for the safety of automatic driving, and in this case, the preset threshold may be set to be relatively large.
When the method is applied to the first vehicle, the first vehicle can be called a self-vehicle, the second vehicle can be called a far vehicle, and the far vehicle represents vehicles which are located at a certain distance from the first vehicle and around the first vehicle. When the method is applied to a background server or other terminal devices (the other terminal devices are not characterized as terminal devices of a first vehicle and a second vehicle), any vehicle which can be monitored can be taken as the first vehicle, vehicles around the first vehicle can be taken as the second vehicle, and the relative relationship of the second vehicle relative to the first vehicle is determined when the relative relationship between the vehicles is monitored, and the relative relationship can assist and guide the driving of the first vehicle.
The first heading information may characterize an angle of a direction of travel of a nose of the first vehicle relative to a direction, which may be characterized by a heading angle of the first vehicle. The second heading information may characterize an angle of a direction of travel of a nose of the second vehicle relative to a direction, which may be characterized by a heading angle of the second vehicle. The heading angles of the first vehicle and the second vehicle may be angles with a true north direction or a magnetic north direction as a reference direction, and in the following description of the embodiments, the heading angles of the vehicles will be described in detail by taking the true north direction as an example.
The first location information may characterize the location of a point of the first vehicle, such as a center point, on the surface of the earth, which may be characterized by the location coordinates of the first vehicle. The second location information may characterize the location of a point of the second vehicle, such as a center point, on the surface of the earth, which may be characterized by the location coordinates of the second vehicle. The location coordinates of the vehicle may include longitude coordinates and latitude coordinates.
The vehicle heading information and the vehicle location information may be obtained in various manners, for example, a vehicle-mounted communication terminal may be mounted on each vehicle, and the vehicle heading information and the vehicle location information may be obtained through the mounted vehicle-mounted communication terminal.
For another example, the traffic scene image of the vehicle may be collected by the camera, and the heading information and the location information of each vehicle may be determined by using computer vision and deep learning techniques, and the specific details of determining the heading information and the location information of the vehicle based on the traffic scene image may refer to related techniques, which are not specifically described herein. The camera may be installed on the vehicle or on the roadside, and the camera may be monocular or binocular, and is not specifically limited herein.
In the step, the traffic scene images can be collected through the camera installed on the road side, and the course information and the position information of each vehicle are determined by using the computer vision and the deep learning technology, so that the information acquisition in the determination process of the relationship information between the vehicles does not depend on hardware such as a vehicle-mounted communication terminal, and the hardware requirement is effectively reduced.
And 102, determining the direction information of the second vehicle relative to the first vehicle according to the first position information and the second position information.
In this step, the azimuth information may be represented by an azimuth angle, which may be an angle using a certain preset direction as a reference line, and represents an angle of the second vehicle relative to the first vehicle, and the preset direction may be any direction
And (4) showing.
The azimuth may be determined from the latitude and longitude data of the first vehicle and the latitude and longitude data of the second vehicle. Specifically, taking a geocentric coordinate system such as the WGS-84 coordinate system as an example, referring to fig. 2, fig. 2 is a schematic diagram illustrating a principle of determining an azimuth angle between vehicles based on position information of the vehicles in the WGS-84 coordinate system, as shown in fig. 2, a point a represents a position of a first vehicle on the earth's surface, and a position coordinate thereof may be
And the point B represents the position of the second vehicle on the earth surface, and the position coordinate of the point B can be
Point C represents a point on the earth's surface in the true north direction, and O is the center of the sphere.
In points A, B and C, an angle which takes the point A as a vertex, namely ^ CAB, represents an angle which is included by an arc line LAB on the spherical surface at the point A, an angle which takes the point B as a vertex, namely ^ CBA, represents an angle which is included by the arc line on the spherical surface at the point B, and an angle which takes the point C as a vertex, namely ^ BCA, represents an angle which is included by the arc line on the spherical surface at the point C. And < CAB represents the azimuth angle of the second vehicle relative to the first vehicle.
The angles a, B and C respectively represent the angles between the connecting lines of the two end points of the arc pairs of the points A, B and C and the geocentric line, namely the radian of the arc pairs of the points A, B and C. Alternatively, the dihedral angles of the face AOC and the face BOC may be used
And (4) showing.
According to the trigonometric cosine theorem, based on the angles a, b, c and
the following relationship can be obtained, and is represented by the following formula (1).
While angles a, b and
can be obtained based on the following formulae (2), (3) and (4), respectively.
Finally, based on the above formulae (1), (2), (3) and (4), the following formula (5) can be obtained.
According to the trigonometric theorem
And sine theorem of spherical surface
The following formula (6) can be obtained.
And then the azimuth angle CAB can be obtained
This is represented by the following formula (7).
The azimuth angle is an angle determined by taking the true north direction as a reference line and according to the clockwise direction, and the angle range of the azimuth angle is 0-2 pi.
In this way, the direction information of the second vehicle relative to the first vehicle can be simply determined according to the first position information and the second position information without making a reference line, so that the calculation complexity can be reduced, and the direction information can be subsequently used for determining the position relation of the second vehicle relative to the first vehicle.
Step S103, determining the position relation of the second vehicle relative to the first vehicle according to the first course information and the direction information.
In this step, the positional relationship of the second vehicle with respect to the first vehicle may be a front-rear positional relationship, and the front-rear positional relationship may include two types, that is, the second vehicle is in front of the first vehicle and the second vehicle is behind the first vehicle.
The position relationship of the second vehicle relative to the first vehicle may be determined based on the first heading information and the orientation information. Specifically, a viewing angle range in front of the first vehicle may be determined according to the first heading information, where the viewing angle range represents an angle range of a vehicle in front of the first vehicle.
The viewing angle range may be a maximum viewing angle range in front of the first vehicle, and the maximum viewing angle range may refer to a viewing angle range that is deflected by 90 degrees (pi/2) counterclockwise and clockwise, respectively, with reference to the heading angle of the first vehicle, or may not be the maximum viewing angle range, that is, the viewing angle range that is deflected by a preset angle (the preset angle is smaller than 90 degrees) such as 80 degrees counterclockwise and clockwise, respectively, with reference to the heading angle of the first vehicle. In order to ensure the accuracy of the positional relationship determination, the viewing angle range may be a maximum viewing angle range.
And if the corresponding angle of the second vehicle relative to the first vehicle, namely the azimuth angle, is within the range of the visual angle in front of the first vehicle, determining that the second vehicle is in front of the first vehicle, and otherwise, determining that the second vehicle is behind the first vehicle.
For example, the heading angle of the first vehicle is 120 degrees, the viewing angle range in front of the first vehicle is 30 degrees to 210 degrees, when the azimuth angle of the second vehicle relative to the first vehicle is between 30 degrees and 210 degrees, the second vehicle is determined to be in front of the first vehicle, otherwise, the second vehicle is determined to be behind the first vehicle.
For another example, the heading angle of the first vehicle is 280 degrees, the angle range of the front view angle is 190 degrees to 370 degrees, and the angle range of the azimuth angle of the second vehicle relative to the first vehicle is 0 to 2 pi, i.e. 360 degrees, so the angle range of the front view angle needs to be converted into a range matching the angle range of the azimuth angle, i.e. 0 to 2 pi, and is converted into 190 degrees to 360 degrees and 0 to 10 degrees. When the azimuth angle of the second vehicle relative to the first vehicle is in either of the two angular ranges, then it is determined that the second vehicle is in front of the first vehicle, otherwise, the second vehicle is behind the first vehicle.
For example, the first vehicle has a heading angle of 60 degrees, and the forward view angle ranges from-30 degrees to 150 degrees, and the second vehicle has an azimuth angle range of 0 to 2 pi, i.e., 360 degrees, with respect to the first vehicle, so that the forward view angle range is converted to 0 to 2 pi, to 0 to 150 degrees, and to 330 degrees to 360 degrees. When the azimuth angle of the second vehicle relative to the first vehicle is in either of the two angular ranges, then it is determined that the second vehicle is in front of the first vehicle, otherwise, the second vehicle is behind the first vehicle.
In this step, the position relationship of the second vehicle with respect to the first vehicle can be directly determined according to the first heading information and the direction information without making a reference line and acquiring a lane direction, so that the processing difficulty can be reduced, and the processing speed can be increased.
And 104, determining the running relation of the second vehicle relative to the first vehicle according to the first course information, the second course information and the position relation.
In this step, the driving relationship of the second vehicle with respect to the first vehicle may include three types, which are a same-direction driving, a same-direction driving and a reverse-direction driving, the same-direction driving refers to the first vehicle and the second vehicle driving in the same direction, the opposite-direction driving refers to the first vehicle and the second vehicle driving close together face to face, and the reverse-direction driving refers to the first vehicle and the second vehicle driving in opposite directions, and during the driving, the distance between the first vehicle and the second vehicle increases, that is, the first vehicle and the second vehicle driving away from each other back to back.
The driving relationship of the second vehicle relative to the first vehicle can be determined according to the first course information, the second course information and the position relationship. Specifically, the angle information of the heading of the first vehicle relative to the heading of the second vehicle may be determined based on the first heading information and the second heading information, and the driving relationship of the second vehicle relative to the first vehicle may be determined based on the angle information and the position relationship.
For example, if the second vehicle is in front of the first vehicle, the second vehicle and the first vehicle travel in the same direction when cos (θ) >0, and the second vehicle and the first vehicle travel in opposite directions when cos (θ) < 0.
For another example, if the second vehicle is behind the first vehicle, the second vehicle and the first vehicle travel in the same direction when cos (θ) >0, and travel in the opposite direction when cos (θ) < 0.
And theta is an angle corresponding to the angle information of the heading of the first vehicle relative to the heading of the second vehicle.
In this step, the driving relationship of the second vehicle with respect to the first vehicle may be determined according to the first heading information, the second heading information, and the positional relationship, and thus, the determination of the driving relationship of the second vehicle with respect to the first vehicle may be achieved.
In the embodiment, the first course information and the first position information of the first vehicle are obtained, and the second course information and the second position information of the second vehicle are obtained; determining orientation information of the second vehicle relative to the first vehicle according to the first position information and the second position information; determining the position relation of the second vehicle relative to the first vehicle according to the first course information and the direction information; and determining the running relation of the second vehicle relative to the first vehicle according to the first course information, the second course information and the position relation. Therefore, the relative position relation and the driving relation of the two vehicles can be determined directly according to the direction information of the two vehicles and the course information of each vehicle, so that the processing difficulty is reduced, and the processing speed is increased.
Optionally, step S103 specifically includes:
determining target angle information corresponding to the first vehicle according to the first course information;
determining the position relation of the second vehicle relative to the first vehicle according to the target angle information and the azimuth information;
the target angle information is used for indicating a preset visual angle range in front of the first vehicle, the target angle information comprises a lower limit angle and an upper limit angle of the preset visual angle range, and reference lines of the lower limit angle and the upper limit angle are the same as reference lines of angles corresponding to the first course information.
In this embodiment, the target angle information may be used to indicate a preset viewing angle range in front of the first vehicle, where the preset viewing angle range may be a maximum viewing angle range in front of the first vehicle, that is, a viewing angle range that is 90 degrees, that is, pi/2, is respectively deflected counterclockwise and clockwise with reference to the heading angle of the first vehicle, or may not be the maximum viewing angle range, that is, a viewing angle range that is 80 degrees, which is respectively deflected counterclockwise and clockwise with reference to the heading angle of the first vehicle by a preset angle (the preset angle is smaller than 90 degrees). In order to ensure the accuracy of the determination of the position relationship, the preset viewing angle range may be a maximum viewing angle range.
The target angle information may include a lower limit angle and an upper limit angle of the preset viewing angle range, the lower limit angle and the upper limit angle being defined in a clockwise direction. For example, if the predetermined viewing angle range is from-30 degrees to 150 degrees, the lower limit angle is-30 degrees and the upper limit angle is 150 degrees. For another example, if the predetermined viewing angle range is 190 degrees to 370 degrees, the lower limit angle is 190 degrees, and the upper limit angle is 370 degrees.
In addition, the reference lines of the lower limit angle and the upper limit angle are the same as the reference line of the heading angle of the first vehicle, namely, the upper limit angle, the lower limit angle and the heading angle are all defined by the same reference line, so that the angle comparability can be ensured. For example, the upper limit angle, the lower limit angle, and the heading angle of the first vehicle are all defined with the true north direction as a reference line.
Then, the positional relationship of the second vehicle with respect to the first vehicle may be determined based on the target angle information and the azimuth information.
Since the azimuth information corresponding angle, i.e., azimuth angle, is usually in the range of 0 to 360 degrees, i.e., 2 pi, in the case that the lower limit angle is smaller than 0 or the upper limit angle is larger than 2 pi, it needs to be converted to 0 to 2 pi. Accordingly, the preset viewing angle range is also converted. Further, in the case where the azimuth is within the converted preset angle of view, it may be determined that the second vehicle is in front of the first vehicle, and otherwise, the second vehicle is behind the first vehicle.
And under the condition that the lower limit angle is larger than 0 and the upper limit angle is smaller than 2 pi, at the moment, when the azimuth angle is within the preset visual angle range in front of the first vehicle, the second vehicle can be determined to be in front of the first vehicle, and otherwise, the second vehicle is behind the first vehicle.
In this embodiment, the target angle information corresponding to the first vehicle is determined according to the first heading information to determine the preset view angle range in front of the first vehicle, and the position relationship of the second vehicle relative to the first vehicle is determined according to the target angle information and the azimuth information, so that the relative position relationship between the vehicles can be simply determined according to the heading angle of the first vehicle and the azimuth angle between the two vehicles.
Optionally, the reference line of the angle corresponding to the azimuth information is the same as the reference line of the lower limit angle and the upper limit angle, and the step of determining the position relationship of the second vehicle with respect to the first vehicle according to the target angle information and the azimuth information includes:
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is larger than a second angle and the orientation information corresponding angle is between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where a first angle is larger than a second angle and the orientation information corresponding angle is not between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where the first angle is smaller than a second angle and the orientation information corresponding angle is between the first angle and the second angle;
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is smaller than a second angle and the azimuth information corresponding angle is not between the first angle and the second angle;
wherein the first angle corresponds to the lower limit angle, the second angle corresponds to the upper limit angle, and both the first angle and the second angle are in an angle range of 0 to 2 pi.
In this embodiment, the reference line of the angle corresponding to the azimuth information is the same as the reference lines of the lower limit angle and the upper limit angle, the reference line may be in any direction, taking the true north direction as an example, and the angle corresponding to the azimuth information is the azimuth angle CAB determined in
step 102, that is, the azimuth angle CAB
。
Since the angle range of the azimuth angle is 0 to 2 pi, in order to match the preset angle range in front of the first vehicle with the angle range of the azimuth angle, so that the position relationship of the second vehicle relative to the first vehicle can be determined by comparing the magnitude relationship of the angles, in the case that the lower limit angle is smaller than 0 or the upper limit angle is larger than 2 pi, the lower limit angle, that is, the first angle after conversion, and the upper limit angle, that is, the second angle after conversion need to be converted, so that the lower limit angle, that is, the first angle and the upper limit angle after conversion are within the angle range of 0 to 2 pi.
It should be noted that the lower limit angle after conversion, i.e., the first angle (denoted by β 1), is an angle corresponding to the lower limit angle, and the upper limit angle after conversion, i.e., the second angle (denoted by β 2), is an angle corresponding to the upper limit angle, i.e., the two angles are actually the same angle in a geometric sense, and only the definitions thereof are different. The purpose of converting the lower limit angle and the upper limit angle is to make them match the definition of the azimuth angle of the second vehicle relative to the first vehicle, i.e. the angles determined in the clockwise direction, both with the true north direction as a reference line, are all in the angle range of 0 to 2 pi.
For example, the lower limit angle is-30 degrees, which translates to an angle in the range of 0 to 2 π, which translates to a first angle of 330 degrees.
For another example, the upper limit angle is 370 degrees, which is converted to an angle range of 0 to 2 π, which is converted to a second angle of 10 degrees.
Accordingly, in the case where both the first angle and the second angle are within the angle range of 0 to 2 π, the positional relationship of the second vehicle with respect to the first vehicle can be determined by comparison of the magnitudes of the angles.
Specifically, the first angle and the second angle have two size relationships, namely the first angle is larger than the second angle, and the first angle is smaller than the second angle.
When the first angle is larger than the second angle, i.e. the first angle is larger than pi, 0<
<Beta 2 or beta 1<
<2 π, the second vehicle is in front of the first vehicle, when β 2<
<β 1, the second vehicle is behind the first vehicle.
For example, β 1 is 330 degrees, β 2 is 150 degrees, if
60 degrees due to 0<
<β 2, the second vehicle is in front of the first vehicle, if
Is 350 degrees due to beta 1<
<2 pi, the second vehicle is in front of the first vehicle. If it is
Is 200 degrees due to beta 2<
<β 1, the second vehicle is behind the first vehicle.
As another example, β 1 is 190 degrees, β 2 is 10 degrees, if
60 degrees due to beta 2<
<β 1, the second vehicle is behind the first vehicle. If it is
Is 350 degrees due to beta 1<
<2 π, the second vehicle is in front of the first vehicle, if
Is 200 degrees due to beta 1<
<2 π, the second vehicle is in front of the first vehicle, and if
Is 5 degrees due to 0<
<β 2, the second vehicle is in front of the first vehicle.
When the first angle is smaller than the second angle, i.e. the first angle is smaller than pi, when the angle beta 1 is smaller than pi<
<β 2, the second vehicle is in front of the first vehicle, when 0<
<Beta 1 or beta 2<
<2 π, the second vehicle is behind the first vehicle.
For example, β 1 is 30 degrees, β 2 is 210 degrees, if
60 degrees due to beta 2<
<β 1, the second vehicle is in front of the first vehicle, if
Is 200 degrees due to beta 2<
<β 1, the second vehicle is in front of the first vehicle. If it is
Is 350 degrees due to beta 2<
<2 π, the second vehicle is behind the first vehicle, if
Is 5 degrees due to 0<
<β 1, the second vehicle is behind the first vehicle.
In the present embodiment, when the first angle, the second angle, and the azimuth are geometrically defined to be the same, the positional relationship of the second vehicle with respect to the first vehicle can be determined by comparing the magnitude relationships of the first angle, the second angle, and the azimuth, respectively. Therefore, the relative position relation of the two vehicles can be determined very quickly, the processing difficulty can be reduced, and the processing speed can be increased.
Optionally, thestep 104 specifically includes:
according to the first course information and the second course information, determining angle information of the course of the first vehicle relative to the course of the second vehicle;
determining a travel relationship of the second vehicle with respect to the first vehicle based on the angle information and the positional relationship.
In this embodiment, the angle information may be represented by a target angle, and the geometric definition of the target angle is the same as that of other angles, that is, the angle determined in the clockwise direction with the true north direction as a reference line may be in the range of 0 to 2 pi.
The difference can be made between the heading angles of the first vehicle and the second vehicle to obtain an included angle between the heading angles of the first vehicle and the second vehicle, and under the condition that the included angle is smaller than 0, the included angle is converted into the range of 0 to 2 pi to obtain a target angle which is represented by theta. And under the condition that the included angle is larger than 0, the target angle is the included angle.
For example, the included angle between the two vehicle headings is-30 degrees, the included angle is converted into the range from 0 pi to 2 pi, and the target angle is 330 degrees. And when the included angle between the two vehicle courses is 30 degrees, the target angle is the included angle of 30 degrees.
Then, a running relationship of the second vehicle with respect to the first vehicle may be determined based on the angle information and the positional relationship.
For example, if the second vehicle is in front of the first vehicle, the second vehicle and the first vehicle travel in the same direction when cos (θ) >0, and the second vehicle and the first vehicle travel in opposite directions when cos (θ) < 0.
For another example, if the second vehicle is behind the first vehicle, the second vehicle and the first vehicle travel in the same direction when cos (θ) >0, and travel in the opposite direction when cos (θ) < 0.
In the embodiment, the included angle between the headings of the two vehicles is determined according to the heading information of the two vehicles to obtain a target angle, and the driving relationship of the two vehicles is determined according to the target angle and the position relationship, so that the driving relationship of the two vehicles can be determined by combining the heading information and the position relationship of the two vehicles.
Optionally, the step of determining the driving relationship of the second vehicle with respect to the first vehicle based on the angle information and the position relationship includes:
determining the running relationship as that the second vehicle and the first vehicle run in the same direction under the condition that the angle corresponding to the angle information is in a first quadrant or a fourth quadrant in a preset coordinate system;
determining the running relationship as that the second vehicle and the first vehicle run in opposite directions under the condition that the position relationship represents that the second vehicle is in front of the first vehicle and the angle corresponding to the angle information is in a second quadrant or a third quadrant in a preset coordinate system;
and determining the running relationship as that the second vehicle and the first vehicle run in the reverse direction under the condition that the position relationship represents that the second vehicle is behind the first vehicle and the corresponding angle of the angle information is in a second quadrant or a third quadrant in a preset coordinate system.
In this embodiment, the preset coordinate system may be a coordinate system established with a true north direction as a vertical coordinate axis, and is intended to determine a quadrant in which the angle corresponding to the angle information, i.e., the target angle, is located in the preset coordinate system.
In the case where the target angle is in the first quadrant or the fourth quadrant in the preset coordinate system, it can be determined that the second vehicle and the first vehicle travel in the same direction regardless of the positional relationship of the second vehicle with respect to the first vehicle.
For example, if the second vehicle is in front of the first vehicle, when cos (θ) >0 (the characteristic target angle is in the first quadrant or the fourth quadrant in the preset coordinate system), it may be determined that the second vehicle and the first vehicle are traveling in the same direction, and if the second vehicle is behind the first vehicle, when cos (θ) >0, it may also be determined that the second vehicle and the first vehicle are traveling in the same direction.
And under the condition that the position relation indicates that the second vehicle is in front of the first vehicle and the target angle is in a second quadrant or a third quadrant in a preset coordinate system, determining that the second vehicle and the first vehicle are in opposite driving.
For example, if the second vehicle is in front of the first vehicle, when cos (θ) <0 (representing that the target angle is in the second quadrant or the third quadrant in the preset coordinate system), it may be determined that the second vehicle and the first vehicle are traveling in opposite directions.
And determining that the second vehicle and the first vehicle are in reverse driving under the condition that the position relation represents that the second vehicle is behind the first vehicle and the target angle is in a second quadrant or a third quadrant in a preset coordinate system.
For example, if the second vehicle is behind the first vehicle, when cos (θ) <0 (representing that the target angle is in the second quadrant or the third quadrant in the preset coordinate system), it may be determined that the second vehicle and the first vehicle are traveling in the reverse direction.
In the embodiment, by combining the heading angles of the first vehicle and the second vehicle and the front-back position relationship of the two vehicles, the driving relationship of the two vehicles can be determined, wherein the driving relationship of the two vehicles can include the driving relationship of three vehicles of opposite driving, same driving and reverse driving, and the obtained driving relationship is more comprehensive.
The following describes an inter-vehicle relationship information determination device provided by an embodiment of the present invention.
Referring to fig. 3, a schematic structural diagram of an inter-vehicle relationship information determination apparatus according to an embodiment of the present invention is shown. As shown in fig. 3, the inter-vehicle relationshipinformation determination device 300 includes:
the acquiringmodule 301 is configured to acquire first heading information and first position information of a first vehicle, and acquire second heading information and second position information of a second vehicle;
a first determiningmodule 302, configured to determine, according to the first location information and the second location information, orientation information of the second vehicle relative to the first vehicle;
a second determiningmodule 303, configured to determine a position relationship of the second vehicle with respect to the first vehicle according to the first heading information and the direction information;
a third determiningmodule 304, configured to determine a driving relationship of the second vehicle with respect to the first vehicle according to the first heading information, the second heading information, and the position relationship.
Optionally, the second determiningmodule 303 includes:
the first determining unit is used for determining target angle information corresponding to the first vehicle according to the first course information;
a second determination unit configured to determine a positional relationship of the second vehicle with respect to the first vehicle based on the target angle information and the azimuth information;
the target angle information is used for indicating a preset visual angle range in front of the first vehicle, the target angle information comprises a lower limit angle and an upper limit angle of the preset visual angle range, and reference lines of the lower limit angle and the upper limit angle are the same as reference lines of angles corresponding to the first course information.
Optionally, the reference line of the angle corresponding to the azimuth information is the same as the reference lines of the lower limit angle and the upper limit angle, and the second determining unit is specifically configured to:
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is larger than a second angle and the orientation information corresponding angle is between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where a first angle is larger than a second angle and the orientation information corresponding angle is not between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where the first angle is smaller than a second angle and the orientation information corresponding angle is between the first angle and the second angle;
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is smaller than a second angle and the azimuth information corresponding angle is not between the first angle and the second angle;
wherein the first angle corresponds to the lower limit angle, the second angle corresponds to the upper limit angle, and both the first angle and the second angle are in an angle range of 0 to 2 pi.
Optionally, the third determiningmodule 304 includes:
the third determining unit is used for determining the angle information of the course of the first vehicle relative to the course of the second vehicle according to the first course information and the second course information;
a fourth determination unit configured to determine a travel relationship of the second vehicle with respect to the first vehicle based on the angle information and the positional relationship.
Optionally, the fourth determining unit is specifically configured to:
determining the running relationship as that the second vehicle and the first vehicle run in the same direction under the condition that the angle corresponding to the angle information is in a first quadrant or a fourth quadrant in a preset coordinate system;
determining the running relationship as that the second vehicle and the first vehicle run in opposite directions under the condition that the position relationship represents that the second vehicle is in front of the first vehicle and the angle corresponding to the angle information is in a second quadrant or a third quadrant in a preset coordinate system;
and determining the running relationship as that the second vehicle and the first vehicle run in the reverse direction under the condition that the position relationship represents that the second vehicle is behind the first vehicle and the corresponding angle of the angle information is in a second quadrant or a third quadrant in a preset coordinate system.
The inter-vehicle relationshipinformation determining apparatus 300 can implement each process implemented in the above method embodiments, and is not described herein again to avoid repetition.
In the embodiment of the invention, the first course information and the first position information of the first vehicle are acquired through theacquisition module 301, and the second course information and the second position information of the second vehicle are acquired; determining, by afirst determination module 302, orientation information of the second vehicle relative to the first vehicle based on the first location information and the second location information; determining the position relation of the second vehicle relative to the first vehicle according to the first heading information and the azimuth information through a second determiningmodule 303; and determining the running relationship of the second vehicle relative to the first vehicle according to the first course information, the second course information and the position relationship through athird determination module 304. Therefore, the relative position relation and the driving relation of the two vehicles can be determined directly according to the direction information of the two vehicles and the course information of each vehicle, so that the processing difficulty is reduced, and the processing speed is increased.
The following describes an electronic device provided in an embodiment of the present invention.
Referring to fig. 4, a schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. As shown in fig. 4, theelectronic device 400 includes: aprocessor 401, amemory 402, auser interface 403 and abus interface 404.
Aprocessor 401 for reading the program in thememory 402, and executing the following processes:
acquiring first course information and first position information of a first vehicle, and acquiring second course information and second position information of a second vehicle;
determining orientation information of the second vehicle relative to the first vehicle according to the first position information and the second position information;
determining the position relation of the second vehicle relative to the first vehicle according to the first course information and the azimuth information;
and determining the running relation of the second vehicle relative to the first vehicle according to the first course information, the second course information and the position relation.
In FIG. 4, the bus architecture may include any number of interconnected buses and bridges, with one or more processors, represented byprocessor 401, and various circuits, represented bymemory 402, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein.Bus interface 404 provides an interface. Theuser interface 403 may also be an interface capable of interfacing with a desired device for different user devices, including but not limited to a keypad, a display, a speaker, a microphone, a joystick, etc.
Theprocessor 401 is responsible for managing the bus architecture and general processing, and thememory 402 may store data used by theprocessor 401 in performing operations.
Optionally, theprocessor 401 is specifically configured to:
determining target angle information corresponding to the first vehicle according to the first course information;
determining the position relation of the second vehicle relative to the first vehicle according to the target angle information and the azimuth information;
the target angle information is used for indicating a preset visual angle range in front of the first vehicle, the target angle information comprises a lower limit angle and an upper limit angle of the preset visual angle range, and reference lines of the lower limit angle and the upper limit angle are the same as reference lines of angles corresponding to the first course information.
Optionally, the reference line of the angle corresponding to the azimuth information is the same as the reference lines of the lower limit angle and the upper limit angle, and theprocessor 401 is specifically configured to:
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is larger than a second angle and the orientation information corresponding angle is between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where a first angle is larger than a second angle and the orientation information corresponding angle is not between the second angle and the first angle;
determining the position relationship as the second vehicle being in front of the first vehicle in a case where the first angle is smaller than a second angle and the orientation information corresponding angle is between the first angle and the second angle;
determining the position relationship as the second vehicle is behind the first vehicle when the first angle is smaller than a second angle and the azimuth information corresponding angle is not between the first angle and the second angle;
wherein the first angle corresponds to the lower limit angle, the second angle corresponds to the upper limit angle, and both the first angle and the second angle are in an angle range of 0 to 2 pi.
Optionally, theprocessor 401 is specifically configured to:
according to the first course information and the second course information, determining angle information of the course of the first vehicle relative to the course of the second vehicle;
determining a travel relationship of the second vehicle with respect to the first vehicle based on the angle information and the positional relationship.
Optionally, theprocessor 401 is specifically configured to:
determining the running relationship as that the second vehicle and the first vehicle run in the same direction under the condition that the angle corresponding to the angle information is in a first quadrant or a fourth quadrant in a preset coordinate system;
determining the running relationship as that the second vehicle and the first vehicle run in opposite directions under the condition that the position relationship represents that the second vehicle is in front of the first vehicle and the angle corresponding to the angle information is in a second quadrant or a third quadrant in a preset coordinate system;
and determining the running relationship as that the second vehicle and the first vehicle run in the reverse direction under the condition that the position relationship represents that the second vehicle is behind the first vehicle and the corresponding angle of the angle information is in a second quadrant or a third quadrant in a preset coordinate system.
Preferably, an embodiment of the present invention further provides an electronic device, which includes aprocessor 401, amemory 402, and a computer program stored in thememory 402 and capable of running on theprocessor 401, where the computer program is executed by theprocessor 401 to implement each process of the above-mentioned method for determining relationship information between vehicles, and can achieve the same technical effect, and in order to avoid repetition, the details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned method for determining relationship information between vehicles, and can achieve the same technical effect, and in order to avoid repetition, the details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed system and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.