Disclosure of Invention
The invention aims to provide a test method for an automatic driving simulation system, which can realize direct simulation debugging by combining simulation software and confirm the reliability of a simulation system to be tested so as to ensure that the simulation system to be tested and a real system can be seamlessly switched.
The invention provides a test method for an automatic driving simulation system, which comprises the following steps: generating a vehicle simulation environment by a simulation environment generation module of a first automatic driving simulation system in a first operation environment, wherein the vehicle simulation environment comprises a virtual vehicle, a virtual sensor and a virtual scene; the simulation environment generation module generates a first control instruction according to sensor data generated by the virtual sensor and a set test target, and applies the first control instruction to the virtual vehicle to enable the virtual vehicle to run in the virtual scene; a data conversion interface of the first autopilot simulation system reads the sensor data and converts the sensor data into sensor data recognizable by a second autopilot simulation system in a second operating environment; the second automatic driving simulation system receives the identifiable sensor data, generates a second control instruction according to the identifiable sensor data and the set test target, and sends the second control instruction to the data conversion interface; the data conversion interface receives the second control instruction and converts the second control instruction into a control instruction which can be identified by the simulation environment generation module; the simulated environment generation module applies the identifiable control instruction to the virtual vehicle to cause the virtual vehicle to operate in the virtual scene.
Optionally, the method further comprises: and if the result of the operation of the virtual vehicle in the virtual scene after the recognizable control command is applied to the virtual vehicle reaches the set test target, confirming that the second automatic driving simulation system is successfully verified aiming at the set test target.
Optionally, the method further comprises: and confirming whether the second automatic driving simulation system is successfully verified or not according to different set test targets.
Optionally, the method further comprises: after confirming that the second autopilot simulation system is successfully verified for all set test targets, the second autopilot simulation system is applied directly to the actual vehicle.
Optionally, the first operating environment is a Windows operating environment, and the second operating environment is a Linux operating environment.
Optionally, the simulation environment generation module is based on PreScan, and the data conversion interface includes: a Prescan-Matlab interface for reading sensor data generated by the virtual sensor or receiving control instructions recognizable by the simulation environment based on Prescan; and the Matlab-Ros interface is used for converting the sensor data into sensor data which can be identified by the second automatic driving simulation system based on the Ros system under the Linux operation environment and sending the identifiable sensor data or receiving the second control instruction and converting the second control instruction into a control instruction which can be received by the simulation environment based on Prescan.
Through the technical scheme, the simulation environment generating module of the first automatic driving system generates the vehicle simulation environment, the data of the virtual sensor in the simulation environment is converted into the sensor data which can be identified by the second automatic driving simulation system through the data conversion interface of the simulation environment, the identifiable sensor data is transmitted to the second automatic driving simulation system, the second automatic driving simulation system generates the control instruction according to the identifiable sensor data and the set test target, the control instruction is converted into the control instruction which can be identified by the simulation environment generating module through the data conversion interface and is applied to the virtual vehicle in the vehicle simulation environment to verify the reliability of the second automatic driving simulation system, and therefore seamless switching between the second simulation system and the real system of the real vehicle is guaranteed.
Additional features and advantages of the invention will be set forth in the detailed description which follows.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a block diagram of a test system for an automatic driving simulation system according to an embodiment of the present invention. As shown in fig. 1, the test system includes a first automatic driving simulation system 1 in a first operating environment, which is capable of performing simulation operations on a vehicle under test. The first autopilot simulation system 1 includes a simulation environment generation module 2 and a data conversion interface 3. The simulation environment generation module 2 may generate a vehicle simulation environment including a virtual vehicle, a virtual sensor, and a virtual scene, and may generate a first control instruction according to sensor data generated by the virtual sensor and a set test target and apply the first control instruction to the virtual vehicle in the simulation environment to cause the virtual vehicle to run in the virtual scene. The data conversion interface 3 may be used to read sensor data of virtual sensors in the simulated environment and convert it to sensor data recognizable by the second autopilot simulation system in the second operating environment. The second automatic driving simulation system receives the identifiable sensor data, generates a second control instruction according to the identifiable sensor data and a set test target and sends the second control instruction to the data conversion interface 3, the data conversion interface 3 receives the second control instruction and converts the second control instruction into a control instruction identifiable by the simulation environment generation module 2, and the simulation environment generation module 2 applies the identifiable control instruction to the virtual vehicle so that the virtual vehicle can operate in a virtual scene.
In the embodiment provided by the invention, if the result of the operation of the virtual vehicle in the virtual scene reaches the set test target after the simulation environment generation module applies the recognizable control command to the virtual vehicle, the second automatic driving simulation system is verified successfully aiming at the test target. In addition, different test targets can be set, and the second automatic driving simulation system can be tested according to the different test targets.
Furthermore, in an embodiment provided according to the present invention, the test system may further include a second automatic driving simulation system, as shown in fig. 2. Fig. 2 is a block diagram of a test system for an automatic driving simulation system according to another embodiment of the present invention. The test system shown in fig. 2 differs from the test system shown in fig. 1 in that a second autopilot simulation system is included.
In an embodiment provided in accordance with the present invention, the first operating environment may be a Windows operating environment and the second operating environment may be a Linux operating environment. The simulation environment generation module can be based on PreScan or based on Carsim, and PreScan and Carsim are relatively mature commercial simulation software. If the simulation environment generation module is based on the PreScan, the data conversion interface comprises a PreScan-Matlab interface and a Matlab-Ros interface. The Prescan-Matlab interface is an interactive interface between Prescan and Matlab, the Matlab-Ros interface is an interactive interface between Matlab and Ros, and the interface is an application programming interface. The PreScan system and the Ros system cannot directly transmit information, but both the PreScan system and the Ros system can be in butt joint with Matlab, so that Matlab can be considered as an information transfer station between the PreScan system and the Ros system, that is, a PreScan-Matlab interface and a Matlab-Ros interface can be used for transmitting information between PreScan and Ros. The PreScan-Matlab interface and the Matlab-Ros interface can be implemented by methods known to those skilled in the art (e.g., programming methods), which are not described herein.
Fig. 3 is a block diagram of a test system for an automatic driving simulation system according to another embodiment of the present invention. As shown in fig. 3, the test system includes a first autopilot simulation system 1 and a second autopilot simulation system 4, the first autopilot simulation system 1 includes a simulation environment generation module 2 and a data conversion interface 3, and the data conversion interface 3 includes a PreScan-Matlab interface 5 and a Matlab-Ros interface 6. In this embodiment, the first autopilot simulation system 1 is in the Windows operating environment, the second autopilot simulation system 4 is in the Linux operating environment, and the simulation environment generation module 2 is based on PreScan. In the embodiment, a vehicle simulation environment is built on the basis of a simulation environment generation module 2 of the Prescan, wherein the vehicle simulation environment comprises a virtual vehicle, a virtual sensor and a virtual scene; the PreScan-Matlab interface 5 reads sensor data generated by the virtual sensor, the Matlab-Ros interface 6 converts the sensor data into sensor data which can be recognized by the second automatic driving simulation system 4 based on the Ros system under the Linux operating environment and sends the recognizable sensor data to the second automatic driving simulation system 4; the second automatic driving simulation system 4 receives the identifiable sensor data, generates a second control instruction according to the identifiable sensor data and a set test target, and sends the second control instruction to the Matlab-Ros interface 6; the Matlab-Ros interface 6 receives the second control instruction and converts the second control instruction into a control instruction which can be received by a simulation environment based on Prescan; the Prescan-Matlab interface 5 receives the control instruction which can be identified by the simulation environment based on the Prescan and transmits the control instruction to the simulation environment generation module 2; the simulated environment generation module 2 applies the identifiable control instructions to the virtual vehicle to cause the virtual vehicle to operate in a virtual scene. If the result of the virtual vehicle running in the virtual scene after the recognizable control command is applied to the virtual vehicle reaches the set test target, the second automatic driving simulation system 4 is successfully verified against the set test target. In this way, verification of the second autopilot simulation system in conjunction with the first autopilot simulation system is achieved so that the second autopilot simulation system can achieve seamless docking with a real vehicle.
FIG. 4 is a flow chart of a testing method for an automated driving simulation system provided in accordance with an embodiment of the present invention. As shown in fig. 4, the test method includes the steps of:
step S41: generating a vehicle simulation environment, namely, generating a vehicle simulation environment by a simulation environment generation module of the first automatic driving simulation system under the first operation environment, wherein the vehicle simulation environment comprises a virtual vehicle, a virtual sensor and a virtual scene; the simulation environment generation module can generate a first control instruction according to the sensor data generated by the virtual sensor and a set test target, and apply the first control instruction to the virtual vehicle to enable the virtual vehicle to run in a virtual scene;
step S42: converting sensor data, i.e., a data conversion interface of the first autopilot simulation system reads sensor data and converts the sensor data into sensor data recognizable by a second autopilot simulation system in a second operating environment;
step S43: generating a second control instruction, namely, the second automatic driving simulation system receives the identifiable sensor data, generates a second control instruction according to the identifiable sensor data and a set test target, and sends the second control instruction to a data conversion interface;
step S44: converting the second control instruction into a recognizable control instruction, namely, receiving the second control instruction by the data interface, and converting the second control instruction into the recognizable control instruction of the simulation environment generation module;
step S45: the identifiable control instructions are applied, i.e., the simulation environment generation module applies the identifiable control instructions to the virtual vehicle to cause the virtual vehicle to operate in the virtual scene.
Therefore, the simulation environment is built in the first automatic driving simulation system under the first operation environment, and the data and control instructions are transmitted between the first automatic driving simulation system and the second automatic driving simulation system under the second operation environment through the data conversion interface, so that the process that the second automatic driving simulation system controls the vehicle to run in the simulation environment is realized.
In addition, in an embodiment provided according to the present invention, the test method may further include confirming that the second automatic driving simulation system is successfully verified with respect to the set test target if a result of the virtual vehicle running in the virtual scene reaches the set test target after the recognizable control command is applied to the virtual vehicle. In this way, verification of the second autopilot simulation system is achieved. In the embodiment provided by the invention, different test targets can be set, such as turning at an intersection, keeping straight, stopping in a red light, stopping in an obstacle and the like, and whether the second automatic driving simulation system can be verified successfully or not can be confirmed. When different test targets are set and the second automatic driving simulation system is verified successfully, the second automatic driving simulation system can be directly applied to the actual vehicle.
FIG. 5 is a flow chart of a testing method for an automated driving simulation system provided in accordance with another embodiment of the present invention. The flowchart shown in fig. 5 differs from the flowchart shown in fig. 4 in that, in this embodiment, the test method further includes the following steps after step S55 (step S45 in fig. 4):
step S56: judging whether the verification is successful, namely judging whether the running result of the virtual vehicle in the virtual scene after the recognizable control command is applied to the virtual vehicle reaches a set test target, if so, confirming that the second automatic driving simulation system is successfully verified aiming at the set test target, and if not, confirming that the second automatic driving simulation system is not successfully verified aiming at the set test target; if the verification is successful, executing step S57, otherwise, executing step S58;
step S57: judging whether the verification of all the test targets is finished, setting different test targets such as turning at an intersection, keeping straight, stopping when meeting a red light, stopping when meeting an obstacle and the like, judging whether the second automatic driving simulation system can be successfully verified, if so, executing a step S60, and otherwise, executing a step S59;
step S58: modifying the algorithm, namely if the verification fails, indicating that the algorithm in the second automatic driving simulation system does not meet the condition, modifying the algorithm, and after the algorithm is modified, repeating the process of the test method from the step S53, if the verification fails, continuously modifying the algorithm until the second automatic driving simulation system is verified successfully;
step S59: replacing the set test target, and executing the steps S52 circularly after the set test target is replaced until the second automatic driving simulation system is verified successfully under the condition of different set test targets; and
step S60: the second automatic driving simulation system is applied to the actual vehicle.
Therefore, the process of verifying the second automatic driving simulation system by combining the first automatic driving simulation system is realized, the reliability of the second automatic driving simulation system is ensured, and the second automatic driving simulation system is directly butted with the actual vehicle to complete the driving of the actual vehicle under the condition that the second automatic driving simulation system is successfully verified. In the process, extra conversion development requirements are not needed from the simulation environment to the real vehicle environment, and the method is efficient and convenient.
In an embodiment provided in accordance with the present invention, the first operating environment may be a Windows operating environment, and the second operating environment may be a Linux operating environment; the simulation environment generation module can be based on PreScan or Carsim, and PreScan and Carsim are relatively mature commercial simulation software. If the simulation environment generation module is based on the PreScan, the data conversion interface comprises a PreScan-Matlab interface and a Matlab-Ros interface. The PreScan-Matlab interface is used for reading sensor data generated by the virtual sensor or receiving a control instruction which can be identified by a simulation environment based on PreScan; and the Matlab-Ros interface is used for converting the sensor data into sensor data which can be identified by a second automatic driving simulation system based on the Ros system under the Linux operation environment and sending the identifiable sensor data or receiving a second control instruction and converting the second control instruction into a control instruction which can be received by the simulation environment based on Prescan.
Fig. 6 is a schematic diagram of testing and application of the automatic driving simulation system provided according to the embodiment of the present invention. In this embodiment, the first autopilot system 1 comprises a PreScan-based simulation environment generation module 2, a PreScan-Matlab interface 5 and a Matlab-Ros interface 6; the first automatic driving system 1 is under Windows operating environment, the first automatic driving system 4 is under Linux operating environment; a vehicle simulation environment is built on the basis of a simulation environment generation module 2 of the Prescan, wherein the vehicle simulation environment comprises virtual vehicles, virtual sensors and virtual scenes; the PreScan-Matlab interface 5 reads sensor data generated by the virtual sensor, the Matlab-Ros interface 6 converts the sensor data into sensor data which can be recognized by the second automatic driving simulation system 4 based on the Ros system under the Linux operating environment, and sends the recognizable sensor data to the second automatic driving simulation system 4 through a network; the second automatic driving simulation system 4 receives the identifiable sensor data, generates a second control instruction according to the identifiable sensor data and a set test target, namely, performs the functions of obstacle detection, lane line identification, decision planning, a control module and the like through a developed algorithm contained in the second control instruction to generate a second control instruction, and sends the second control instruction to the Matlab-Ros interface 6; the Matlab-Ros interface 6 receives the second control instruction and converts the second control instruction into a control instruction which can be received by a simulation environment based on Prescan; the PreScan-Matlab interface 5 receives a control command which can be identified by the simulation environment based on the PreScan and transmits the control command to the simulation environment generation module 2; the simulation environment generation module 2 applies the recognizable control instruction to the virtual vehicle to enable the virtual vehicle to run in a virtual scene, namely, the virtual vehicle is driven to complete one-time position updating according to the second control instruction, and one-time simulation circulation is completed. If the result of the virtual vehicle running in the virtual scene after the recognizable control command is applied to the virtual vehicle reaches the set test target, the second automatic driving simulation system 4 is successfully verified against the set test target. And (3) replacing different test targets to verify the second automatic driving simulation system 4, if the test targets are verified successfully, namely, the closed-loop simulation of the whole system is completed, applying the second automatic driving simulation system 4 to the real vehicle 7, acquiring data of a sensor from the real vehicle, generating a control message through the processing of an algorithm in the second automatic driving simulation system 4, sending the control message to the real vehicle 7, and completing the driving of the real vehicle 7. Therefore, the second automatic driving simulation system 4 carries out simulation test through the first automatic driving simulation system 1 to verify the reliability of the second automatic driving simulation system 4, and the second automatic driving simulation system 4 is applied to the real vehicle 7 under the condition that the reliability is verified, so that extra conversion development requirements are not needed, and the method is efficient and convenient.
In summary, the first automatic driving simulation system is combined to verify the second automatic driving simulation system, and the second automatic driving simulation system is directly docked with the actual vehicle to complete driving of the actual vehicle when the second automatic driving simulation system is successfully verified. Therefore, the reliability of the second automatic driving simulation system and the seamless butt joint of the simulation system and the real system of the real vehicle can be ensured, no extra conversion development requirement is needed from the simulation environment to the real vehicle environment, and the cost is saved, and the method is efficient and convenient.
Although the embodiments of the present invention have been described in detail with reference to the accompanying drawings, the embodiments of the present invention are not limited to the details of the above embodiments, and various simple modifications can be made to the technical solution of the embodiments of the present invention within the technical idea of the embodiments of the present invention, and the simple modifications all belong to the protection scope of the embodiments of the present invention.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, the embodiments of the present invention will not be described separately for the various possible combinations.
Those skilled in the art can understand that all or part of the steps in the method for implementing the foregoing embodiments may be implemented by a program to instruct related hardware, where the program is stored in a storage medium and includes several instructions to enable a (may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In addition, any combination of various different embodiments of the present invention may be made, and the same should be considered as what is disclosed in the embodiments of the present invention as long as it does not depart from the spirit of the embodiments of the present invention.