A method for operating a decoupled robotic driving skill training control system
By constructing a robot teaching logic using a hierarchical text configuration method, data updates and logical reasoning are decoupled, solving the problems of state maintenance and priority conflicts in robot driving teaching systems, and achieving system maintainability and feedback stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YIXIAN INTELLIGENCE
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-29
AI Technical Summary
Existing robot driving training systems suffer from difficulties in state maintenance, priority conflicts, and debugging, resulting in chaotic system structure and unstable feedback.
A hierarchical text-configurable robot teaching logic construction method is adopted. Through data snapshots, state self-updating, logical reasoning, and priority arbitration, data updates and logical reasoning are decoupled to achieve state maintenance and priority arbitration.
It improves the maintainability and debuggability of the system, ensures the accuracy and stability of feedback, and lowers the development threshold.
Smart Images

Figure CN122116726A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot control and driving instruction technology, and in particular to a control system and its operation method for robot driving skills training. Background Technology
[0002] Existing robot driving training systems typically employ a "perception-planning-control" cyclical architecture. The system receives sensor data in real time and determines whether the trainee's operation is correct based on preset conditions, then provides voice prompts or control commands. Currently, a common implementation scheme is a hard-coded state machine, whose operation steps are as follows: Read sensor data in the main loop; Use if-else statements to directly check conditions (such as whether the vehicle speed exceeds the limit, whether the time has expired, etc.); When the conditions are met, the voice playback or status transition will be triggered directly.
[0003] The disadvantages of existing technologies are as follows: State maintenance is difficult: Teaching logic often relies on higher-order states or historical states (such as "whether the vehicle has ever shifted into the wrong gear" or "whether the parking time has exceeded 3 seconds"). Existing solutions require timers, counters, etc. to be scattered throughout the business code, resulting in a messy code structure (Spaghetti Code).
[0004] Priority conflicts lack arbitration: When multiple teaching conditions are met simultaneously (such as "on the line" and "operation timeout"), the system lacks a unified arbitration mechanism, and the feedback results depend on the order of code writing, resulting in unstable output.
[0005] Debugging and backtracking are difficult: logical judgments and data calculations are coupled, making it difficult to pinpoint whether a false alarm is due to a data error or a logical error.
[0006] Therefore, there is an urgent need for an operational method that can decouple data updates from logical reasoning in order to improve the maintainability, stability and debuggability of the system. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of existing technologies and provide an operation method for a decoupled robot driving skills training and control system, thereby solving problems such as difficulty in state maintenance, priority conflicts, and debugging difficulties in existing technologies. To achieve the above objective, this invention adopts the following technical solution: A method for constructing robot teaching logic based on hierarchical text configuration includes the following steps: S1: Obtain a data snapshot, including: Acquire sensor data and lock it as the current frame state; Perform internal state self-updates according to the self-update rules; Iterate through and update the rules; S2: Calculate higher-order variables, including: Update the timer based on the conditions; Accumulate the loop count based on the conditions; The current value of the specified variable is appended to the trajectory data and then to the historical sequence to form the historical trajectory. Write the updated higher-order state back to the shared data area; S3, Logical Reasoning: Truth calculation is performed based on high-order state data and preset teaching stages and checkpoint conditions; S4. Priority Arbitration and Enforcement: Find all logical branches that have true results to form a candidate set. Sort the logical branches in the candidate set according to the preset configuration, and select the logical branch with the highest priority to execute its corresponding output instruction. The above steps are performed in a periodic loop.
[0008] Preferably, the sensor data originates from the robot operating system (ROS) and / or the controller area network (CAN).
[0009] Preferably, the sensor data includes vehicle status data, sensor data, and system status data.
[0010] Preferably, updating the timer based on conditions includes starting, stopping, or resetting the timer.
[0011] Preferably, in step S3 logical reasoning, historical data in the historical value sequence is directly referenced through negative indexes for sequential logical calculation.
[0012] Preferably, step S3 specifically includes: S31. Based on the higher-order state data and the preset teaching stage requirements, determine the current teaching stage; S32. Obtain at least one checkpoint condition corresponding to the current teaching stage; S33. Substitute the higher-order state data into the checkpoint conditions to calculate the truth value, and collect the checkpoint conditions with true calculation results as candidate logic branches.
[0013] Preferably, in step S4, the priority rule is a predefined priority value associated with the checkpoint condition, and the smaller the value, the higher the priority.
[0014] Preferably, the output instructions executed in step S4 include voice broadcast instructions and / or status assignment instructions.
[0015] Compared with the prior art, the beneficial effects of the present invention are: Complete decoupling: Business logic writers only need to focus on "if A then B", without having to worry about how the state is calculated or maintained, thus lowering the development threshold; Strong time-series logic processing capability: With the support of historical sequences, historical data (such as data[-1] and data[-2]) can be directly compared, making it easy to judge trends or changes; Precise feedback: Through a priority arbitration mechanism, it ensures that only the highest priority prompt is output when multiple conditions are triggered, avoiding voice overlap that may disturb the user; Improved system maintainability and debuggability: Data updates and logical reasoning are separated, making it easier to locate problems and perform backtracking analysis. Attached Figure Description
[0016] Figure 1 This is a flowchart of one embodiment of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings.
[0018] like Figure 1 As shown, Cycle begins: The system enters a new processing cycle.
[0019] Data snapshot: Receive full sensor data from the underlying system (such as ROS / CAN).
[0020] The received data is locked to read-only status for the current frame.
[0021] Internal state self-update: Read update rules: The system reads the preset update requirement configuration (update_requirements).
[0022] Traversal and execution rules: Automatically update higher-order state data based on configured rules. Timing logic: For example, start, stop, or reset timers based on conditions (such as driving_time).
[0023] Counting logic: For example, conditionally incrementing a counter (such as cycles).
[0024] Sequence tracing: Appends the current value of a specified variable to the historical sequence list (sequential_data) to form a historical trajectory.
[0025] Write back shared data: Write all updated higher-order state data back to the shared data area (shared_data) for use in subsequent steps.
[0026] Stage positioning and logical reasoning (Inference): Call the _find_checkpoint() function.
[0027] Determine the current stage: Based on the updated status data and the preset teaching stage requirements (stage_requirements), determine the current teaching stage (Stage).
[0028] Get the condition list: Get the list of all checkpoint conditions (checkpoint_text) corresponding to the current stage.
[0029] Logical calculation: Substitute the higher-order state data generated in step 3 into the logic tree (conditional expression) to perform truth value calculation.
[0030] Output status: Generate and output the True / False calculation results for each logical branch.
[0031] Priority Arbitration & Execution: Collect candidate branches: Collect all logical branches whose calculation result is True.
[0032] Judgment and Arbitration: If the candidate branch list is empty, the system remains silent and waits for the end of this frame.
[0033] If the list is not empty, then: Read priority configuration: Read the preset priority array (checkpoint_level).
[0034] Sorting and Selection: Sort the candidate branches according to their priority values (the smaller the value, the higher the priority), and select the branch with the smallest priority value (i.e., the highest priority).
[0035] Execute action: Perform the operation defined in the selected branch: Perform assignment operations to change the internal state of the system.
[0036] Perform text-to-speech (TTS) to provide feedback to learners.
[0037] End of this frame: The current processing cycle is complete, and the system waits to enter the next cycle.
[0038] Specifically, Phase 1: Data Snapshot Receiving raw data: The system reads all sensor data (such as vehicle speed, steering wheel angle, gear signal, etc.) in real time from the underlying Robot Operating System (ROS) or Controller Area Network (CAN) bus interface.
[0039] Lock the current state: Pack and lock the read raw data to form a read-only "current frame state" within this frame. This step ensures that the underlying data used in subsequent processing within this cycle is a consistent and unchanging "snapshot".
[0040] Phase Two: Self-Update Based on pre-written configuration rules, this stage automatically processes the "current frame state" into a "higher-order state" that includes timing, counting, and other information.
[0041] Read update configuration: The system loads the preset "update requirements" configuration file.
[0042] Traversal and execution of update rules: Based on the configuration, the system automatically performs three types of core calculations and writes the results to a shared data area. Update timers: Automatically manage timers based on conditions. For example, automatically start the driving_time timer when the vehicle starts moving; automatically pause or reset it when the vehicle stops.
[0043] Update counters: Count automatically based on events. For example, increment the forward_completed_cycles counter by 1 each time a forward-stop cycle is completed.
[0044] Maintaining historical sequences: The current values of key variables (such as horizontal offsets) are appended to a circular buffer queue (sequential_data), automatically saving their historical trajectory. This allows the system to access historical data such as data[-1] (the previous value), data[-2] (the value before that), etc.
[0045] Phase Three: Logical Reasoning (Inference) This stage involves making teaching logic judgments based on the updated higher-order states.
[0046] Locating the teaching stage: The _find_checkpoint() function is called to match the current higher-order state with the predefined requirements of each "teaching stage" to determine the specific teaching stage (Stage) that the student is currently in.
[0047] Get checkpoint conditions: Retrieves a list of all checkpoint conditions associated with the current teaching phase. These conditions describe the driving rules that need to be judged at this phase (e.g., "Did the vehicle speed exceed 5 km / h for more than 3 seconds?").
[0048] Perform logical calculations: Substitute the higher-order state data (including current values and historical sequences) in the shared data area into the logical expression (logic tree) of each checkpoint for calculation, and obtain the result of each condition being either True or False.
[0049] Phase Four: Priority Arbitration and Execution This phase handles conflicts triggered by multiple conditions simultaneously and executes the final feedback.
[0050] Collect candidate set: Collect all checkpoint conditions that calculate to True to form a "candidate feedback" set.
[0051] Arbitration ruling: If the candidate set is empty, it means that there is no violation or operation that needs to be prompted in this frame, and the system will remain silent, and the processing of this frame will end.
[0052] If the candidate set is not empty (i.e., multiple conditions are met simultaneously), then priority arbitration is initiated: Priority configuration read: The system reads the predefined checkpoint_level configuration, which assigns a priority value to each checkpoint (the smaller the value, the higher the priority).
[0053] Sorting and Selection: All triggered candidate checkpoints are sorted according to their priority values, and the checkpoint with the lowest priority value (i.e. the most important) is finally selected as the execution target for this frame.
[0054] Execute feedback action: Execute the action defined for the selected checkpoint. Performing an assignment may update some internal system flags (such as error_flag = 1).
[0055] Perform voice broadcast: Call the text-to-speech (TTS) engine to broadcast the corresponding standardized voice prompts to the students (such as "Please note that you have crossed the line").
[0056] Process termination and loop End of this frame: After completing all the above steps, the current processing cycle ends. The system waits for the next cycle to begin and repeats this process from the first stage, achieving continuous, decoupled monitoring and guidance for driver skills training.
[0057] According to the method of the present invention, the business logic writer only needs to be concerned with "if condition A is met, then execute feedback B" in the configuration, without having to write code to maintain the timers, counters or historical states on which condition A depends (these are all done automatically by the second stage), and rely on the arbitration mechanism of the fourth stage to ensure the clarity and order of the feedback.
[0058] Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
Claims
1. A method for operating a decoupled robot driving skills training control system, characterized in that, Includes the following steps: S1: Obtain a data snapshot, including: Acquire sensor data and lock it as the current frame state; Perform internal state self-updates according to the self-update rules; Iterate through and update the rules; S2: Calculate higher-order variables, including: Update the timer based on the conditions; Accumulate the loop count based on the conditions; The current value of the specified variable is appended to the trajectory data and then to the historical sequence to form the historical trajectory. Write the updated higher-order state back to the shared data area; S3, Logical Reasoning: Based on the higher-order state data and the preset teaching stages and checkpoint conditions, truth value calculation is performed. S4. Priority Arbitration and Enforcement: Find all logical branches that have true calculation results to form a candidate set, sort the logical branches in the candidate set according to the preset configuration, and select the logical branch with the highest priority to execute its corresponding output instruction; The above steps are performed in a periodic loop.
2. The operation method of the decoupled robot driving skills training control system according to claim 1, characterized in that, The sensor data originates from the Robot Operating System (ROS) and / or Controller Area Network (CAN).
3. The operation method of the decoupled robot driving skills training control system according to claim 2, characterized in that, The sensor data includes vehicle status data, sensor data, and system status data.
4. The operation method of the decoupled robot driving skills training control system according to claim 1, characterized in that, The condition-based timer update includes starting, stopping, or resetting the timer.
5. The operation method of the decoupled robot driving skills training control system according to claim 1, characterized in that, In the logical reasoning step S3, historical data in the historical value sequence is directly referenced through negative indexes for time-series logical calculations.
6. The operation method of the decoupled robot driving skills training control system according to claim 1, characterized in that, Step S3 specifically includes: S31. Determine the current teaching stage based on the higher-order state data and the preset teaching stage requirements; S32. Obtain at least one checkpoint condition corresponding to the current teaching stage; S33. Substitute the higher-order state data into the checkpoint conditions to perform truth value calculation, and collect checkpoint conditions with true calculation results as candidate logic branches.
7. The operation method of the decoupled robot driving skills training control system according to claim 1, characterized in that, In step S4, the priority rule is a predefined priority value associated with the checkpoint condition, and the smaller the value, the higher the priority.
8. The method for operating the decoupled robot driving skills training control system according to claim 1 or 7, characterized in that, The output instructions executed in step S4 include voice broadcast instructions and / or status assignment instructions.