A vehicle simulation model modeling method and a test judgment method
By acquiring the actual parameters of the test vehicle to build a detailed vehicle simulation model, adding car components and parameters in Unity3D, setting speed calculation methods, and setting rule triggers and judgment rules in the simulated test scenario, the problems of inaccurate vehicle modeling and inaccurate judgment in existing technologies are solved, achieving a more realistic and accurate simulated test.
Patent Information
- Application Number
- CN202310065067.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-13
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-01-13
AI Technical Summary
Existing online simulation test training equipment suffers from inaccurate vehicle modeling, unrealistic driving simulations, and inaccurate test judgments, leading to problems during actual operation.
By obtaining the actual parameters of the test vehicle, a detailed vehicle simulation model is established, and car components and parameters are added in Unity3D. The speed calculation method is set, and rule triggers and judgment rules are set in the simulated test scenario to create a realistic test environment.
It improves the accuracy and judgment of mock exams, making them closer to actual operation, providing a more realistic sense of the situation and more accurate results.
Smart Images

Figure CN116204977B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle simulation testing, and more specifically, to a vehicle simulation modeling method and a testing judgment method. Background Technology
[0002] With the development of technology and the advancement of the internet, people can access a vast amount of information online. However, much technical knowledge still requires practical experience to master, including car driving skills. While theoretical knowledge such as the first subject (Subject 1) can be learned online for driving license exams, practical exams like Subject 2 and Subject 3 require in-person training at a testing site. This prevents convenient, time-consuming training and makes it difficult to practice anytime, anywhere. Although many online simulation training devices exist, their models of vehicles and driving simulations are often inaccurate, as are the simulations of testing sites. Furthermore, their judgments are often unreliable, leading to numerous problems even after online training during actual driving practice. Summary of the Invention
[0003] This invention aims to overcome at least one of the defects of the prior art mentioned above, and provides a vehicle simulation modeling method and an examination judgment method to solve the problems of insufficient accuracy in online simulation examination training models and insufficient accuracy in examination judgment.
[0004] The technical solution adopted in this invention is:
[0005] A method for modeling a vehicle simulation model is provided, the modeling method comprising:
[0006] S1: Obtain the actual parameters of the test vehicle and build a model based on the actual data;
[0007] S2: Import the modeled vehicle into the Unity3D project and add car components to it;
[0008] S3: Set the vehicle start parameters, gear parameters, powertrain parameters, vehicle status parameters, engine parameters, and input coefficients for a vehicle model with added vehicle components;
[0009] S4: Set the speed calculation method for the vehicle model according to the parameters set in step S3 to obtain the test vehicle simulation model.
[0010] By acquiring actual data from the test vehicles to create a model, and setting various detailed parameters for the model in Unity3D, the simulation model of the test vehicles is made more refined, and the driving data obtained when simulating driving through the test vehicle simulation model is more accurate.
[0011] Furthermore, the automotive components in step S2 include: a wheel collider, a conventional collider, and a rigid body component;
[0012] Adding wheel colliders specifically involves adding WheelCollider wheel collision components to the wheels of the vehicle model in Unity3D.
[0013] Adding common colliders specifically includes: adding four spherical colliders (front, rear, left, and right) to the vehicle model in Unity3D, as well as adding a square collider for the vehicle body.
[0014] Adding a rigid body component specifically includes: adding a Rigidbody component to the vehicle model in Unity3D, setting the Mass parameter value according to the actual parameter data of the test vehicle, and checking the UseGravity option of the Rigidbody component.
[0015] Add corresponding collision devices to the vehicle model to simulate the vehicle, making the simulation more detailed. Simultaneously, add rigid body components and set the mass parameter value according to the actual parameters of the test vehicle, specifically the vehicle weight, and apply the gravity option to simulate the vehicle's weight, further improving the precision of the vehicle simulation and making the simulation data more accurate and realistic.
[0016] Furthermore, the vehicle starting parameters in step S3 include: power off state, power on state, and vehicle start state;
[0017] And / or, the gear parameters include: manual gear parameters and automatic gear parameters;
[0018] The manual gear parameters include: neutral, first gear, second gear, third gear, fourth gear, fifth gear, and reverse gear; the automatic gear parameters include: parking gear, forward gear, and reverse gear.
[0019] And / or, the powertrain parameters include: maximum wheel offset angle, transmission efficiency, brake pedal torque, and braking curve;
[0020] And / or, the vehicle status parameters include: gear ratios of each gear, wheel torque, minimum and maximum speeds of each gear, idle speeds of each gear, and foot brake torque.
[0021] And / or, the vehicle engine parameters include: maximum engine speed, minimum engine speed, speed-output power relationship curve, speed ratio of the curve, idle torque, speed increase limit, speed decrease limit, downshift deceleration acceleration, and engine-to-wheel torque conversion coefficient;
[0022] And / or, the input coefficients include: steering wheel input, clutch input, brake input, accelerator input, and handbrake switch.
[0023] Detailed parameters are set for each part that requires calculation. These detailed parameters make the calculation of vehicle motion more accurate and the simulated vehicle more realistic. Among them, the car start parameters, gear parameters, and input coefficients need to be matched with external equipment, while the power system parameters, car status parameters, and car engine parameters are obtained based on the actual vehicle data.
[0024] Furthermore, the speed calculation method in step S3 includes the ApplyDrive method;
[0025] The ApplyDrive method is specifically as follows:
[0026] When the current vehicle speed is less than the minimum speed of the current gear, calculate the current torque of the vehicle, distribute the current torque of the vehicle evenly to the drive wheels to obtain the forward torque of each drive wheel, and calculate the vehicle rigid body speed based on the forward torque.
[0027] The drive wheels are the wheels that actually propel the vehicle forward.
[0028] The vehicle rigid body velocity is the theoretical velocity of the vehicle model.
[0029] Furthermore, the calculation of the vehicle's current torque specifically involves:
[0030] Vehicle current torque = idle torque * current gear ratio * transmission efficiency * clutch input + torque at current engine speed * throttle input * clutch input * transmission efficiency;
[0031] The torque at the current engine speed is calculated based on the vehicle engine parameters.
[0032] The initial vehicle speed and the vehicle model are set to 0 when they are not started.
[0033] The idle torque, current gear ratio, and transmission efficiency used in the specific calculations are obtained from the actual parameters of the test vehicle. This ensures that the specific conditions of the actual vehicle are taken into account during the calculations, achieving a more realistic simulation effect. The vehicle rigid body velocity is the theoretical velocity of the vehicle model. When the vehicle is not running, it needs to be calculated based on the wheel torque to obtain the initial vehicle rigid body velocity, which is the vehicle's starting speed. This velocity is then updated synchronously as the vehicle gradually increases in speed.
[0034] Furthermore, the speed calculation method in step S3 also includes the CarSpeed method;
[0035] The CarSpeed method is specifically as follows:
[0036] Obtain the normalized velocity of the vehicle's rigid body;
[0037] Calculate the minimum speed limit for the current gear, where the minimum speed limit for the current gear = (maximum speed for the current gear - minimum speed for the current gear) * throttle input + idle speed for the current gear;
[0038] When the vehicle's rigid body velocity is greater than the maximum speed of the current gear, the current vehicle speed is calculated as follows:
[0039] Current vehicle speed = maximum speed in current gear * normalized vehicle rigid body speed; and update the vehicle rigid body speed to the current vehicle speed;
[0040] When the vehicle rigid body velocity value is greater than the minimum speed limit of the current gear and less than the maximum speed of the current gear, an intermediate speed speedVal is defined. The speedVal is calculated as: vehicle rigid body velocity value - downshift deceleration acceleration * time; where time is the interval between the last frame and the current frame, in seconds; current vehicle speed = speedVal value when it is greater than 0 * normalized vehicle rigid body velocity; and the vehicle rigid body velocity is updated to the current vehicle speed.
[0041] Then, the vehicle's current standardized speed is calculated as follows: current speed * 3.6, and the current speed is standardized to km / h. The normalization method for obtaining the vehicle's rigid body velocity is the `normalized` method in Unity3D, which normalizes the rigid body velocity into a directional vector. The current vehicle speed calculated using this normalized rigid body velocity has the same direction as the rigid body velocity. Since the previous time calculation was in seconds, while vehicle speed is typically measured in km / h, the current vehicle speed needs to be standardized after calculation, converting the unit to km / h to obtain the vehicle's current standardized speed. In addition, to simulate the vehicle's driving process, a minimum speed limit for the current gear is defined. The formula for calculating the minimum speed limit for the current gear is: Minimum speed limit for the current gear = (Maximum speed of the current gear - Minimum speed of the current gear) * Throttle input + Idle speed of the current gear. That is to say, when there is no throttle input, the rigid body speed of the vehicle model will decrease, but it will be limited to the idle speed of the current gear due to the minimum speed limit for the current gear. When there is throttle input, even if the vehicle model decelerates and the rigid body speed decreases, it will still be limited to the minimum of: (Maximum speed of the current gear - Minimum speed of the current gear) * Throttle input + Idle speed of the current gear.
[0042] This invention also provides a vehicle simulation test judgment method, which uses a test vehicle simulation model established by the vehicle simulation model modeling method described above, the method comprising:
[0043] A1: Create an initial exam scenario model based on real exam scenarios and import it into Unity3D;
[0044] A2: Use the vehicle simulation modeling method described above to establish a simulation model of the test vehicle based on the information of the test vehicle;
[0045] A3: Set rules for the different exam items;
[0046] A4: Based on the rules of the exam items, set rule triggers and judgment rules for the initial exam scenario model to generate a simulated exam scenario model;
[0047] A5: Import the simulated exam scenario model and the simulated exam vehicle model with the set rule triggers and judgment rules into the system of the external car simulation equipment, and match the simulated exam vehicle model with the operating equipment in the car simulation equipment, and establish the conversion rules between the operating data of the operating equipment and the simulation data of the simulated exam vehicle model.
[0048] A6: The end user inputs operation data through the operation device, and the car simulation device converts the operation data into simulation data of the test vehicle simulation model according to the conversion rules;
[0049] A7: The car simulation equipment drives the test vehicle simulation model to run in the simulated test scenario model according to the simulation data, and determines the score according to the rule triggers and judgment rules.
[0050] By using real-world exam scenarios to build an initial scenario model, the simulated exam can realistically replicate the actual exam environment, achieving a more authentic and immersive experience. Based on the exam items, rule triggers and judgment rules are set for the initial scenario model to obtain a simulated scenario model. Simultaneously, a pre-configured exam vehicle simulation model is imported into the car simulation device. The vehicle simulation model has various parameters pre-set, and the car simulation device is equipped with corresponding operating devices for simulated driving, such as a steering wheel and accelerator. These operating devices are matched with the vehicle simulation model, and conversion rules are established between the input data from the operating devices and the simulated data from the exam vehicle simulation model. For example, the conversion rules for the steering wheel rotation angle of the operating devices and the steering wheel input of the exam vehicle simulation model are established. After establishing the rules, users can send operating data to the car simulation device, which then converts this data into simulated data for the exam vehicle simulation model. The exam vehicle simulation model then simulates driving within the simulated exam scenario model based on this simulated data. During the driving process, data fed back from the rule triggers is used to determine the end-user's score according to the judgment rules. By setting detailed parameters for the test vehicle simulation model and establishing a set of conversion rules with the car simulation equipment, the judgment criteria for the simulated test are made more detailed, and the results are more accurate.
[0051] Furthermore, the specific steps for establishing an initial exam scenario model based on real exam scenarios are as follows:
[0052] The actual exam scene is sampled using aerial modeling or oblique photography techniques, and the sampling results are processed and optimized using Maya3D to obtain an initial exam scene model that is consistent with the layout of the actual scene environment.
[0053] We use real-world testing environments for sampling and build a model that matches the layout of the actual testing environment to make the model more realistic and the test results more accurate.
[0054] Furthermore, the specific steps for setting the rule trigger include:
[0055] A41: Use Cube in Unity3D to create a cube model;
[0056] A42: Add a collider component to the created cube model;
[0057] A43: In Unity3D, set the cube model's property to trigger to make the cube model a standard trigger;
[0058] A44: Mark the locations in the initial exam scenario model that require rule determination as trigger points;
[0059] A45: At each trigger point, multiple standard triggers are set according to steps A41-A43;
[0060] A46: Set parameters and rules for each standard trigger according to the rules of the exam items and the scenarios in the initial exam scenario model, so that the standard triggers become rule triggers.
[0061] Furthermore, the step of setting multiple standard triggers specifically includes setting the standard triggers at each trigger point in the simulated exam scenario model, at the start, process, and end positions of rule determination at the trigger point.
[0062] A standard trigger is set at the beginning and end of the process, and one or more standard triggers are set at the process.
[0063] In the simulated exam scenario model, standard triggers are set at the start, middle, and end positions of each location requiring rule judgment. The standard trigger at the start position determines the beginning of the judgment item, the standard trigger at the end position determines the end of the judgment item, and the standard trigger at the middle position sets the specific rules. One or more triggers are set as needed to perform rule judgments. This detailed approach, down to each location requiring judgment and with specific rules set accordingly, makes the judgments more precise and further improves the accuracy of the results.
[0064] The parameters set for each standard trigger include position data and scale data. Based on the position and scale data, the position, height, and size of the standard trigger can be set.
[0065] The determination rules mentioned therein include preset determination rules;
[0066] The preset judgment rules include: speed limit rules, headlight rules, line crossing rules, and engine shutdown rules.
[0067] In addition, the judgment rules also include examination judgment rules;
[0068] The examination judgment rules include rules set according to the examination items.
[0069] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0070] 1. This invention collects data from test vehicles to create models, and then sets various detailed parameters for the models to achieve more refined simulation of the test vehicles, thereby improving the accuracy of the simulation test.
[0071] 2. This invention models real-world exam scenarios, sets rule triggers for each location requiring judgment, and sets rule triggers for judgment at the start, process, and end of the judgment. Furthermore, detailed judgment rules are set in the process rule triggers, further improving the accuracy of the judgment.
[0072] 3. This invention establishes a conversion rule between the operating device of the displayed car simulation equipment and the test vehicle simulation model, which can obtain more detailed data information of the test vehicle model, further improving the accuracy of judgment and expanding the scope of judgment. Attached Figure Description
[0073] Figure 1 This is a flowchart of the steps in Embodiment 1 of the present invention.
[0074] Figure 2 The following is a flowchart of the steps in Embodiment 2 of the present invention. Figure 1 .
[0075] Figure 3 The following is a flowchart of the steps in Embodiment 3 of the present invention. Figure 2 . Detailed Implementation
[0076] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the invention. To better illustrate the following embodiments, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions; it is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0077] Example 1
[0078] like Figure 1 As shown in the figure, this embodiment provides a vehicle simulation modeling method, the modeling method including:
[0079] S1: Obtain actual data of the test vehicles and build a model based on that data;
[0080] S2: Import the modeled vehicle into the Unity3D project and add car components to it;
[0081] The automotive components added in this step include: wheel impactors, conventional impactors, and rigid body components.
[0082] Adding wheel colliders specifically involves adding WheelCollider components to each wheel of the vehicle model in Unity3D to mimic wheel movement. Adding wheel colliders also materializes each wheel, allowing you to set specific variables and parameters for each wheel by calling the Unity3D WheelCollider API. These variables include motorTorque, steerAngle, breakTorque, and rpm. motorTorque represents the motor torque on the wheel axle, i.e., the forward torque, used to adjust wheel rotation. steerAngle represents the wheel's steering angle, used to adjust wheel steering, and needs to be matched with the input. breakTorque represents the braking torque used for braking the vehicle model. rpm represents the wheel's rotational speed per minute, which can be used to calculate the vehicle model's speed.
[0083] Adding a regular collider specifically involves adding four spherical colliders (front, rear, left, and right) to the vehicle model in Unity3D, as well as a square collider to the vehicle body, thus providing the basis for physical collision detection for the vehicle model.
[0084] Adding a rigid body component involves adding a Rigidbody component to the vehicle model in Unity3D, setting the Mass parameter value according to the actual parameter data of the test vehicle, keeping the other parameters unchanged, and checking the Use Gravity option of the Rigidbody component to simulate the weight of the vehicle, so that it has better physical effects during operation, thereby obtaining better simulation results.
[0085] S3: Set the vehicle start parameters, gear parameters, powertrain parameters, vehicle status parameters, engine parameters, and input coefficients for a vehicle model with added vehicle components;
[0086] In this step, many parameters are set for the vehicle model, including:
[0087] The car starting parameters include: power off, power on, and car starting status, simulating the car starting process as the basis for the test assessment.
[0088] And / or, the gear parameters include: manual gear parameters and automatic gear parameters;
[0089] The manual gear parameters include: neutral, first gear, second gear, third gear, fourth gear, fifth gear, and reverse gear; the automatic gear parameters include: parking gear, forward gear, and reverse gear.
[0090] Specifically, the aforementioned parameters need to be obtained from external devices and assigned values. For example, whether the external device is powered on is assigned a value for the power-off state and the power-on state; whether the vehicle is started after the power is on is assigned a value for the vehicle-starting state; and then, the gear engagement status of the external device during startup is assigned a value for the corresponding gear in the manual transmission parameter or the corresponding gear in the automatic transmission parameter. It is worth noting that in this embodiment, the external device can be any of the existing technologies, possessing a complete simulation of vehicle operation and supporting the Unity3D operating system.
[0091] And / or, the powertrain parameters include: maximum wheel offset angle, transmission efficiency, brake pedal torque, and braking curve. Specifically, the maximum wheel offset angle varies from vehicle to vehicle and needs to be set based on the actual parameter data of the test vehicle, combined with the steerAngle variable mentioned above, to control the vehicle's steering. The transmission efficiency parameter mainly simulates the transmission efficiency of the gearbox in a real vehicle, so it needs to be set based on the actual parameters obtained from the test vehicle. The brake pedal torque and braking curve are mainly used to simulate the vehicle's braking and need to be combined with specific inputs, but they themselves need to be set based on the actual parameter data of the test vehicle. The braking curve reflects the vehicle's braking capability.
[0092] And / or, the vehicle status parameters include: gear ratios of each gear, current vehicle torque, minimum and maximum speeds of each gear, idle speeds of each gear, and foot brake torque.
[0093] And / or, the vehicle engine parameters include: maximum engine speed, minimum engine speed, speed-to-output power relationship curve, curve speed ratio, idle torque, speed increase limit, speed decrease limit, downshift deceleration acceleration, and engine-to-wheel torque conversion coefficient; wherein the curve speed ratio includes the power-to-RPM curve Rpm ratio and the power-to-RPM curve torque ratio; the vehicle state parameters and vehicle engine parameters are used to calculate the vehicle's speed or braking conditions in each gear, using detailed calculation data to make the results obtained from the simulated vehicle in this embodiment more realistic.
[0094] And / or, the input coefficients include: steering wheel input, clutch input, brake input, accelerator input, and handbrake switch.
[0095] Specifically, end users operate corresponding control devices on external devices, such as the steering wheel, clutch, and brake. These external devices convert the operations into operational data. For ease of understanding, this data is simply represented by numerical values. For example, steering wheel rotation angle is converted to (-1, 1), with -1 for turning the steering wheel fully to the left and 1 for turning it fully to the right; clutch input is converted to (0, 1), with 0 for clutch not depressed and 1 for fully depressed; brake input is converted to (0, 1), with 0 for brake not depressed and 1 for fully depressed; accelerator input is converted to (0, 1), with 0 for accelerator not depressed and 1 for fully depressed; handbrake switch closed is 0, and handbrake switch open is 1. These numerical ranges are then matched with the corresponding parameters in the input coefficients of the test vehicle simulation model. In this embodiment, upon receiving operational data from the external device, the corresponding input coefficients are obtained based on the operational data.
[0096] After setting the parameters, proceed to the next step:
[0097] S4: Set the speed calculation method for the vehicle model according to the parameters set in step S3 to obtain the test vehicle simulation model.
[0098] Speed calculation methods include the ApplyDrive method and the CarSpeed method.
[0099] The ApplyDrive method is specifically as follows:
[0100] First, the current vehicle speed is obtained. Initially, the current vehicle speed is set to 0 when the vehicle model is not running. Then, it is compared with the minimum speed of the current gear. When the current vehicle speed is less than the minimum speed of the current gear, the current torque of the vehicle is calculated. This usually occurs when the vehicle starts or shifts gears. Next, the current torque of the vehicle is evenly distributed to the drive wheels to obtain the forward torque of each drive wheel. Vehicles are generally divided into front-wheel drive, rear-wheel drive, and four-wheel drive. Here, the current torque of the vehicle is evenly distributed to the specific drive wheels according to the actual type of the test vehicle. When it is front-wheel drive, the current torque of the vehicle is divided by 2 and then distributed to the motorTorque parameter of the front wheels, i.e., the forward torque. When it is rear-wheel drive, the current torque of the vehicle is divided by 2 and then distributed to the forward torque of the rear wheels. When it is four-wheel drive, the current torque of the vehicle is divided by 4 and then distributed to the forward torque of each wheel. Finally, the rigid body speed of the vehicle is calculated based on the forward torque.
[0101] The specific calculation of the vehicle's current torque is as follows:
[0102] Vehicle current torque = idle torque * current gear ratio * transmission efficiency * clutch input + torque at current engine speed * throttle input * clutch input * transmission efficiency;
[0103] Of the parameters mentioned above, the idle torque, current gear ratio, and transmission efficiency are obtained by setting the actual parameter data of the test vehicle. The clutch input and throttle input are obtained by converting the operation data of external equipment. The torque at the current engine speed needs to be calculated specifically, and the specific calculation method is as follows:
[0104] The torque at the current engine speed is calculated by dividing the current engine speed by the ratio of power to RPM on the power-to-output curve, substituting the result into the power-to-output curve, multiplying the result by the power-to-torque ratio on the power-to-output curve, and then multiplying by the engine-to-wheel torque conversion coefficient. The final torque at the current engine speed is 0 when the vehicle model is not running, but is assigned an initial value when the vehicle model is first started. In this embodiment, the initial value is 1000, and then a new value is obtained through the ApplyDrive method.
[0105] In addition, in the calculation of the vehicle's current torque, when the vehicle model's gear parameter is automatic, the clutch input value is fixed at 1. When the vehicle model's gear parameter is manual, the clutch input is calculated based on the value between (0,1) generated by the clutch pedal of the external device.
[0106] After obtaining the current torque of the vehicle, the rotational speed of the wheels can be obtained based on the current torque, and then the rigid body velocity of the vehicle can be obtained.
[0107] Additionally, the ApplyDrive method also obtains the vehicle model's brake input and handbrake switch status to simulate braking. Specifically, when the external device presses the foot brake, the ApplyDrive method obtains the brake pedal torque (operational data) of the external device's foot brake pedal. Based on the brake pedal torque, it calculates the foot brake torque: Foot brake torque = Brake pedal torque * Brake input. Then, it assigns the foot brake torque value to the brakeTorque parameter of each wheel collider to slow down or stop the vehicle. The handbrake switch is similar to the brake input, with two states: open and closed. The maximum value of the foot brake torque is multiplied by the handbrake switch state value (0 or 1), and the resulting value is assigned to the brakeTorque parameter of each wheel collider to stop the vehicle.
[0108] Furthermore, the ApplyDrive method can also obtain the steering wheel input of the vehicle model to simulate steering. Specifically, when an external device operates the steering wheel, the ratio of the current steering wheel rotation angle to the maximum rotation angle is multiplied by the steering wheel input, and the result is assigned to the steerTorque parameter of each wheel collider to enable the car to steer.
[0109] In addition to setting the ApplyDrive method, this embodiment also sets the CarSpeed method, specifically as follows:
[0110] First, obtain the normalized velocity of the vehicle's rigid body. Specifically, use the normalized method in Unity3D to normalize the vehicle's rigid body velocity into a directional vector. Then, calculate the velocity direction using the normalized vehicle rigid body velocity, which is the same as the vehicle's rigid body velocity.
[0111] Then define a minimum speed limit for the current gear. The minimum speed limit for the current gear is used to limit the minimum speed of the vehicle model when it is running in the current gear. The calculation of the minimum speed limit for the current gear is as follows: Minimum speed limit for the current gear = (maximum speed of the current gear - minimum speed of the current gear) * throttle input + idle speed of the current gear; the minimum speed limit for the current gear is affected by the throttle input.
[0112] When the vehicle's rigid body velocity is greater than the maximum speed of the current gear, the current vehicle speed is calculated as follows:
[0113] Current vehicle speed = maximum speed in current gear * normalized vehicle rigid body speed; and update the vehicle rigid body speed to the current vehicle speed; this is equivalent to the current vehicle speed not exceeding the maximum speed in the current gear.
[0114] When the vehicle's rigid body velocity is greater than the minimum speed limit of the current gear but less than the maximum speed of the current gear, an intermediate speed, `speedVal`, is defined. The formula for `speedVal` is: Vehicle rigid body velocity - downshift deceleration acceleration * time; where time is the interval between the last frame and the current frame, in seconds; current vehicle speed = value of `speedVal` when it is greater than 0 * normalized vehicle rigid body velocity; and the vehicle rigid body velocity is updated to the current vehicle speed. Based on the calculations of the `ApplyDrive` method set above, when the throttle input decreases, the vehicle's current torque decreases, and the vehicle's rigid body velocity decreases. That is, the vehicle model's speed in the current gear is affected by the throttle input, hence the definition of `speedVal`. Val is used to simulate the vehicle's deceleration process during this phase; however, when the vehicle is running, it will not stop directly even without throttle input. To further simulate the vehicle's real-world operation, the minimum speed limit of the current gear is used to restrict the minimum speed at which the vehicle model can run in the current gear. According to the calculation formula for the minimum speed limit of the current gear, when there is no throttle input, the minimum speed limit of the current gear is the current gear idle speed. That is, when there is no throttle input, the vehicle's rigid body speed will decrease, but it will drop to the minimum idle speed of the current gear at the lowest possible speed. When there is throttle input, even if the vehicle's rigid body speed decreases, it can only drop to the minimum speed limit of the current gear ((maximum speed of the current gear - minimum speed of the current gear) * throttle input + idle speed of the current gear).
[0115] Then, the vehicle's current standardized speed is calculated by multiplying the current speed by 3.6 to standardize the current speed to km / h. Since the previous time calculation was in seconds, while vehicle speed is typically measured in km / h, the current vehicle speed needs to be standardized after the calculation, converting the unit to km / h to obtain the vehicle's current standardized speed.
[0116] Example 2
[0117] like Figure 2 As shown, this embodiment provides a vehicle simulation test judgment method, which uses a vehicle simulation modeling method from Embodiment 1 to establish a test vehicle simulation model. The method includes:
[0118] A1: Create an initial exam scenario model based on real exam scenarios and import it into Unity3D;
[0119] In this step, the real-world exam scene is sampled using aerial modeling or oblique photography techniques, and the sampling results are processed and optimized using Maya3D to obtain an initial exam scene model that is one-to-one with the actual scene.
[0120] A2: Use the vehicle simulation modeling method described above to establish a simulation model of the test vehicle based on the information of the test vehicle;
[0121] A3: Set rules for the different exam items;
[0122] A4: Based on the rules of the exam items, set rule triggers and judgment rules for the initial exam scenario model to generate a simulated exam scenario model;
[0123] Specifically, such as Figure 3 As shown, setting up a trigger involves the following steps:
[0124] A41: Use Cube in Unity3D to create a cube model;
[0125] A42: Add a collider component to the created cube model;
[0126] A43: In Unity3D, set the cube model's property to trigger to make the cube model a standard trigger;
[0127] A44: Mark the locations in the initial exam scenario model that require rule determination as trigger points;
[0128] A45: At each trigger point, multiple standard triggers are set according to steps A41-A43, wherein one standard trigger is set at the start and end of the rule determination at the trigger point, and one or more standard triggers are set at the end of the rule determination. The number of standard triggers to be set is determined according to the rules to be determined in actual need.
[0129] A46: Based on the rules of the exam items and the scenarios in the simulated exam scenario model, set parameters and rules for each standard trigger to make the standard triggers into rule triggers. The parameter rules include position data and scale data, which are used to set the size and position of the triggers and determine whether the exam vehicle simulation model can encounter the rule triggers to make rule judgments.
[0130] In a specific implementation, such as the right-angle turn project, the right-angle turn in the initial test scenario model needs to be utilized. A rule trigger is set at the starting position of a right-angle turn as the start trigger for the right-angle turn project, and the parameters of this start trigger are set, where the Position data is: x = -46.9, y = 1.77, z = 5.89, and the Scale data is: x = 1.84, y = 4.96, z = 11.22. Simultaneously, a trigger rule is set for it: determining whether the turn signal is activated. A rule trigger is set at the ending position of the turn as the end trigger for the right-angle turn project, and the parameters of this end trigger are set, where the Position data is: x = 3. 6. With y = 4.4 and z = 30.2, the scaling data is: x = 16.11, y = 7.82, z = 1.8. Trigger rules are set for these rules: determining whether the turn signal is off; when the simulated test vehicle passes through the right-angle curve, it collides with the start trigger, and the system triggers the callback method OnTrggerEnter(Collidercollider) to provide feedback on the start trigger's determination; when the simulated test vehicle leaves the right-angle curve, it collides with the end trigger, and the system triggers the callback method OnTrggerEnter(Collidercollider) to provide feedback on the end trigger's determination. Each rule trigger is placed in an ideal position on the initial test scenario model. This ideal position is determined based on the actual content to be judged, ensuring that the simulated test vehicle can encounter the rule trigger and trigger a judgment.
[0131] A5: Import the simulated exam scenario model and the simulated exam vehicle model with the set rule triggers and judgment rules into the system of the external car simulation equipment, and match the simulated exam vehicle model with the operating equipment in the car simulation equipment, and establish the conversion rules between the operating data of the operating equipment and the simulation data of the simulated exam vehicle model.
[0132] A6: The end user inputs operation data through the operation device, and the car simulation device converts the operation data into simulation data of the test vehicle simulation model according to the conversion rules;
[0133] As described in Example 1, after the test vehicle simulation model is imported into the car simulation device, the operation data can be converted into simulation data corresponding to the parameters of the test vehicle simulation model by operating the peripheral device of the car simulation device. When the test vehicle obtains the corresponding simulation data, it calls the control function to drive its operation. It is worth noting that in this embodiment, the car simulation device is any of the existing technologies, possessing a complete simulated vehicle operation process and supporting the Unity3D operating system.
[0134] A7: The car simulation equipment drives the test vehicle simulation model to run in the simulated test scenario model according to the simulation data, and determines the score according to the rule triggers and judgment rules.
[0135] Specifically, the judgment rules include preset judgment rules and examination judgment rules;
[0136] The preset judgment rules include the following rules:
[0137] Speed limit rules, specifically, stipulate that the vehicle speed must not exceed the prescribed speed.
[0138] The rules for vehicle lights, including the use of turn signals when turning, making U-turns and changing lanes, are judged based on whether the TurnSignal feedback from the test vehicle simulation model is true.
[0139] Line crossing rule: Set the rule trigger to whether the collision device on the test vehicle simulation model hits or crosses the rule trigger. When it hits or crosses the trigger, feedback is given that the test vehicle simulation model has crossed the line.
[0140] The rule for engine shutdown is that the test vehicle simulation model must not be shut down during the test. The determination is based on the fact that the car start-up parameters of the test vehicle simulation model are in the state of starting the car and the current speed of the vehicle is greater than 0.
[0141] In this embodiment, other preset judgment rules are also included to determine whether the test or vehicle is operating normally and in accordance with the rules.
[0142] The examination judgment rules include specific rules set according to the examination items.
[0143] In a specific implementation, for example, the driving test (Part 3) includes a section involving driving through school zones. The passing criteria for this section are two light taps on the brakes while maintaining a speed not exceeding 20 km / h. To enforce these rules, at the start of the section (i.e., when the start trigger is triggered), the simulator's current speed is retrieved frame by frame. The speed is checked to see if it exceeds 20 km / h. If it does, a warning is displayed and points are deducted. Simultaneously, the depth of the brake pedal press is recorded in each frame. Specifically, at the start of the section, a temporary array is created and the data is written into it. After the section ends (i.e., when the end trigger is triggered), the data in the temporary array is analyzed to check if the values show a decreasing trend twice. If not, a warning is displayed and points are deducted. This embodiment also includes judgments for other test-related items, which need to be set according to the actual test content.
[0144] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention should be included within the protection scope of the claims of the present invention.
Claims
1. A method for modeling a vehicle simulation model, characterized in that, The modeling method includes: S1: Obtain the actual parameters of the test vehicle and build a model based on these parameters; S2: Import the modeled vehicle into the Unity3D project and add car components to it; S3: Set the vehicle start parameters, gear parameters, powertrain parameters, vehicle status parameters, engine parameters, and input coefficients for a vehicle model with added vehicle components; S4: Set the speed calculation method for the vehicle model according to the parameters set in step S3 to obtain the test vehicle simulation model; The speed calculation method in step S3 includes the ApplyDrive method; The ApplyDrive method is specifically as follows: When the current vehicle speed is less than the minimum speed of the current gear, calculate the current torque of the vehicle, distribute the current torque of the vehicle to the drive wheels to obtain the forward torque of each drive wheel, and calculate the vehicle rigid body speed based on the forward torque. The drive wheels are the wheels that actually propel the vehicle forward. The vehicle rigid body velocity is the theoretical velocity of the vehicle model.
2. The vehicle simulation modeling method according to claim 1, characterized in that, The automotive components in step S2 include: wheel colliders, conventional colliders, and rigid body components. Adding wheel colliders specifically involves adding WheelCollider wheel collision components to the wheels of the vehicle model in Unity3D. Adding common colliders specifically includes: adding four spherical colliders (front, rear, left, and right) to the vehicle model in Unity3D, as well as adding a square collider for the vehicle body. Adding a rigid body component specifically includes: adding a Rigidbody component to the vehicle model in Unity3D, setting the Mass parameter value according to the actual parameter data of the test vehicle, and checking the Use Gravity option for the Rigidbody component.
3. The vehicle simulation modeling method according to claim 1, characterized in that, The vehicle starting parameters in step S3 include: power off state, power on state, and vehicle start state. And / or, the gear parameters include: manual gear parameters and automatic gear parameters; The manual transmission parameters include: neutral, first gear, second gear, third gear, fourth gear, fifth gear, and reverse gear; the automatic transmission parameters include: parking gear, forward gear, and reverse gear. And / or, the powertrain parameters include: maximum wheel offset angle, transmission efficiency, brake pedal torque, and braking curve; And / or, the vehicle status parameters include: gear ratios of each gear, wheel torque, minimum and maximum speeds of the vehicle in each gear, idle speeds of the vehicle in each gear, and foot brake torque; And / or, the vehicle engine parameters include: maximum engine speed, minimum engine speed, speed-output power relationship curve, speed ratio of the curve, idle torque, speed increase limit, speed decrease limit, downshift deceleration acceleration, and engine-to-wheel torque conversion coefficient. And / or, the input coefficients include: steering wheel input, clutch input, brake input, accelerator input, and handbrake switch.
4. The vehicle simulation modeling method according to claim 1, characterized in that, The calculation of the vehicle's current torque is specifically as follows: Vehicle current torque = idle torque * current gear ratio * transmission efficiency * clutch input + torque at current engine speed * throttle input * clutch input * transmission efficiency; The torque at the current engine speed is calculated based on the vehicle engine parameters.
5. The vehicle simulation modeling method according to claim 4, characterized in that, The speed calculation method in step S3 also includes the CarSpeed method; The CarSpeed method is specifically as follows: Obtain the normalized velocity of the vehicle's rigid body; Calculate the minimum speed limit for the current gear, where the minimum speed limit for the current gear = (maximum speed for the current gear - minimum speed for the current gear) * throttle input + idle speed for the current gear; When the vehicle's rigid body velocity is greater than the maximum speed of the current gear, the current vehicle speed is calculated as follows: Current vehicle speed = maximum speed in current gear * normalized vehicle rigid body speed; and update the vehicle rigid body speed to the current vehicle speed; When the vehicle rigid body velocity is greater than the minimum speed limit of the current gear and less than the maximum speed of the current gear, an intermediate speed speedVal is defined. The calculation formula for speedVal is: vehicle rigid body velocity value - downshift deceleration acceleration * time; where time is the interval between the last frame and the current frame, in seconds; current vehicle speed = speedVal value when it is greater than 0 * normalized vehicle rigid body velocity; and the vehicle rigid body velocity is updated to the current vehicle speed. Then calculate the vehicle's current standardized speed, specifically by multiplying the current speed by 3.6 and standardizing the current speed to km / h.
6. A method for judging vehicle simulation tests, characterized in that, A test vehicle simulation model is established using the vehicle simulation modeling method according to any one of claims 1-5, wherein the method includes: A1: Create an initial exam scenario model based on real exam scenarios and import it into Unity3D; A2: Use the vehicle simulation modeling method described above to establish a simulation model of the test vehicle based on the information of the test vehicle; A3: Set rules for the different exam items; A4: Based on the rules of the exam items, set rule triggers and judgment rules for the initial exam scenario model to generate a simulated exam scenario model; A5: Import the simulated exam scenario model and the simulated exam vehicle model with the set rule triggers and judgment rules into the system of the external car simulation equipment, and match the simulated exam vehicle model with the operating equipment in the car simulation equipment, and establish the conversion rules between the operating data of the operating equipment and the simulation data of the simulated exam vehicle model. A6: The end user inputs operation data through the operation device, and the car simulation device converts the operation data into simulation data of the test vehicle simulation model according to the conversion rules; A7: The car simulation equipment drives the test vehicle simulation model to run in the simulated test scenario model according to the simulation data, and determines the score according to the rule triggers and judgment rules.
7. The vehicle simulation test judgment method according to claim 6, characterized in that, The specific steps for establishing an initial exam scenario model based on real exam scenarios are as follows: The actual exam scene is sampled using aerial modeling or oblique photography techniques, and the sampling results are processed and optimized using Maya3D to obtain an initial exam scene model that is consistent with the layout of the actual scene environment.
8. The vehicle simulation test judgment method according to claim 6, characterized in that, The specific steps for setting the rule trigger include: A41: Use Cube in Unity3D to create a cube model; A42: Add a collider component to the created cube model; A43: In Unity3D, set the cube model's property to trigger to make the cube model a standard trigger; A44: Mark the locations in the initial exam scenario model that require rule determination as trigger points; A45: At each trigger point, multiple standard triggers are set according to steps A41-A43; A46: Set parameters and rules for each standard trigger according to the rules of the exam items and the scenarios in the initial exam scenario model, so that the standard triggers become rule triggers.
9. The vehicle simulation test judgment method according to claim 8, characterized in that, The specific method of setting multiple standard triggers includes setting the standard triggers at each trigger point in the simulated exam scenario model, at the start, process and end positions of the rule determination at the trigger point; A standard trigger is set at the beginning and end of the process, and one or more standard triggers are set at the process.
Citation Information
Patent Citations
Physical engine-based driving examination simulation system
CN110364054A
Multi-vehicle multi-simulator linkage driving system and data processing method thereof
CN114491787A
Virtual simulation method for industrial robot production line
CN114663580A