Vehicle collision avoidance analogue simulation method and system, electronic equipment and product
By creating a vehicle model of a multi-angle ray projection detector in the Unity environment, the problems of inaccurate vehicle shape simulation and insufficient detection range in the prior art are solved, and more accurate vehicle collision detection and more efficient simulation are achieved.
Patent Information
- Application Number
- CN202411589318.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, rectangles or simple geometry cannot accurately simulate the complex shape of the vehicle, resulting in inaccurate collision detection results, and a single detection method cannot cover all collision directions, especially in complex traffic environments, resulting in a degradation of system performance.
The vehicle model is created based on the specified modeling software, and a multi-angle ray projection detector is set up in the physical engine. Collision detection is performed through the physical ray projection detection function, driving the vehicle model to move in the simulated scene and perform collision avoidance actions.
It improves the accuracy of vehicle collision detection and real-time simulation, is suitable for complex traffic environments, reduces data processing volume, and improves system performance.
Smart Images

Figure CN119249762A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer simulation, and in particular relates to a vehicle collision avoidance simulation method, system, electronic equipment and product. Background Art
[0002] At present, when performing vehicle collision simulation detection in Unity (a real-time content development platform widely used in games, automobiles, and industries), rectangular collision triggers and simple spherical / cylindrical collision bodies are generally used, and the collision is predicted by calculating the distance between the collision trigger and the collision body. However, in the process of using the prior art, the inventor found that the prior art has at least the following problems: (1) Collision shape limitations: Rectangles or simple geometric shapes cannot accurately simulate the complex shape of vehicles, resulting in inaccurate collision detection results and prone to misjudgment or missed judgments.
[0003] (2) Insufficient detection range and angle: A single detection method cannot cover all possible collision directions, especially in complex or changing traffic environments.
[0004] (3) Performance bottleneck: In multi-vehicle, high-density traffic simulations, traditional collision detection methods need to process a large amount of data, resulting in a decrease in system performance, affecting real-time performance and user experience. Summary of the invention
[0005] The present invention aims to solve the above technical problems at least to a certain extent. The present invention provides a vehicle collision avoidance simulation method, system, electronic equipment and product.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a vehicle collision avoidance simulation method, comprising: Creating a vehicle model of the vehicle to be tested based on designated modeling software; wherein the vehicle model includes a vehicle body and a collision detector disposed at the front of the vehicle body, the collision detector being used for performing multi-angle ray projection and detection; Building a collision simulation scene based on a specified physical engine, and importing the vehicle model into the collision simulation scene; Based on the specified physical engine, calling the physical ray casting detection function of the specified physical engine in the script of the collision detector, and setting ray emission parameters for the collision detector; Importing a preset obstacle model into the collision simulation scene, and setting the obstacle model as a collision layer; Based on the specified physical engine, a collision avoidance simulation is performed on the vehicle to be tested; wherein, when the collision avoidance simulation is performed on the vehicle to be tested, the vehicle model is driven to move in the collision simulation scene, and ray projection and detection are performed through the collision detector, and then when the ray of the collision detector intersects with the obstacle model in the collision layer, the intersection point position information is obtained through the collision detector, so as to drive the vehicle model to perform a collision avoidance action according to the intersection point position information.
[0007] In a possible design, the vehicle body includes a body grid and a wheel grid, the wheel grid is arranged at the lower part of the body grid, and the collision detector is arranged at the front part of the body grid; the ray emission parameters of the collision detector include the number of ray emissions, the ray emission angle and the ray emission distance, the number of ray emissions is multiple, and the directions of the multiple emission rays matching the number of ray emissions are different.
[0008] In a possible design, a collision simulation scene is constructed based on a specified physics engine, including: Constructing an initial simulation scene based on a specified physical engine; wherein the initial simulation scene includes specified background elements; Creating a virtual vehicle driving route in the initial simulated collision scenario; wherein the virtual vehicle driving route includes a plurality of virtual vehicle path points, and a designated virtual vehicle path point among the plurality of virtual vehicle path points is associated with a stop control signal; Any vehicle virtual path point in the vehicle virtual driving route is set as a vehicle generation point to obtain a collision simulation scene.
[0009] In a possible design, a traffic manager is preset in the designated physical engine, the vehicle model is imported into the collision simulation scenario through the traffic manager, and a collision avoidance simulation is performed on the vehicle to be tested based on the traffic manager.
[0010] In a possible design, driving the vehicle model to move in the collision simulation scenario includes: The vehicle model is driven to travel along a preset designated vehicle virtual driving route, and when a stop control signal is associated with a vehicle virtual path point where the vehicle model is located, the driving state of the vehicle model is adjusted according to the stop control signal; wherein the driving state of the vehicle model includes an acceleration state, a deceleration state, a parking state and a steering state.
[0011] In a possible design, the physical ray casting detection function adopts the PhysicsRaycast function in the Unity engine.
[0012] In a second aspect, the present invention provides a vehicle collision avoidance simulation system, which is used to implement a vehicle collision avoidance simulation method as described in any one of the above; the vehicle collision avoidance simulation system comprises: A model building module, used to create a vehicle model of the vehicle to be tested based on a specified modeling software; wherein the vehicle model includes a vehicle body and a collision detector arranged at the front of the vehicle body, and the collision detector is used to perform ray projection and detection at multiple angles; A scene construction module, which is in communication with the model construction module, is used to construct a collision simulation scene based on a specified physical engine and import the vehicle model into the collision simulation scene; is used to call the physical ray projection detection function of the specified physical engine in the script of the collision detector based on the specified physical engine and set ray emission parameters for the collision detector; and is also used to import a preset obstacle model into the collision simulation scene and set the obstacle model as a collision layer; A simulation driving module is communicatively connected with the scene construction module, and is used to perform collision avoidance simulation on the vehicle to be tested based on the specified physical engine; wherein, when the collision avoidance simulation is performed on the vehicle to be tested, the vehicle model is driven to move in the collision simulation scene, and ray projection and detection are performed through the collision detector, and then when the ray of the collision detector intersects with the obstacle model in the collision layer, the intersection point position information is obtained through the collision detector, so as to drive the vehicle model to perform collision avoidance action according to the intersection point position information.
[0013] In a third aspect, the present invention provides an electronic device, comprising: a memory for storing computer program instructions; and, A processor is used to execute the computer program instructions to complete the operation of a vehicle collision avoidance simulation method as described in any one of the above.
[0014] In a fourth aspect, the present invention provides a computer program product, including a computer program or instructions, which, when executed by a computer, implements a vehicle collision avoidance simulation method as described in any one of the above.
[0015] In a fifth aspect, the present invention provides a computer-readable storage product having instructions stored thereon. When the instructions are run on a computer, a vehicle collision avoidance simulation method as described in any one of the above is executed.
[0016] The beneficial effects of the present invention are: The present invention discloses a vehicle collision avoidance simulation method, system, electronic device and product, which can improve the authenticity of vehicle collision avoidance simulation, and at the same time improve the accuracy of vehicle collision detection results and the real-time performance of simulation. Specifically, during the implementation of the present invention, a vehicle model of the vehicle to be tested is first created based on the specified modeling software, and then a collision simulation scene is constructed based on the specified physical engine, and the vehicle model is imported into the collision simulation scene; then, based on the specified physical engine, the physical ray projection detection function of the specified physical engine is called in the script of the collision detector, and the ray emission parameters are set for the collision detector; then, a preset obstacle model is imported into the collision simulation scene, and the obstacle model is set as a collision layer; finally, a collision avoidance simulation is performed on the vehicle to be tested based on the specified physical engine. In this process, since the vehicle model includes a vehicle body and a collision detector arranged at the front of the vehicle body, the collision detector is used to perform multi-angle ray projection and detection, so that the vehicle model is more closely matched with the actual vehicle to be tested, and multi-angle collision detection can be achieved at the same time, which is suitable for simulation of complex and changeable traffic environments, thereby helping to improve the accuracy of vehicle collision detection results and the authenticity of vehicle collision avoidance simulation; in addition, in the process of collision avoidance simulation of the vehicle to be tested, the present invention realizes physical ray projection and collision detection through the collision detector, which can significantly reduce the amount of data processing, thereby further improving the real-time performance and system performance of the simulation.
[0017] Other beneficial effects of the present invention will be further described in the specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of the vehicle collision avoidance simulation method in Example 1; Figure 2 It is a module block diagram of the vehicle collision avoidance simulation system in Example 2; Figure 3 This is a module block diagram of the electronic device in Example 3. DETAILED DESCRIPTION
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0020] Embodiment 1: This embodiment discloses a vehicle collision avoidance simulation method, which can be executed by, but is not limited to, a computer device or a virtual machine with certain computing resources, such as a personal computer, a smart phone, a personal digital assistant, or a wearable device, or by a virtual machine.
[0021] like Figure 1 As shown, a vehicle collision avoidance simulation method may include but is not limited to the following steps: S1. Creating a vehicle model of the vehicle to be tested based on designated modeling software; wherein the vehicle model includes a vehicle body and a collision detector arranged at the front of the vehicle body, and the collision detector is used to perform multi-angle ray projection and detection; it should be noted that, in this embodiment, the designated modeling software adopts 3ds Max (a 3D modeling, rendering and production software based on a PC system) or other 3D (Three Dimensional) modeling software, which is not limited here, and the vehicle model adopts an FBX format (a three-dimensional model file format) file, which depends on the type of the designated physical engine, which is also not limited here.
[0022] Specifically, in step S1, the vehicle body includes a body grid and a wheel grid, the wheel grid is set at the bottom of the body grid, and the collision detector is set at the front of the body grid; the ray emission parameters of the collision detector include the number of ray emissions, the ray emission angle, and the ray emission distance, the number of ray emissions is multiple, and the multiple emission rays matching the number of ray emissions have different directions. It should be noted that the collision detector can adjust its position and angle according to the collision detection requirements to cover the front of the vehicle model.
[0023] It should be noted that, during the implementation process, the ray emission parameters of the collision detector, such as the ray emission number, ray emission angle and ray emission distance, can be flexibly adjusted according to actual needs to adapt to the collision detection needs of different scenes and vehicle types.
[0024] In this embodiment, the number of ray emissions of the collision detector is set to multiple, and the directions of the multiple rays are different according to the ray emission angle, which can facilitate multi-angle physical ray collision detection during vehicle driving simulation, thereby more accurately simulating the vehicle shape and covering a wider detection range, effectively avoiding misjudgment and missed judgment, and helping to improve the accuracy and flexibility of subsequent collision detection. As an example, in this embodiment, the directions of the multiple rays are multiple angles such as 30 degrees to the left side, 30 degrees to the right side, and straight ahead of the vehicle body grid, so that physical rays can be emitted from multiple collision detectors in the vehicle's forward direction and at different angles on the left and right sides.
[0025] S2. Construct a collision simulation scene based on a specified physical engine, and import the vehicle model into the collision simulation scene; specifically, in this embodiment, the specified physical engine adopts the Unity engine.
[0026] Specifically, in step S2, a collision simulation scene is constructed based on a specified physical engine, including: S201. Construct an initial simulation scene based on a specified physical engine; wherein the initial simulation scene includes specified background elements; specifically, in this embodiment, the specified background elements, such as road elements, building elements, and green elements, are set according to the actual scene in which the vehicle to be tested needs to travel, and are not limited here.
[0027] S202. Create a virtual vehicle driving route in the initial simulated collision scenario; wherein the virtual vehicle driving route includes multiple virtual vehicle path points, and a designated virtual vehicle path point among the multiple virtual vehicle path points is associated with a stop control signal; it should be noted that in this embodiment, the number of virtual vehicle driving routes is single or multiple, and each virtual vehicle driving route is composed of multiple virtual vehicle path points, and all virtual vehicle path points in each virtual vehicle driving route are recorded in an array. wherein, a designated virtual vehicle path point among the multiple virtual vehicle path points is associated with a stop control signal to simulate a traffic light or checkpoint on a real road, and during implementation, a single or multiple designated virtual vehicle path points associated with a stop control signal may be set in a certain virtual vehicle driving route, and after the vehicle arrives at any designated virtual vehicle path point, the processing logic of driving or stopping may be triggered based on the stop control signal matching the designated virtual vehicle path point. the virtual vehicle path point is used to trigger the vehicle to drive to the virtual vehicle path point to be reached in the next step after the vehicle arrives, or to trigger the vehicle to stop according to the associated stop control signal.
[0028] S203. Set any virtual path point of the vehicle in the virtual driving route of the vehicle as the vehicle generation point, so as to obtain a collision simulation scene. It should be noted that, in this embodiment, the vehicle generation point is selected as any virtual path point of the vehicle in any virtual driving route of the vehicle. When the vehicle model is imported into the collision simulation scene, the vehicle model is located at the vehicle generation point, that is, the position of the vehicle generation point is the initial position of the vehicle model in the collision simulation scene.
[0029] S3. Based on the specified physical engine, the physical ray casting detection function of the specified physical engine is called in the script of the collision detector, and the ray emission parameters of the collision detector are set; specifically, in this embodiment, the Unity engine is preset with a Physics Raycast function (used to emit physical rays to detect collisions of objects in the simulated scene) API (Application Programming Interface), and the physical ray casting detection function adopts the Physics Raycast function in the Unity engine (used to emit physical rays to detect collisions of objects in the simulated scene). The Physics Raycast function API in the Unity engine can be used to call the Physics Raycast function to set the ray emission parameters of the collision detector. It should be noted that in this embodiment, calling the physical ray casting detection function of the specified physical engine in the script of the collision detector can enable the collision detector to have ray casting and collision detection functions.
[0030] Specifically, during the implementation of this embodiment, a SensorLength variable can be further created for the Physics Raycast function to control the detection distance of the physical ray. After the SensorLength variable is substituted into the Physics Raycast function, based on the preset FixedUpdate function (used to process physical simulation and time-related logic), three rays are emitted in the forward direction of the vehicle model and two rays are emitted at a default 45-degree angle on the left and right sides of the vehicle model within a fixed time interval (used to implement the principle of vehicles giving way to the right), so that in the subsequent collision avoidance simulation of the vehicle to be tested, when any ray detects an obstacle, the vehicle model will be notified to perform the corresponding collision avoidance action.
[0031] S4. Import the preset obstacle model into the collision simulation scene, and set the obstacle model as the collision layer; specifically, in this embodiment, the Layer in the Inspector panel (an interface for displaying and editing the properties of a specified object and its components) in the Unity engine editor is set as the collision layer. During implementation, the collision detector can be used to detect whether the ray it projects intersects with the obstacle model in the collision layer. If so, the collision detector will record the position and distance of the collision point, and then trigger the corresponding collision processing logic based on this information, such as deceleration or parking.
[0032] S5. Perform collision avoidance simulation on the vehicle to be tested based on the specified physical engine; wherein, when performing collision avoidance simulation on the vehicle to be tested, the vehicle model is driven to move in the collision simulation scene, and ray projection and detection are performed through the collision detector, and then when the ray of the collision detector intersects with the obstacle model in the collision layer, the intersection point position information is obtained through the collision detector, so as to drive the vehicle model to perform collision avoidance action according to the intersection point position information, that is, trigger the corresponding collision processing logic. Specifically, the intersection point is the intersection point of the ray of the collision detector and the obstacle model in the collision layer, and the intersection point position type is the direction and distance of the intersection point relative to the vehicle model.
[0033] It should be noted that, in this embodiment, a traffic manager is preset in the designated physical engine. In step S2, the vehicle model is imported into the collision simulation scene through the traffic manager. In step S5, a collision avoidance simulation is performed on the vehicle to be tested based on the traffic manager. In this embodiment, the traffic manager is used to manage the control logic of vehicle generation and stop control signals. Specifically, in the process of importing the vehicle model into the collision simulation scene, the vehicle model is imported through the traffic manager so that the traffic manager generates a vehicle at the vehicle generation point of the collision simulation scene and manages the driving logic corresponding to the stop control signal.
[0034] Specifically, in step S5, when the collision avoidance simulation is performed on the vehicle to be tested based on the designated physical engine, the vehicle model is driven to travel along the designated vehicle virtual driving route in the collision simulation scene based on the traffic manager in the designated physical engine, and the collision detector is driven to perform ray projection and detection, so that when the ray of the collision detector intersects with the obstacle model in the collision layer, the intersection point position information is obtained through the collision detector, and then the vehicle model is driven to perform collision avoidance action according to the intersection point position information. It should be understood that at the initial moment, the designated vehicle virtual driving route is the vehicle virtual driving route where the vehicle generation point is located.
[0035] Specifically, in step S5, driving the vehicle model to move in the collision simulation scene includes: The vehicle model is driven to travel along a preset designated vehicle virtual driving route, and when a stop control signal is associated with the vehicle virtual path point where the vehicle model is located, the driving state of the vehicle model is adjusted according to the stop control signal; wherein the driving state of the vehicle model includes an acceleration state, a deceleration state, a parking state and a steering state. It should be noted that, in this embodiment, according to different stop control signals, the vehicle model can be driven to accelerate, decelerate, stop or turn, etc., and ensure that these functions can smoothly transition during the simulation process to avoid abrupt driving changes, thereby adjusting the driving state of the vehicle model according to the stop control signal. During the implementation process, based on the designated vehicle virtual driving route, the vehicle model can make a judgment on whether the next vehicle virtual path point is passable at the currently arrived vehicle virtual path point, thereby realizing reasonable driving path planning of the vehicle to be tested, ensuring that the vehicle model can travel along the predetermined route and avoid obstacles.
[0036] Specifically, during the implementation process, the OnTriggerEnter function in the Unity engine (used to detect whether a specified object has collided and provide related events for developers to handle the logic after the collision) and the SendMessage function (used to send messages between specified objects. Through the SendMessage function, methods can be called between specified objects to achieve communication between scripts), and the Trigger trigger is triggered only when the vehicle model reaches the vehicle virtual path point and the message is sent to adjust the driving state of the vehicle model. Based on this, the data processing process is optimized, unnecessary calculations are reduced, and the overall operation efficiency of the system is improved.
[0037] In addition, in the process of driving the vehicle model to move in the collision simulation scene, the basic actions of the vehicle model are implemented through the following main functions in the Unity engine: Breaking (control vehicle braking) function: assigns the value of the BrakeTorque braking force variable to the wheels of the vehicle model and brakes when a stop signal is received; DriveByWayPoint function: when the next target vehicle virtual path point is obtained, the tires of the vehicle model are controlled to face the target vehicle virtual path point and the vehicle model is given driving force according to the MotorTorque variable to drive toward the target path point; UpdateWheelPose function: obtains the rotation coordinates of the wheels of the vehicle model to refresh the rotation effect of the vehicle wheel model; OnReachWayPoint function: used to process the logic of determining the next target vehicle virtual waypoint, the next new route, and whether to allow the vehicle to continue driving when the vehicle model reaches a certain vehicle virtual waypoint, and this function will only execute the logic when receiving the SendMessage function notification.
[0038] In addition, the driving mode of the vehicle model can be further divided into front-wheel drive, rear-wheel drive, and four-wheel drive, which can be customized.
[0039] The present embodiment discloses a vehicle collision avoidance simulation method implemented in a virtual test environment, which can improve the authenticity of the vehicle collision avoidance simulation, and at the same time improve the accuracy of the vehicle collision detection results and the real-time performance of the simulation. Specifically, during the implementation of the present embodiment, a vehicle model of the vehicle to be tested is first created based on the specified modeling software, and then a collision simulation scene is constructed based on the specified physical engine, and the vehicle model is imported into the collision simulation scene; then, based on the specified physical engine, the physical ray projection detection function of the specified physical engine is called in the script of the collision detector, and the ray emission parameters are set for the collision detector; then, a preset obstacle model is imported into the collision simulation scene, and the obstacle model is set as a collision layer; finally, a collision avoidance simulation is performed on the vehicle to be tested based on the specified physical engine. In this process, since the vehicle model includes a vehicle body and a collision detector arranged at the front of the vehicle body, the collision detector is used to perform multi-angle ray projection and detection, so that the vehicle model is more closely matched with the actual vehicle to be tested, and multi-angle collision detection can be achieved at the same time, which is suitable for simulation of complex and changeable traffic environments, thereby helping to improve the accuracy of vehicle collision detection results and the authenticity of vehicle collision avoidance simulation; in addition, in the process of collision avoidance simulation of the vehicle to be tested, this embodiment uses the collision detector to realize physical ray projection and collision detection, which can significantly reduce the amount of data processing, thereby further improving the real-time performance and system performance of the simulation.
[0040] Embodiment 2: This embodiment discloses a vehicle collision avoidance simulation system, which is used to implement the vehicle collision avoidance simulation method in embodiment 1; Figure 2 As shown, the vehicle collision avoidance simulation system includes: A model building module, used to create a vehicle model of the vehicle to be tested based on a specified modeling software; wherein the vehicle model includes a vehicle body and a collision detector arranged at the front of the vehicle body, and the collision detector is used to perform ray projection and detection at multiple angles; A scene construction module, which is in communication with the model construction module, is used to construct a collision simulation scene based on a specified physical engine and import the vehicle model into the collision simulation scene; is used to call the physical ray projection detection function of the specified physical engine in the script of the collision detector based on the specified physical engine and set ray emission parameters for the collision detector; and is also used to import a preset obstacle model into the collision simulation scene and set the obstacle model as a collision layer; A simulation driving module is communicatively connected with the scene construction module, and is used to perform collision avoidance simulation on the vehicle to be tested based on the specified physical engine; wherein, when the collision avoidance simulation is performed on the vehicle to be tested, the vehicle model is driven to move in the collision simulation scene, and ray projection and detection are performed through the collision detector, and then when the ray of the collision detector intersects with the obstacle model in the collision layer, the intersection point position information is obtained through the collision detector, so as to drive the vehicle model to perform collision avoidance action according to the intersection point position information.
[0041] It should be noted that the working process, working details and technical effects of the vehicle collision avoidance simulation system provided in this embodiment 2 can be found in embodiment 1 and will not be described in detail here.
[0042] Embodiment 3: Based on Embodiment 1 or 2, this embodiment discloses an electronic device, which may be a smart phone, a tablet computer, a laptop computer, or a desktop computer. The electronic device may be referred to as a user terminal, a portable terminal, a desktop terminal, etc. Figure 3 As shown, the electronic equipment includes: a memory for storing computer program instructions; and, A processor is used to execute the computer program instructions to complete the operation of a vehicle collision avoidance simulation method as described in any one of Example 1.
[0043] Specifically, the processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen.
[0044] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the vehicle collision avoidance simulation method provided in Example 1 of the present application.
[0045] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.
[0046] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0047] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with a communication network and other communication devices through electromagnetic signals.
[0048] The display screen 305 is used to display a UI (User Interface). The UI may include any combination of graphics, text, icons, and videos.
[0049] The power supply 306 is used to supply power to various components in the electronic device.
[0050] Embodiment 4: Based on any one of Embodiments 1 to 3, this embodiment discloses a computer program product, including a computer program or an instruction, wherein when the computer program or the instruction is executed by a computer, a vehicle collision avoidance simulation method as described in any one of Embodiments 1 is implemented. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0051] Embodiment 5: Based on any one of embodiments 1 to 3, this embodiment discloses a computer-readable storage product, on which instructions are stored, and when the instructions are run on a computer, a vehicle collision avoidance simulation method as described in any one of embodiment 1 is executed. The computer-readable storage product refers to a carrier for storing data, which may include but is not limited to computer-readable storage media such as floppy disks, optical disks, hard disks, flash memories, USB flash drives, and / or memory sticks, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0052] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle collision avoidance simulation method, characterized in that: include: Creating a vehicle model of the vehicle to be tested based on designated modeling software; wherein the vehicle model includes a vehicle body and a collision detector disposed at the front of the vehicle body, the collision detector being used for performing multi-angle ray projection and detection; Building a collision simulation scene based on a specified physical engine, and importing the vehicle model into the collision simulation scene; Based on the specified physical engine, calling the physical ray casting detection function of the specified physical engine in the script of the collision detector, and setting ray emission parameters for the collision detector; Importing a preset obstacle model into the collision simulation scene, and setting the obstacle model as a collision layer; Based on the specified physical engine, a collision avoidance simulation is performed on the vehicle to be tested; wherein, when the collision avoidance simulation is performed on the vehicle to be tested, the vehicle model is driven to move in the collision simulation scene, and ray projection and detection are performed through the collision detector, and then when the ray of the collision detector intersects with the obstacle model in the collision layer, the intersection point position information is obtained through the collision detector, so as to drive the vehicle model to perform a collision avoidance action according to the intersection point position information.
2. The vehicle collision avoidance simulation method according to claim 1, characterized in that: The vehicle body includes a body grid and a wheel grid, the wheel grid is arranged at the lower part of the body grid, and the collision detector is arranged at the front part of the body grid; the ray emission parameters of the collision detector include the number of ray emissions, the ray emission angle and the ray emission distance, the number of ray emissions is multiple, and the directions of the multiple emission rays matching the number of ray emissions are different.
3. The vehicle collision avoidance simulation method according to claim 1, characterized in that: Build a collision simulation scene based on the specified physics engine, including: Constructing an initial simulation scene based on a specified physical engine; wherein the initial simulation scene includes specified background elements; Creating a virtual vehicle driving route in the initial simulated collision scenario; wherein the virtual vehicle driving route includes a plurality of virtual vehicle path points, and a designated virtual vehicle path point among the plurality of virtual vehicle path points is associated with a stop control signal; Any vehicle virtual path point in the vehicle virtual driving route is set as a vehicle generation point to obtain a collision simulation scene.
4. The vehicle collision avoidance simulation method according to claim 3, characterized in that: The designated physical engine is preset with a traffic manager, the vehicle model is imported into the collision simulation scenario through the traffic manager, and a collision avoidance simulation is performed on the vehicle to be tested based on the traffic manager.
5. The vehicle collision avoidance simulation method according to claim 3, characterized in that: Driving the vehicle model to move in the collision simulation scene includes: The vehicle model is driven to travel along a preset designated vehicle virtual driving route, and when a stop control signal is associated with a vehicle virtual path point where the vehicle model is located, the driving state of the vehicle model is adjusted according to the stop control signal; wherein the driving state of the vehicle model includes an acceleration state, a deceleration state, a parking state and a steering state.
6. The vehicle collision avoidance simulation method according to claim 1, characterized in that: The physical ray casting detection function adopts the Physics Raycast function in the Unity engine.
7. A vehicle collision avoidance simulation system, characterized in that: Used to implement a vehicle collision avoidance simulation method as described in any one of claims 1 to 6; the vehicle collision avoidance simulation system comprises: A model building module, used to create a vehicle model of the vehicle to be tested based on a specified modeling software; wherein the vehicle model includes a vehicle body and a collision detector arranged at the front of the vehicle body, and the collision detector is used to perform ray projection and detection at multiple angles; A scene construction module, which is in communication with the model construction module, is used to construct a collision simulation scene based on a specified physical engine and import the vehicle model into the collision simulation scene; is used to call the physical ray projection detection function of the specified physical engine in the script of the collision detector based on the specified physical engine and set ray emission parameters for the collision detector; and is also used to import a preset obstacle model into the collision simulation scene and set the obstacle model as a collision layer; A simulation driving module is communicatively connected with the scene construction module, and is used to perform collision avoidance simulation on the vehicle to be tested based on the specified physical engine; wherein, when the collision avoidance simulation is performed on the vehicle to be tested, the vehicle model is driven to move in the collision simulation scene, and ray projection and detection are performed through the collision detector, and then when the ray of the collision detector intersects with the obstacle model in the collision layer, the intersection point position information is obtained through the collision detector, so as to drive the vehicle model to perform collision avoidance action according to the intersection point position information.
8. An electronic device, characterized in that: include: a memory for storing computer program instructions; as well as, A processor is used to execute the computer program instructions to complete the operation of a vehicle collision avoidance simulation method as described in any one of claims 1 to 6.
9. A computer program product comprising a computer program or instructions, characterized in that The computer program or the instruction, when executed by a computer, implements a vehicle collision avoidance simulation method as described in any one of claims 1 to 6.
10. A computer readable storage product, characterized in that: The computer-readable storage product stores instructions, and when the instructions are executed on a computer, a vehicle collision avoidance simulation method as described in any one of claims 1 to 6 is executed.
