Teaching script reuse method for track inspection robot
By obtaining the coordinates of reference points in the track inspection robot and performing straight line fitting and coordinate transformation, the problems of low efficiency and insufficient accuracy in reusing teaching scripts for track inspection robots are solved, enabling rapid deployment and high-precision reuse of teaching scripts.
Patent Information
- Application Number
- CN202611240404.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-11-20
AI Technical Summary
When existing track inspection robots perform inspection tasks on different tracks or in different locations, the reuse efficiency of teaching scripts is low and the accuracy is insufficient. The deployment cycle is long and the labor cost is high. They cannot effectively cope with rotation angle deviations and differences in physical environment.
By obtaining the coordinates of reference points of fixed features in the maps of the original track and the target track, a baseline is fitted, the angle deviation and translation are calculated, and the teaching script of the target track is generated by combining rotation and translation operations. Straight line fitting and multiple sets of reference points are used to improve robustness, and coordinate transformation and on-board testing corrections are performed.
It enables efficient reuse of teaching scripts for track inspection robots across different tracks or sites, significantly shortening the deployment cycle, improving accuracy and adaptability, and reducing on-site debugging time and labor costs.
Smart Images

Figure CN123137644A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of track inspection robot technology, and more specifically to a method for reusing teaching scripts for track inspection robots. Background Technology
[0002] Currently, when track inspection robots perform inspection tasks on different tracks or in different locations, the teaching scripts for each track are, in principle, independent of each other. A complete teaching script needs to be comprehensively taught by combining robot navigation points, robotic arm movements, and lifting column movements, which usually takes two weeks or even longer to complete, resulting in long deployment cycles and high labor costs.
[0003] In existing technologies, inspection tasks on different maps or tracks often require re-teaching or reuse using simple coordinate translation methods. However, simple translation methods cannot handle rotational angle deviations between different tracks, resulting in low accuracy. Furthermore, this method relies heavily on manual on-vehicle testing and fine-tuning, and is constrained by factors such as map quality, leading to low optimization efficiency. In addition, the differences in physical environments at different sites further increase the difficulty of script reuse, and there is a lack of systematic coordinate transformation methods.
[0004] Therefore, there is an urgent need for a method that can efficiently and accurately reuse existing teaching scripts to new tracks or new venues, so as to significantly shorten the deployment cycle and improve the adaptability of robots in complex track environments. Summary of the Invention
[0005] To address the aforementioned technical shortcomings, the purpose of this invention is to provide a method for reusing teaching scripts for track inspection robots, thereby solving the problems of low efficiency and insufficient accuracy in existing teaching script reuse.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for reusing teaching scripts for a track inspection robot, the method comprising: Obtain the coordinates of reference points for multiple fixed features in the original track map and fit them to obtain the original baseline. Obtain the coordinates of the reference points corresponding to the fixed features in the target track map and fit them to obtain the target baseline; Calculate the angular deviation based on the angle between the original baseline and the target baseline; The translation amount is determined based on the coordinates of the corresponding reference point in the target track. Using a reference point in the original track that corresponds to the reference point of the target track as the rotation center, the navigation coordinate points in the original track teaching script are rotated and transformed by an angular deviation, and then a translation is applied to obtain the navigation coordinate points of the target track.
[0007] Preferably, in one possible implementation of the first aspect, when the original track and the target track are located in the same site, the reference point is selected from the same physical location in the scene.
[0008] Preferably, in one possible implementation of the first aspect, when the original track and the target track are located in different locations, the navigation coordinates of the reference point are locked by comparing pixel deviations through teaching and photographing with a robotic arm, using the absolute position of the train as a reference.
[0009] Preferably, in one possible implementation of the first aspect, the allowable range of the pixel deviation is controlled by a preset threshold.
[0010] Preferably, in one possible implementation of the first aspect, when the target track is not ready for driving, the coordinates of the reference point are manually selected using a three-dimensional point cloud map.
[0011] Preferably, in one possible implementation of the first aspect, the baseline is obtained by linear fitting, and the number of reference points used for fitting is not less than two.
[0012] Preferably, in one possible implementation of the first aspect, the method further includes performing on-vehicle testing of navigation coordinate points to correct errors caused by the accuracy of construction in the physical environment.
[0013] The beneficial effects of this invention are as follows: By combining benchmark fitting and coordinate transformation, this invention enables the efficient reuse of teaching scripts for track inspection robots across different tracks or sites, significantly improving deployment efficiency and shortening the teaching cycle from one to two weeks to a rapid deployment stage, thereby greatly reducing the time cost and manpower required for on-site debugging.
[0014] Compared to traditional simple translation methods, this invention introduces an angle correction mechanism based on straight line fitting, which can effectively compensate for angle deviations caused by map rotation or track layout differences, thereby improving the accuracy and reliability of script reuse.
[0015] This invention supports script reuse for different tracks within the same site and between different sites, making it applicable to a wide range of scenarios and highly flexible.
[0016] Simultaneously, using multiple sets of reference points for line fitting reduces systematic bias caused by SLAM mapping errors or damage to individual feature points, thereby enhancing the robustness and stability of the method.
[0017] After on-vehicle testing and local corrections, the final generated teaching script can achieve execution accuracy similar to the original script, ensuring the quality of robot inspection on the target track. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This application provides a flowchart of a teaching script reuse method for a track inspection robot.
[0020] Figure 2 This application provides a schematic diagram of the old and new stock track baselines. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Example 1: As Figure 1 As shown, this invention provides a method for reusing teaching scripts for a track inspection robot. This method is applied to a track inspection robot system, which includes a track inspection robot, a main control platform, a teaching script library, a map management module, and a coordinate transformation algorithm module. The robot is equipped with a SLAM navigation system, enabling autonomous positioning and navigation within the track environment. The main control platform is responsible for scheduling inspection tasks. The teaching script library stores and manages the teaching scripts for each track. The map management module maintains the electronic map data for each track. The coordinate transformation algorithm module performs coordinate point transformation calculations.
[0023] In this embodiment, the first step is to select multiple fixed features as reference points in the original track map and obtain the coordinates of these reference points. Fixed features refer to objects along the track that have obvious geometric features and are not easily moved, such as pillars, corners, and equipment bases. Computer vision technology is used to filter and automatically identify image data within a specific area of the map, thereby selecting the set features as reference points. Specifically, a feature point detection algorithm based on scale-invariant feature transform is used to extract corner points and edge intersections in the map raster image, and a preset geometric shape template is used for matching and filtering, retaining only points with a matching degree higher than 0.85 with typical features such as pillars and corners as candidate reference points; then, a random sampling consensus algorithm is used to remove outliers. At least two reference points are selected to ensure the reliability of subsequent straight-line fitting. The center position of the first pillar is used as the first reference point, the center position of the second pillar as the second reference point, and so on, for a total of [number missing]. There are several reference points. Then, a linear fit is performed on the coordinates of these reference points to obtain the equation of the original reference line. ,in The slope The intercept is used. Linear fitting employs the least squares method to minimize the sum of the squared distances from all reference points to the fitted line, thereby obtaining the line that best represents the distribution trend of these reference points.
[0024] The second step involves selecting fixed features identical to those of the original track on the target track map as reference points and obtaining their coordinates. The target track is the track where new inspection tasks need to be deployed, and no effective teaching script has yet been established for it. Operators locate the same physical positions on the target track as on the original track, and similarly select the center position of the pillar as the reference point for the target track. Linear fitting is then performed on the coordinates of these reference points to obtain the straight line equation of the target baseline. ,in The slope The intercept is used, and the fitting method is the same as in the first step.
[0025] The third step is to calculate the angular deviation based on the angle between the original baseline and the target baseline. The tilt angle of the original baseline is... The tilt angle of the target baseline is The difference between the two is the angular deviation. , This angular deviation reflects the rotational difference between the original track map and the target track map. Since cumulative errors may exist during SLAM mapping, or different tracks may have inherent rotational angles in their physical layout, angular correction is introduced to improve script reuse accuracy.
[0026] The fourth step is to determine the translation amount based on the coordinates of the corresponding reference points in the target stock lane. Select a pair of corresponding reference points; a schematic diagram of the old and new stock lane reference lines is shown below. Figure 2 As shown, in the original stock channel The corresponding points and target stock channels point. The translation in the direction is , The translation in the direction is The translation amount represents the overall positional offset between the original track and the target track.
[0027] The fifth step is to perform coordinate transformation on the navigation coordinate points in the original stock trading script. This transformation is based on the original stock trading script. Using the point coordinates as the rotation center, first adjust the navigation coordinates in the original script. Around Point rotation angle Then, apply a translation amount to obtain the corresponding navigation coordinates in the target track. The formula for calculating rotation transformation is: [Formula for the result of rotation] Coordinates are After rotation Coordinates are Then apply a translation to obtain the final coordinates:
[0028]
[0029] All navigation coordinates in the original stock trading path teaching script are converted one by one according to this formula to generate the teaching script for the target stock trading path.
[0030] The strategy for collecting reference points differs depending on the scenario. When the original track and the target track are located in the same area, the reference point is directly selected from the same physical location in the scenario, such as the same pillar or the same equipment base, to ensure the accurate correspondence between the two maps.
[0031] When the original track and the target track are located in different locations, the navigation coordinates of the reference point are locked by comparing pixel deviations through teaching and photographing with the absolute position of the train. Specifically, the robot is driven near the train, and the robotic arm takes a picture of the first axle of the first bogie of the train. The pixel deviation of the marker point in the two pictures is compared. The allowable range of pixel deviation is controlled by a pre-set threshold. In this embodiment, the threshold is 5 mm. When the actual distance corresponding to the pixel deviation is less than 5 mm, it is considered that the robot has reached the same relative position as the original track, and the robot's navigation coordinates are locked as the reference point coordinates.
[0032] When the target track is not suitable for driving, the reference point coordinates are manually selected using a 3D point cloud map. The operator then... Open the 3D point cloud maps of the original and target stock tracks in the software, find similar feature objects, and manually pick the coordinates of these feature points as the reference data for subsequent coordinate transformation.
[0033] After completing the coordinate transformation, the generated teaching script needs to be tested on-vehicle. The operator loads the new script into the robot system and runs the robot on the target track to check the accuracy of the navigation trajectory, robotic arm movements, and column height. For errors caused by the physical environment and construction precision, such as deviations between the actual installation position and the design position of the column, local corrections are made. Correction methods include fine-tuning the coordinates of individual navigation points or adjusting the robotic arm's movement parameters. Alternatively, the automated script correction function can calculate the coordinates of the navigation points that need correction based on the pixel deviation between the real-time acquired images and the template, and automatically modify the navigation point coordinates. The specific process of automated correction is as follows: As the robot runs along the target track, the robotic arm's end-effector camera takes an image at each preset image point. After grayscale conversion and Gaussian filtering preprocessing of the image and the standard template image corresponding to the original track position, a normalized cross-correlation algorithm is used to calculate the offset between the two images. This pixel offset is multiplied by the calibrated pixel equivalent to obtain the actual physical offset. Then, this offset is superimposed onto the coordinates of the current navigation point to achieve automatic correction of the navigation point. After correction, the robot was tested and verified again until the pixel deviation of all photo points was less than 5 mm. After one or more rounds of testing and correction, the robot's inspection movements on the target track achieved the same accuracy as the original track.
[0034] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for reusing teaching scripts for a track inspection robot, characterized in that, The method includes: Obtain the coordinates of reference points for multiple fixed features in the original track map and fit them to obtain the original baseline. Obtain the coordinates of the reference points corresponding to the fixed features in the target track map and fit them to obtain the target baseline; Calculate the angular deviation based on the angle between the original baseline and the target baseline; The translation amount is determined based on the coordinates of the corresponding reference point in the target track. Using a reference point in the original track that corresponds to the reference point of the target track as the rotation center, the navigation coordinate points in the original track teaching script are rotated and transformed by an angular deviation, and then a translation is applied to obtain the navigation coordinate points of the target track.
2. The method for reusing teaching scripts for a track inspection robot as described in claim 1, characterized in that, When the original track and the target track are located in the same area, the reference point is selected from the same physical location in the scene.
3. The method for reusing teaching scripts for a track inspection robot as described in claim 1, characterized in that, When the original track and the target track are located in different locations, the navigation coordinates of the reference point are locked by comparing the pixel deviations through teaching and photographing with a robotic arm, using the absolute position of the train as a reference.
4. The method for reusing teaching scripts for a track inspection robot as described in claim 3, characterized in that, The allowable range of pixel deviation is controlled by a preset threshold.
5. The method for reusing teaching scripts for a track inspection robot as described in claim 1, characterized in that, When the target track is not suitable for driving, the coordinates of the reference point are manually selected using a 3D point cloud map.
6. The method for reusing teaching scripts for a track inspection robot as described in claim 1, characterized in that, The baseline is obtained through linear fitting, and the number of reference points used in the fitting is no less than two.
7. The method for reusing teaching scripts for a track inspection robot as described in claim 1, characterized in that, The method also includes conducting on-vehicle tests on navigation coordinate points to correct errors caused by the physical environment and construction precision.
