Position information offset method and system, electronic equipment and storage medium
Through calculation and smooth transition path processing, the problem of sudden position information changes during scene switching in the Internet of Vehicles hardware is solved, and the stable transition of vehicle position information is achieved, distortion of simulation results is avoided, and the authenticity and accuracy of the test is improved.
Patent Information
- Application Number
- CN202411366716.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-27
AI Technical Summary
In the vehicle network hardware ring test of the vehicle, the position information of the simulated vehicle suddenly changes during scene switching, resulting in distortion of the simulation results, affecting the sense of reality and the correct response of the test part.
By obtaining the longitude and latitude information of the end position of the previous scene and the starting position of the current scene, calculate the distance and time and distance of the driving stage, divide the time period, and calculate the position information of each time period by linear interpolation method to form a smooth Transition path to avoid location mutations.
The smooth transition of simulated vehicle position information is realized, which avoids distortion of simulation results, and improves the realism of the simulation and the response accuracy of the measured part.
Smart Images

Figure CN119197534A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle testing technology, and in particular to a position information offset method and system, electronic equipment, and storage medium. Background Art
[0002] In the vehicle-to-everything (V2X-HIL) testing of the vehicle network, multiple different simulation scenarios need to be tested, so the switching of 3D scenes is a key technology for achieving smooth transition of the vehicle in different simulation scenarios.
[0003] During the test, the simulated vehicle needs to be positioned, and currently it is completely dependent on the simulated global navigation satellite system. The simulated global navigation satellite system locates the position information of the simulated vehicle in real time, and sends the located position information directly to the device under test, thereby updating the position of the simulated vehicle in real time.
[0004] However, when switching to a new scene, if the starting position of the simulated vehicle in the new scene is usually quite different from the ending position in the previous scene, the position of the simulated vehicle will suddenly change when the positioning information is directly used to position the vehicle, that is, the actual position in the new scene is directly transmitted to the DUT for positioning. This sudden position change not only affects the realism of the simulation, but also causes the DUT to fail to respond correctly, resulting in distorted simulation results. Summary of the invention
[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a method and system for position information offset, an electronic device, and a storage medium to solve the problem that the prior art is prone to position mutations, resulting in distorted simulation results.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a location information offset method, including:
[0008] Obtaining the location information of the end position of the previous scene and the location information of the starting position of the current scene; wherein the location information includes the longitude and latitude of the location;
[0009] Based on the position information of the end position and the position information of the start position, calculate the distance between the end position and the start position;
[0010] According to the preset maximum speed and the preset acceleration, the driving time and the driving distance of each driving stage within the distance between the end position and the starting position are calculated; wherein the driving stage includes an acceleration stage, a constant speed stage and a deceleration stage;
[0011] Dividing the time from the end position to the start position into a plurality of time periods;
[0012] Based on the driving time and driving distance of each driving stage, the position information corresponding to each time period is calculated; wherein the position information corresponding to each time period refers to the position information of the position after driving the time period;
[0013] The position information corresponding to each of the time periods is used to form a smooth transition path from the end position to the start position.
[0014] Optionally, in the above-mentioned position information offset method, the calculating, based on the position information of the end position and the position information of the start position, the distance between the end position and the start position includes:
[0015] Calculating the longitude difference and latitude difference between the end position and the start position based on the position information of the end position and the position information of the start position;
[0016] The distance between the end position and the start position is calculated by using the longitude difference and latitude difference between the end position and the start position and the radius of the earth.
[0017] Optionally, in the above-mentioned position information offset method, the calculating of the driving time and driving distance of each driving stage within the distance between the end position and the start position according to the preset maximum speed and the preset acceleration further includes:
[0018] Based on the distance between the end position and the start position, determining whether position information offset is required;
[0019] If it is determined that position shifting is required, the driving time and driving distance of each driving stage within the distance between the end position and the starting position are calculated according to the preset maximum speed and the preset acceleration.
[0020] Optionally, in the above-mentioned position information offset method, calculating the driving time and driving distance of each driving stage within the distance between the end position and the start position according to the preset maximum speed and the preset acceleration includes:
[0021] Calculating the driving time and driving distance for accelerating the speed from zero to the preset maximum speed according to the preset acceleration, to obtain the driving time and driving distance in the acceleration stage;
[0022] Calculating the driving time and driving distance required to decelerate the speed from the preset maximum speed to zero according to the preset acceleration, to obtain the driving time and driving distance in the deceleration stage;
[0023] The distance between the end position and the start position is subtracted from the sum of the travel distance in the acceleration phase and the travel distance in the deceleration phase to obtain the travel distance in the uniform speed phase;
[0024] The driving time of the uniform speed stage is calculated based on the preset maximum speed and the driving distance of the uniform speed stage.
[0025] Optionally, in the above-mentioned location information offset method, the location information corresponding to each time period is calculated based on the driving time and driving distance of each driving stage, including:
[0026] Based on the driving time and driving distance of each driving stage, the driving distance of each time period is calculated by linear interpolation;
[0027] Based on the heading angle from the end position to the start position and the travel distance of each time period, the position information corresponding to each time period is calculated.
[0028] A second aspect of the present application provides a position information offset system, including:
[0029] A position acquisition unit, used to acquire the position information of the end position of the previous scene and the position information of the start position of the current scene; wherein the position information includes the longitude and latitude of the position;
[0030] a distance calculation unit, configured to calculate the distance between the end position and the start position based on the position information of the end position and the position information of the start position;
[0031] A stage analysis unit, for calculating the driving time and driving distance of each driving stage within the distance between the end position and the start position according to a preset maximum speed and a preset acceleration; wherein the driving stage includes an acceleration stage, a constant speed stage and a deceleration stage;
[0032] A division unit, used to divide the time from the end position to the start position into a plurality of time periods;
[0033] A position analysis unit, configured to calculate the position information corresponding to each of the time periods based on the driving time and the driving distance of each of the driving stages; wherein the position information corresponding to each of the time periods refers to the position information of the position after driving the time period;
[0034] The composition unit is used to use the position information corresponding to each of the time periods to compose a smooth transition path from the end position to the start position.
[0035] Optionally, in the above-mentioned position information offset system, the distance calculation unit includes:
[0036] a longitude and latitude difference calculation unit, configured to calculate the longitude difference and latitude difference between the end position and the start position based on the position information of the end position and the position information of the start position;
[0037] The distance calculation subunit is used to calculate the distance between the end position and the start position by using the longitude difference and latitude difference between the end position and the start position and the radius of the earth.
[0038] Optionally, in the above-mentioned position information offset system, it also includes:
[0039] A judging unit, configured to judge whether position information offset is required based on the distance between the end position and the start position;
[0040] If it is determined that position shifting is required, the stage analysis unit executes the calculation of the driving time and driving distance of each driving stage within the distance between the end position and the starting position according to the preset maximum speed and the preset acceleration.
[0041] Optionally, in the above-mentioned position information offset system, the stage analysis unit includes:
[0042] A first calculation unit is used to calculate the driving time and driving distance of accelerating the speed from zero to the preset maximum speed according to the preset acceleration, so as to obtain the driving time and driving distance in the acceleration stage;
[0043] A second calculation unit is used to calculate the driving time and driving distance required to decelerate the speed from the preset maximum speed to zero according to the preset acceleration, so as to obtain the driving time and driving distance in the deceleration stage;
[0044] a third calculating unit, configured to obtain the traveling distance in the uniform speed stage by subtracting the sum of the traveling distance in the acceleration stage and the traveling distance in the deceleration stage from the distance between the end position and the starting position;
[0045] The fourth calculation unit is used to calculate the driving time of the uniform speed stage based on the preset maximum speed and the driving distance of the uniform speed stage.
[0046] Optionally, in the above-mentioned position information offset system, the position analysis unit includes:
[0047] An interpolation calculation unit, used to calculate the driving distance of each of the time periods by linear interpolation method based on the driving time and driving distance of each of the driving stages;
[0048] The position information calculation unit is used to calculate the position information corresponding to each of the time periods based on the heading angle from the end position to the start position and the travel distance of each of the time periods.
[0049] A third aspect of the present application provides an electronic device, including:
[0050] Memory and processor;
[0051] Wherein, the memory is used to store programs;
[0052] The processor is used to execute the program, and when the program is executed, it is specifically used to implement the position information offset method as described in any one of the above items.
[0053] A fourth aspect of the present application provides a computer storage medium for storing a computer program, wherein when the computer program is executed by a processor, the computer program is used to implement a position information offset method as described in any one of the above items.
[0054] The present application provides a method for offsetting position information, which obtains the position information of the end position of the previous scene and the position information of the start position of the current scene. The position information includes the longitude and latitude of the position. Then, based on the position information of the end position and the position information of the start position, the distance between the end position and the start position is calculated so that analysis can be performed on this distance. According to the preset maximum speed and the preset acceleration, the driving time and driving distance of each driving stage within the distance between the end position and the start position are calculated. The driving stage includes an acceleration stage, a uniform speed stage, and a deceleration stage, so that the three stages of driving can be passed to ensure that the position information can be stably and smoothly transitioned from the end position to the start position. Then, the time from the end position to the start position is divided into multiple time periods, and the position information corresponding to each time period is calculated based on the driving time and driving distance of each driving stage. The position information corresponding to each time period refers to the position information of the position after the driving time period. Finally, the position information corresponding to each time period is used to form a smooth transition path from the end position to the starting position, thereby realizing a method for analyzing the position information of multiple positions between the end position and the starting position. By analyzing each position point, it is possible to smoothly transition from the end position to the starting position, avoiding sudden position changes and thus avoiding distortion of the simulation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0056] Figure 1 A flowchart of a location information offset method provided in an embodiment of the present application;
[0057] Figure 2 A flowchart of a method for calculating the distance between an end position and a start position provided in an embodiment of the present application;
[0058] Figure 3 A flow chart of a method for calculating driving time and driving distance in each driving stage provided in an embodiment of the present application;
[0059] Figure 4 A flowchart of a method for calculating location information corresponding to each time period provided in an embodiment of the present application;
[0060] Figure 5 A schematic diagram of the architecture of a position information offset system provided in an embodiment of the present application;
[0061] Figure 6 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0063] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0064] The present application embodiment provides a method for offsetting location information, such as Figure 1 As shown, the following steps are included:
[0065] S101, obtaining the position information of the end position of the previous scene and the position information of the start position of the current scene.
[0066] The location information includes the longitude and latitude of the location.
[0067] Specifically, the longitude and latitude of the position at the end of the test of the previous scene are obtained, and after the scene is switched, the longitude and latitude of the starting position of the current scene after the scene is switched are obtained. For example, the latitude of the end position of the previous scene is 30.0 degrees and the longitude is 120.0 degrees.
[0068] S102: Calculate the distance between the end position and the start position based on the position information of the end position and the position information of the start position.
[0069] It should be noted that in order to allow the car to smoothly transition from the end position to the start position, it is necessary to calculate the position information of multiple gently changing positions between the end position and the start position. Therefore, it is necessary to consider the movement of the car in this process, so it is necessary to calculate the distance between the end position and the start position so that its movement in this distance can be considered in subsequent steps.
[0070] Optionally, in another embodiment of the present application, a specific implementation of step S102 is as follows: Figure 2 As shown, including:
[0071] S201. Calculate the longitude difference and latitude difference between the end position and the start position based on the position information of the end position and the position information of the start position.
[0072] Specifically, the difference between the longitude of the end position and the longitude of the start position is calculated to obtain the longitude difference between the end position and the start position. Similarly, the difference between the latitude of the end position and the latitude of the start position is calculated to obtain the latitude difference between the end position and the start position.
[0073] S202: Calculate the distance between the end position and the start position using the longitude difference and latitude difference between the end position and the start position and the radius of the earth.
[0074] Specifically, the distance between the end position and the start position is calculated by the Haversine formula using the longitude difference and latitude difference between the end position and the start position and the radius of the earth.
[0075] Optionally, considering that the end position may be relatively close to the start position, there will be no sudden change in position, and there is no need to perform position shift. Therefore, in another embodiment of the present application, after executing step S102 and before executing step S103, the following may be further performed:
[0076] Based on the distance between the end position and the start position, determine whether position information offset is required.
[0077] Specifically, it may be determined whether the distance between the end position and the start position is less than a preset distance. If it is determined that the distance between the end position and the start position is less than the preset distance, it is determined that the position information shift is not required. If it is determined that the distance between the end position and the start position is not less than the preset distance, it is determined that the position information shift is required.
[0078] If it is determined that position shifting is required, step S103 is executed.
[0079] S103, calculating the driving time and driving distance of each driving stage within the distance between the end position and the start position according to the preset maximum speed and the preset acceleration.
[0080] The driving phase includes an acceleration phase, a constant speed phase and a deceleration phase.
[0081] It should be noted that in order to allow the car to have a smooth and stable transition from the end position to the actual position and avoid abnormal positioning of the measured part, in the embodiment of the present application, the process of the car from the end position to the starting position is realized in three stages of movement, namely, the acceleration stage, the uniform speed stage and the deceleration stage. The movement mode of each stage is different, so the calculation of its position is also different. Therefore, it is necessary to calculate the driving time and driving distance of each driving stage within the distance between the end position and the starting position, so as to be able to calculate the position information of the position in each stage in a targeted manner.
[0082] It should also be noted that during the acceleration phase, the vehicle is accelerated at a certain acceleration until it reaches a certain speed. During the uniform speed phase, the vehicle is driven at a preset maximum speed. During the deceleration phase, the vehicle is decelerated from a certain speed at a certain acceleration.
[0083] Therefore, according to the scene change, the preset maximum speed and preset acceleration are set to ensure smooth and stable transition, so that in the acceleration stage, the speed is accelerated from zero to the preset maximum speed according to the preset acceleration; in the uniform speed stage, the vehicle is driven according to the preset maximum speed; in the deceleration stage, the vehicle is decelerated from the preset maximum speed to zero according to the preset acceleration. Therefore, the driving time and driving distance of the three driving stages within the distance between the end position and the starting position can be calculated according to the preset maximum speed and the preset acceleration.
[0084] Optionally, in another embodiment of the present application, a specific implementation of step S103 is as follows: Figure 3 As shown, the following steps are included:
[0085] S301, calculating the driving time and driving distance for accelerating the speed from zero to a preset maximum speed according to a preset acceleration, and obtaining the driving time and driving distance in the acceleration phase.
[0086] S302: Calculate the driving time and driving distance required to decelerate the speed from a preset maximum speed to zero according to a preset acceleration, and obtain the driving time and driving distance in the deceleration stage.
[0087] S303: Subtract the sum of the driving distance in the acceleration phase and the driving distance in the deceleration phase from the distance between the end position and the start position to obtain the driving distance in the uniform speed phase.
[0088] S304: Calculate the driving time in the uniform speed stage based on the preset maximum speed and the driving distance in the uniform speed stage.
[0089] For example, the preset maximum speed of the vehicle is 10.0m / s and the preset acceleration is 2m / s 2 , the time and distance of the three driving stages can be calculated respectively:
[0090] Driving time and distance during the acceleration phase: t_acc = 5.0000 seconds, d_acc = 25.0000 meters.
[0091] Driving time and distance during the uniform speed phase: t_cruise = 2.3631 seconds, d_cruise = 23.6308 meters.
[0092] Travel time and travel distance during the deceleration phase: t_dec = 5.0000 seconds, d_dec = 25.0000 meters.
[0093] S104, dividing the time from the end position to the start position into a plurality of time periods.
[0094] In order to smoothly transition from the end position to the start position, in the embodiment of the present application, multiple position points between the end position and the start position are analyzed. Therefore, the total driving time from the end position to the start position is divided into multiple time periods, so that the position information of the position after each time period can be analyzed respectively.
[0095] Optionally, the time from the end position to the start position may be divided into a plurality of time periods according to preset time intervals.
[0096] S105: Based on the driving time and driving distance of each driving stage, calculate and obtain the position information corresponding to each time period.
[0097] The location information corresponding to each time period refers to the location information of the location after the driving time period.
[0098] Specifically, based on the driving time and driving distance of each driving stage, the driving stage of each time period can be determined, so as to determine whether the vehicle is accelerating, driving at a constant speed or accelerating in the time period, that is, by determining the driving stage, the driving mode can be determined, and then the driving distance in the time period can be further analyzed according to the driving mode, and finally the longitude and latitude can be determined according to the driving distance. Specifically, the offset of longitude and latitude can be determined by the driving distance, that is, the change in distance, so as to determine the longitude and latitude of the position of the vehicle after driving in the time period, and obtain the position information corresponding to the time period.
[0099] Optionally, in another embodiment of the present application, a specific implementation of step S105 is as follows: Figure 4 As shown, including:
[0100] S401. Based on the driving time and driving distance of each driving stage, the driving distance of each time period is calculated by linear interpolation.
[0101] It should be noted that the driving time and driving distance of each driving stage are equivalent to the time and distance of multiple position points, and the position points of each driving time period are between the position points corresponding to each driving stage, and the time of each time period is known, so the driving distance of each time period can be directly calculated by linear interpolation based on the time and distance of the last two position points, that is, the distance traveled by the car in each time period.
[0102] S402: Calculate the position information corresponding to each time period based on the heading angle from the end position to the start position and the travel distance in each time period.
[0103] Specifically, the driving distance in a certain time period can be decomposed into vectors in the longitude and latitude directions according to the heading angle from the end position to the start position, so that the change in longitude and latitude can be determined based on these two vectors, and further based on the longitude and latitude of the previous position, the location information corresponding to the time period can be determined.
[0104] S106: Using the position information corresponding to each time period, a smooth transition path from the end position to the start position is formed.
[0105] Specifically, the position information corresponding to each time period can be transmitted to the simulation system, so that the simulation system can use the position information corresponding to each time period to form a smooth transition path from the end position to the start position to avoid sudden changes in position.
[0106] The embodiment of the present application provides a method for offsetting position information, which obtains the position information of the end position of the previous scene and the position information of the start position of the current scene. Wherein, the position information includes the longitude and latitude of the position. Then, based on the position information of the end position and the position information of the start position, the distance between the end position and the start position is calculated so that analysis can be performed on this distance. According to the preset maximum speed and the preset acceleration, the driving time and driving distance of each driving stage within the distance between the end position and the start position are calculated. Wherein, the driving stage includes an acceleration stage, a uniform speed stage, and a deceleration stage, so that the three stages of driving can be passed to ensure that the position information can be stably and smoothly transitioned from the end position to the start position. Then, the time from the end position to the start position is divided into multiple time periods, and based on the driving time and driving distance of each driving stage, the position information corresponding to each time period is calculated. Wherein, the position information corresponding to each time period refers to the position information of the position after the driving time period. Finally, the position information corresponding to each time period is used to form a smooth transition path from the end position to the starting position, thereby realizing a method for analyzing the position information of multiple positions between the end position and the starting position. By analyzing each position point, it is possible to smoothly transition from the end position to the starting position, avoiding sudden position changes and thus avoiding distortion of the simulation results.
[0107] Another embodiment of the present application provides a position information offset system, such as Figure 5 As shown, including:
[0108] The position acquisition unit 501 is used to acquire the position information of the end position of the previous scene and the position information of the start position of the current scene.
[0109] The location information includes the longitude and latitude of the location.
[0110] The distance calculation unit 502 is used to calculate the distance between the end position and the start position based on the position information of the end position and the position information of the start position.
[0111] The stage analysis unit 503 is used to calculate the driving time and driving distance of each driving stage within the distance between the end position and the start position according to the preset maximum speed and the preset acceleration.
[0112] The driving phase includes an acceleration phase, a constant speed phase and a deceleration phase.
[0113] The division unit 504 is used to divide the time from the end position to the start position into multiple time periods.
[0114] The location analysis unit 505 is used to calculate the location information corresponding to each time period based on the driving time and driving distance of each driving stage.
[0115] The location information corresponding to each time period refers to the location information of the location after the driving time period.
[0116] The composition unit 506 is used to use the position information corresponding to each time period to compose a smooth transition path from the end position to the start position.
[0117] Optionally, in a position information offset system provided in another embodiment of the present application, the distance calculation unit includes:
[0118] The longitude and latitude difference calculation unit is used to calculate the longitude difference and latitude difference between the ending position and the starting position based on the position information of the ending position and the position information of the starting position.
[0119] The distance calculation subunit is used to calculate the distance between the end position and the start position by using the longitude difference and latitude difference between the end position and the start position and the radius of the earth.
[0120] Optionally, in another embodiment of the present application, the position information offset system further includes:
[0121] The judging unit is used to judge whether position information offset is required based on the distance between the end position and the start position.
[0122] If it is determined that position shifting is required, the stage analysis unit calculates the driving time and driving distance of each driving stage within the distance between the end position and the start position according to the preset maximum speed and the preset acceleration.
[0123] Optionally, in a position information migration system provided in another embodiment of the present application, the phase analysis unit includes:
[0124] The first calculation unit is used to calculate the driving time and driving distance of accelerating the speed from zero to a preset maximum speed according to a preset acceleration, so as to obtain the driving time and driving distance in the acceleration stage.
[0125] The second calculation unit is used to calculate the driving time and driving distance required to decelerate the speed from a preset maximum speed to zero according to a preset acceleration, so as to obtain the driving time and driving distance in the deceleration stage.
[0126] The third calculation unit is used to subtract the sum of the driving distance in the acceleration phase and the driving distance in the deceleration phase from the distance between the end position and the starting position to obtain the driving distance in the uniform speed phase.
[0127] The fourth calculation unit is used to calculate the driving time in the uniform speed stage based on the preset maximum speed and the driving distance in the uniform speed stage.
[0128] Optionally, in a position information offset system provided in another embodiment of the present application, the position analysis unit includes:
[0129] The interpolation calculation unit is used to calculate the driving distance of each time period by linear interpolation method based on the driving time and driving distance of each driving stage.
[0130] The position information calculation unit is used to calculate the position information corresponding to each time period based on the heading angle from the end position to the start position and the travel distance in each time period.
[0131] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the implementation process of the corresponding steps in the above method embodiments, and will not be repeated here.
[0132] Another embodiment of the present application provides an electronic device, such as Figure 6 As shown, including:
[0133] Memory 601 and processor 602 .
[0134] The memory 601 is used to store programs.
[0135] The processor 602 is used to execute the program stored in the memory 601. When the program is executed, it is specifically used to implement the position information offset method provided in any one of the above embodiments.
[0136] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed by a processor, it is used to implement the position information offset method provided in any of the above embodiments.
[0137] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0138] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0139] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for position information offset, characterized in that: include: Obtaining the location information of the end position of the previous scene and the location information of the starting position of the current scene; wherein the location information includes the longitude and latitude of the location; Based on the position information of the end position and the position information of the start position, calculate the distance between the end position and the start position; According to the preset maximum speed and the preset acceleration, the driving time and the driving distance of each driving stage within the distance between the end position and the starting position are calculated; wherein the driving stage includes an acceleration stage, a constant speed stage and a deceleration stage; Dividing the time from the end position to the start position into a plurality of time periods; Based on the driving time and driving distance of each driving stage, the position information corresponding to each time period is calculated; wherein the position information corresponding to each time period refers to the position information of the position after driving the time period; The position information corresponding to each of the time periods is used to form a smooth transition path from the end position to the start position.
2. The method according to claim 1, characterized in that The calculating the distance between the end position and the start position based on the position information of the end position and the position information of the start position includes: Calculating the longitude difference and latitude difference between the end position and the start position based on the position information of the end position and the position information of the start position; The distance between the end position and the start position is calculated by using the longitude difference and latitude difference between the end position and the start position and the radius of the earth.
3. The method according to claim 1, characterized in that The step of calculating the driving time and the driving distance of each driving stage within the distance between the end position and the start position according to the preset maximum speed and the preset acceleration also includes: Based on the distance between the end position and the start position, determining whether position information offset is required; If it is determined that position shifting is required, the driving time and driving distance of each driving stage within the distance between the end position and the starting position are calculated according to the preset maximum speed and the preset acceleration.
4. The method according to claim 1, characterized in that The calculating, according to the preset maximum speed and the preset acceleration, the driving time and the driving distance of each driving stage within the distance between the end position and the starting position includes: Calculating the driving time and driving distance for accelerating the speed from zero to the preset maximum speed according to the preset acceleration, to obtain the driving time and driving distance in the acceleration stage; Calculating the driving time and driving distance required to decelerate the speed from the preset maximum speed to zero according to the preset acceleration, to obtain the driving time and driving distance in the deceleration stage; The distance between the end position and the start position is subtracted from the sum of the travel distance in the acceleration phase and the travel distance in the deceleration phase to obtain the travel distance in the uniform speed phase; The driving time of the uniform speed stage is calculated based on the preset maximum speed and the driving distance of the uniform speed stage.
5. The method according to claim 1, characterized in that The calculating the location information corresponding to each time period based on the driving time and the driving distance of each driving stage includes: Based on the driving time and driving distance of each driving stage, the driving distance of each time period is calculated by linear interpolation; Based on the heading angle from the end position to the start position and the travel distance of each time period, the position information corresponding to each time period is calculated.
6. A position information offset system, characterized in that: include: A position acquisition unit, used to acquire the position information of the end position of the previous scene and the position information of the start position of the current scene; wherein the position information includes the longitude and latitude of the position; a distance calculation unit, configured to calculate the distance between the end position and the start position based on the position information of the end position and the position information of the start position; A stage analysis unit, configured to calculate the driving time and driving distance of each driving stage within the distance between the end position and the start position according to a preset maximum speed and a preset acceleration; wherein the driving stage includes an acceleration stage, a constant speed stage, and a deceleration stage; A division unit, used to divide the time from the end position to the start position into a plurality of time periods; A position analysis unit, configured to calculate the position information corresponding to each of the time periods based on the driving time and the driving distance of each of the driving stages; wherein the position information corresponding to each of the time periods refers to the position information of the position after driving the time period; The composition unit is used to use the position information corresponding to each of the time periods to compose a smooth transition path from the end position to the start position.
7. The system according to claim 6, characterized in that The distance calculation unit comprises: a longitude and latitude difference calculation unit, configured to calculate the longitude difference and latitude difference between the end position and the start position based on the position information of the end position and the position information of the start position; The distance calculation subunit is used to calculate the distance between the end position and the start position by using the longitude difference and latitude difference between the end position and the start position and the radius of the earth.
8. The system according to claim 6, characterized in that Also includes: A judging unit, configured to judge whether position information offset is required based on the distance between the end position and the start position; If it is determined that position shifting is required, the stage analysis unit executes the calculation of the driving time and driving distance of each driving stage within the distance between the end position and the starting position according to the preset maximum speed and the preset acceleration.
9. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the position information offset method as described in any one of claims 1 to 5.
10. A computer storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, is used to implement the position information offset method as described in any one of claims 1 to 5.
