A control method for a boron neutron capture therapy system beam limiting device maintenance robot

By using a maintenance robot to automatically disassemble and install the restraint device, the occupational health risks and lack of flexibility associated with manual operation have been resolved. This has enabled safe and efficient replacement of the restraint device, reduced equipment and labor costs, and optimized the allocation of medical resources.

CN121245779BActive Publication Date: 2026-03-03LANZHOU UNIV +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511817292.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-03-03
Estimated Expiration
2045-12-04

AI Technical Summary

Technical Problem

In boron neutron capture therapy, the replacement of the beam confinement device requires manual operation, which leads to occupational health risks and insufficient flexibility, making it difficult to meet clinical treatment needs.

Method used

A maintenance robot for the beam confinement device is used. It acquires the outer contour image of the beam confinement device through a vision system, calculates the plane normal vector and spatial coordinates, and uses a robotic arm and tool head for flexible clamping to realize the automatic disassembly and installation of the beam confinement device. The radioactive beam confinement device is then transferred to a shielded container to avoid human contact.

Benefits of technology

It reduces occupational health risks, improves the flexibility and safety of restraint device replacement, reduces equipment procurement and maintenance costs, and optimizes the efficiency of medical resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121245779B_ABST
    Figure CN121245779B_ABST
Patent Text Reader

Abstract

This invention provides a control method for a maintenance robot of a beam-limiting device in a boron neutron capture therapy system, relating to the field of medical device technology. The method includes: Step 1, acquiring the position of the beam-limiting device and controlling the maintenance robot to automatically move to the front of the beam-limiting device based on its position; Step 2, acquiring an image of the outer contour of the beam-limiting device using a vision system based on its position; Step 3, calculating the planar normal vector, spatial coordinates, and offset angle and displacement between the beam-limiting device and the tool head based on the outer contour image. This invention reduces occupational exposure risks and lowers hospital equipment maintenance costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical device technology, and in particular to a control method for a maintenance robot for a beam-limiting device in a boron neutron capture therapy system. Background Technology

[0002] Boron neutron capture therapy is a radiotherapy technique with the potential for precision treatment. During the treatment, the beam confinement device is responsible for focusing hyperthermic neutrons onto the tumor target area. Depending on the location and size of the tumor, different beam confinement devices with different opening sizes or shapes may be required. In terms of the material composition of the beam confinement device, lead, iron, aluminum, boron compounds, lithium compounds, etc. are commonly used. Among them, materials such as lead, iron, and aluminum may become highly activated materials under neutron irradiation, which may produce radioactive nuclides with a certain half-life, so that the beam confinement device may have radioactive residues after use.

[0003] In the clinical practice of boron neutron capture therapy, when it is necessary to replace the beam confinement device, it may require the direct participation of staff in the relevant operations. For example, after the patient's treatment, staff may need to approach the beam confinement device with radioactive residue to disassemble and install it. This may expose staff to a certain dose rate of radiation field, thus posing potential occupational health hazards. At the same time, relying on manual operation may not be able to fully meet the actual needs of clinical treatment for beam confinement device replacement in terms of flexibility and adaptability. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a control method for a maintenance robot for the beam confinement device of a boron neutron capture therapy system, which reduces potential occupational health risks and adapts to the replacement needs of beam confinement devices with different opening sizes in clinical scenarios.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0006] In a first aspect, a control method for a maintenance robot of a beam-limiting device in a boron neutron capture therapy system, the method comprising:

[0007] Step 1: Obtain the position of the beam limiting device, and control the maintenance robot to automatically move to the front of the beam limiting device based on its position;

[0008] Step 2: Based on the position of the beam limiting device, use a vision system to obtain an image of the outer contour of the beam limiting device;

[0009] Step 3: Based on the outer contour image, calculate the planar normal vector, spatial coordinates, offset angle and displacement between the confinement device and the tool head;

[0010] Step 4: Adjust the position of the robotic arm and tool head according to the offset angle and displacement, so that the gripper of the tool head connects with the constraint device and performs flexible clamping;

[0011] Step 5: Based on the gripping state of the clamping device, control the robotic arm and tool head to disassemble the clamping device, and transfer the disassembled clamping device to a shielded container for storage.

[0012] Step 6: After completing the disassembly and storage operations, control the robotic arm and tool head to remove the confinement device with a predetermined opening size from the shielded container and perform the installation operation.

[0013] Secondly, a maintenance robot for the beam-limiting device of a boron neutron capture therapy system includes:

[0014] Mobile platform;

[0015] A robotic arm, with its base mounted on the mobile platform, and the robotic arm capable of flexible movement;

[0016] A special tool head is located at the end of the robotic arm and has the function of replacing the restraint device;

[0017] A vision system, mounted on the robotic arm, is used to acquire an image of the outer contour of the beam-limiting device;

[0018] Shielded container used to store beam-limiting devices to shield against radioactivity.

[0019] Thirdly, a computing device includes:

[0020] One or more processors;

[0021] A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.

[0022] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.

[0023] The above-described solution of the present invention has at least the following beneficial effects:

[0024] A robotic arm replaces manual labor in the disassembly and assembly of the confinement device, with a flexible clamping tool head preventing direct contact by personnel. Simultaneously, the disassembled radioactive confinement device is immediately transferred to a shielded container with a composite shielding design, effectively blocking the radiation diffusion of long-half-life radionuclides. A vision system generates a point cloud model with depth attributes, accurately calculating the confinement device's planar normal vector, spatial coordinates, and offset from the tool head. Position adjustment is achieved using the robotic arm's joint encoder, combined with a torque sensor on the tool head, enabling multi-stage torque disassembly to avoid damaging the sealing layer at the confinement device's connection points. Infrared ranging sensors confirm disassembly completion, further ensuring stability during the process, preventing equipment damage due to operational deviations, avoiding radiation leakage caused by seal failure, and improving the overall safety of the treatment system. The maintenance robot automatically moves to the target location via a mobile platform, supporting flexible switching between multiple treatment rooms without requiring dedicated maintenance equipment for each room. This reduces investment in equipment procurement, installation, and subsequent maintenance, while also lowering labor costs and optimizing the efficiency of medical resource allocation. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating a control method for a maintenance robot of a beam-limiting device in a boron neutron capture therapy system, provided by an embodiment of the present invention.

[0026] Figure 2 This is a schematic diagram of a maintenance robot for a beam-limiting device in a boron neutron capture therapy system, provided by an embodiment of the present invention.

[0027] Explanation of reference numerals in the attached drawings: 1. Mobile platform; 2. Robotic arm; 3. Vision system; 4. Shielding container; 5. Robotic arm base; 6. Special tool head. Detailed Implementation

[0028] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0029] like Figure 1 As shown, an embodiment of the present invention proposes a control method for a maintenance robot of a beam-limiting device in a boron neutron capture therapy system, the method comprising the following steps:

[0030] Step 1: Obtain the position of the beam limiting device, and control the maintenance robot to automatically move to the front of the beam limiting device based on its position;

[0031] Step 2: Based on the position of the beam limiting device, use a vision system to obtain an image of the outer contour of the beam limiting device;

[0032] Step 3: Based on the outer contour image, calculate the planar normal vector, spatial coordinates, offset angle and displacement between the confinement device and the tool head;

[0033] Step 4: Adjust the position of the robotic arm and tool head according to the offset angle and displacement, so that the gripper of the tool head connects with the constraint device and performs flexible clamping;

[0034] Step 5: Based on the gripping state of the clamping device, control the robotic arm and tool head to disassemble the clamping device, and transfer the disassembled clamping device to a shielded container for storage.

[0035] Step 6: After completing the disassembly and storage operations, control the robotic arm and tool head to remove the confinement device with a predetermined opening size from the shielded container and perform the installation operation.

[0036] In this embodiment of the invention, a robotic arm replaces manual labor in the disassembly and assembly of the beam confinement device, and the flexible clamping of a special tool head avoids direct contact with personnel. Simultaneously, the disassembled radioactive beam confinement device is immediately transferred to a shielded container with a composite shielding design, effectively blocking the radiation diffusion of long-half-life radionuclides. A vision system generates a point cloud model with depth attributes, accurately calculating the planar normal vector, spatial coordinates, and offset of the beam confinement device from the tool head. Position adjustment is achieved using a robotic arm joint encoder, and multi-stage torque disassembly is realized with the help of a torque sensor on the tool head, avoiding damage to the sealing layer at the connection of the beam confinement device. Infrared ranging sensors confirm the completion of disassembly, further ensuring the stability of the disassembly and assembly process, preventing damage to the equipment due to operational deviations, avoiding radiation leakage due to seal failure, and improving the overall safety of the treatment system. The maintenance robot automatically moves to the target location using a mobile platform, supporting flexible switching between multiple treatment rooms without requiring dedicated maintenance equipment for each treatment room, reducing investment in equipment procurement, installation, and subsequent maintenance, while also lowering labor costs and optimizing the efficiency of medical resource allocation.

[0037] In a preferred embodiment of the present invention, step 1 above, obtaining the position of the beam limiting device and controlling the maintenance robot to automatically move to the front of the beam limiting device based on the position of the beam limiting device, may include:

[0038] In this embodiment of the invention, before deploying the maintenance robot, the position of the beam-limiting device of the boron neutron capture therapy (BNCT) system in each treatment room is calibrated. First, a three-dimensional spatial coordinate system is established with a fixed reference point on the floor of the treatment room, such as a metal positioning block in the corner of the treatment room, as the origin. The X-axis is along the length of the treatment room, the Y-axis is along the width, and the Z-axis is perpendicular to the ground. Then, a laser positioning instrument is used to measure the key position parameters of the beam-limiting device, including the center coordinates of the mounting end face of the beam-limiting device, such as X=500 cm, Y=300 cm, Z=180 cm, corresponding to the center position of the beam outlet of the BNCT system, the horizontal angle of the mounting end face to ensure parallelism with the ground, and the preset maintenance position coordinates in front of the beam-limiting device suitable for robot docking. This position must meet the requirement that after the robot docks, the robotic arm can extend to cover the beam-limiting device, and the vision system can completely capture the outer contour of the beam-limiting device. This position is usually set as the beam-limiting device. At a point 80 centimeters directly in front of the device's center, coordinates such as X=420 cm, Y=300 cm, Z=180 cm are used. These calibration data are linked to the corresponding treatment room number and stored in the maintenance robot's control system database. Simultaneously, the database also stores a spatial map of the treatment room, marking the coordinate ranges of fixed obstacles such as treatment beds, instrument cabinets, and power cabinets. For example, the treatment bed coordinates are X=450 to 550 cm and Y=250 to 350 cm to prevent collisions during robot movement. When it is necessary to replace the confinement device in a treatment room, the operator sends a task command through the maintenance robot's control terminal. The command explicitly includes the target treatment room number. After receiving the command, the control system first verifies its validity. Once verified, it retrieves the corresponding confinement device location data and the treatment room spatial map from the database based on the treatment room number and loads this data into the motion control system.

[0039] The maintenance robot initially docks at the waiting position at the entrance of the treatment room. At this point, the control system drives the robotic arm to adjust its posture, aligning the binocular RGB camera mounted on the third joint of the robotic arm with the direction of the BNCT system's output port. This ensures that the center of the camera lens and the center of the beam-limiting device's mounting surface are approximately at the same horizontal level. The camera then initiates its first image acquisition, obtaining an RGB color image containing the output port and the beam-limiting device. The control system preprocesses the image and then extracts the contour features of the output port using an edge detection algorithm. The BNCT system's output port is typically circular or square. The document mentions that the beam-limiting device is often... The device is truncated cone-shaped, with its mounting end matching the beam outlet. Therefore, the approximate position of the beam limiting device can be located by the outline of the beam outlet. The control system compares the center position of the beam outlet identified in the image with the pre-stored center coordinates of the beam limiting device. If the deviation is within ±5 cm, it is within the acceptable error of the initial calibration, which may be caused by the slight displacement after long-term use of the BNCT system. In this case, the pre-stored preset maintenance position is directly used as the moving target. If the deviation exceeds ±5 cm, the deviation value is temporarily recorded, such as X-direction deviation +6 cm and Y-direction deviation -3 cm. Further precise correction will be made after the robot moves to the near position.

[0040] The control system's path planning combines a pre-stored treatment room space map, preset maintenance position coordinates, and standby position coordinates. A path search algorithm is used to plan a collision-free movement path. During planning, the treatment room space is first divided into 10cm x 10cm grid cells, each marked as passable or impassable. Then, starting from the standby position grid, the shortest path to the preset maintenance position grid is searched, ensuring all grids in the path are passable while maintaining a safe distance of at least 30cm from impassable grids. After planning, a series of continuous path nodes are generated, each containing X and Y coordinates and a movement direction angle. This node data is transmitted to the mobile platform's drive mode in real time. The control system sends a start-movement command to the mobile platform's drive mode, which controls the left and right drive motors of the wheeled chassis to rotate. The motors drive the wheels, causing the robot to move from the standby position along the planned path nodes. During movement, inertial sensors mounted on the bottom of the mobile platform feed back information to the control system at a frequency of 100 milliseconds per cycle, including the robot's instantaneous speed, actual movement direction angle, and vertical acceleration.

[0041] The control system analyzes the data fed back by the inertial unit sensors in real time. If any of the following situations occur, adjustments are made immediately: Directional deviation: If the actual movement direction deviates from the preset direction of the path nodes by more than ±3°, it indicates that the robot has deviated from the path. The control system sends a unilateral deceleration command to the drive module, such as reducing the speed of the right motor by 10% while the left motor maintains its original speed, causing the robot to turn left until the directional deviation is less than ±1°; Speed ​​exceeding limits: If the instantaneous speed exceeds 30 cm / s, a deceleration command is sent to reduce the speed of both motors, restoring the speed to 25-30 cm / s; Ground bumps: If the inertial sensor detects a vertical acceleration exceeding ±0.5 m / s², the output power of both motors is fine-tuned to enhance the driving force, prevent wheel slippage, and ensure the smooth passage of the moving platform; When the robot moves to a position 1 meter away from the preset maintenance position, the control system triggers a deceleration command based on the path node count and the position data fed back by the inertial sensor, reducing the movement speed from 30 cm / s to 10 cm / s. At a speed of meters per second, the robot enters a low-speed fine-tuning phase. At this point, the robotic arm readjusts the angle of its binocular RGB cameras to ensure the camera lenses are fully aligned with the confinement device, continuously acquiring images. The control system uses image recognition to identify the outer contour of the confinement device and calculates the remaining deviation between the robot's current position and the preset maintenance position. Based on the remaining deviation calculated by the vision system, the control system sends a fine-tuning command: if the X-direction deviation is +2 cm, the mobile platform moves 2 cm to the left; if the Y-direction deviation is -1.5 cm, the mobile platform moves 1.5 cm forward. Each fine-tuning operation involves the vision system re-acquiring an image to confirm whether the deviation has decreased, until the deviation is less than ±0.5 cm. At this point, the control system sends a stop command, the drive motor is powered off, and the braking device of the mobile platform is activated to prevent the robot from sliding. The inertial unit sensor acquires position data one last time, compares it with the preset maintenance position coordinates, and after confirming there is no deviation, sends a signal to the control system that the target position has been reached. The maintenance robot then officially stops in front of the confinement device.

[0042] In a preferred embodiment of the present invention, step 2 above, which involves acquiring an image of the outer contour of the beam-limiting device using a vision system based on the position of the beam-limiting device, may include:

[0043] In this embodiment of the invention, step 220 involves acquiring images of the beam limiting device using a binocular RGB camera mounted on the third joint of the robotic arm, simultaneously obtaining two RGB color images with parallax. Specifically, this includes: First, the maintenance robot, based on a preset treatment room space map and the initial position information of the beam limiting device, moves via a mobile platform to a preset maintenance position in front of the beam limiting device. This preset maintenance position is determined in advance through debugging to ensure that the binocular RGB camera's shooting range completely covers the beam limiting device, including its frustum-shaped main body and central opening structure, and avoids obstruction of the shooting by other equipment in the treatment room. Then, the maintenance robot controls the robotic arm to adjust its posture. Each joint of the robotic arm is gradually fine-tuned based on angle data fed back from the encoder, ultimately ensuring that the center of the binocular RGB camera lens mounted on the third joint is approximately at the same horizontal level as the geometric center of the beam limiting device, while simultaneously ensuring that the camera lens plane is basically parallel to the mounting end face of the beam limiting device. This reduces the impact of shooting angle deviation on subsequent parallax calculations. Next... The maintenance robot's control system sends a synchronous acquisition command to the binocular RGB cameras, triggering the left and right cameras to start capturing images at the same millisecond time point. A fixed distance of 50 to 100 millimeters exists between the left and right cameras. This distance is measured and determined by a laser rangefinder when the cameras are mounted on the robotic arm and stored in the control system. Both cameras have identical lens focal lengths and pixel sizes, adhering to industrial-grade standard parameters: a focal length of 5 to 10 millimeters and a pixel size of 3 to 5 micrometers. Due to the fixed distance between the left and right cameras and their simultaneous capture of the same beam-limiting device, parallax occurs in the two acquired RGB color images due to different viewing angles. For example, a point on the edge of the central opening of the beam-limiting device might be located at the 200th row, 300th column pixel position in the left camera image, but at the 200th row, 280th column pixel position in the right camera image. This difference in pixel position of the same target point in the two images is parallax. These two RGB color images with parallax are directly used for depth information calculation.

[0044] Step 221: Based on the positional differences of corresponding pixels in the two RGB color images, calculate the disparity value of each pixel according to the geometric relationship between the two cameras. Specifically, this includes: First, retrieving the preset geometric relationship parameters of the binocular RGB cameras from the maintenance robot's control system. These parameters, in addition to the fixed distance between the left and right cameras, lens focal length, and pixel size, also include a parallelism deviation correction value between the optical axes of the two cameras. This value is obtained through the camera calibration process and is used to correct calculation deviations caused by installation errors. Next, the two RGB color images obtained in step 110 are processed... The image undergoes preprocessing. The first stage is noise removal, which uses a Gaussian smoothing algorithm. The algorithm calculates the average value of pixels within a 3×3 or 5×5 pixel radius around each pixel and replaces the original pixel value with this average. This eliminates noise caused by flickering lights and equipment reflections in the treatment room environment. The second stage is grayscale conversion. The grayscale value of each pixel is calculated using a weighted average of red channel value × 0.299, green channel value × 0.587, and blue channel value × 0.114, converting the RGB three-channel color image into a single-channel grayscale image. This facilitates quick location of corresponding pixels. Then, an image matching algorithm based on grayscale correlation is used to find the corresponding pixel. Taking a pixel in the left-eye grayscale image, for example, the pixel in the i-th row and j-th column, as the reference point, the grayscale correlation between each pixel and the reference point is calculated within the same search interval of the i-th row and column coordinates ranging from j-50 to j+50 in the right-eye grayscale image. The similarity of grayscale values ​​in the surrounding 11×11 pixel region is calculated; the higher the similarity, the stronger the correlation. The pixel with the highest grayscale correlation is determined as the pixel in the right-eye image corresponding to the reference point. After finding the corresponding pixel, calculate the disparity value by subtracting the column coordinate value of the corresponding pixel in the right grayscale image from the column coordinate value of the reference pixel in the left grayscale image. The result is the disparity value of the reference pixel. For example, if the column coordinate of the left image is 300 and the column coordinate of the right image is 280, the disparity value is 20. Following the above method, perform the corresponding pixel lookup and disparity value calculation operation on each pixel in the left grayscale image in turn. Finally, obtain a set of disparity values ​​with the same number of pixels as the original RGB color image. Each disparity value corresponds to the spatial position difference information of a pixel in the original image.

[0045] Step 222: Convert the parallax values ​​into depth information to generate a depth map that corresponds one-to-one with the pixels of the RGB color image. Specifically, this includes: first, retrieving the geometric parameters of the binocular RGB camera used in step 111 from the control system of the maintenance robot; focusing on confirming the fixed distance between the left and right cameras (denoted as D) and the actual physical focal length of the camera lens (denoted as F). This is calculated from the lens focal length parameters and pixel size. For example, if the lens focal length is 5 mm and the pixel size is 3 micrometers, then the physical focal length F = 5 mm = 5000 micrometers. Next, for step... Step 111 calculates the disparity value of each pixel, denoted as d. d is a positive number and not zero to avoid division by zero during calculation. The depth value, denoted as Z, is calculated according to the triangulation principle. Z is the vertical distance from a point on the beam confinement device corresponding to the pixel to the camera lens plane. First, calculate the product of the physical focal length F and the fixed distance D, i.e., F × D. Then divide this product by the disparity value d. The quotient is the depth value Z corresponding to that pixel. For example, if F = 5000 micrometers, D = 80000 micrometers, and d = 20, then Z = (500...) (0×80000)÷20=2000000 micrometers=2000 millimeters. During the calculation, if the disparity value d of a certain pixel is too small (close to zero) or too large (out of a reasonable range, such as greater than 100), the depth value corresponding to that pixel is determined to be invalid. The invalid value will be removed during processing to avoid the abnormal data affecting the accuracy of the depth map. Then, according to the pixel arrangement order of the original RGB color image, the calculated effective depth values ​​are mapped one by one to each pixel position. That is, the pixel in the i-th row and j-th column of the left eye RGB color image also corresponds to the i-th row and j-th column position in the depth map, and the value stored at this position is the depth value Z corresponding to that pixel. Through the above operations, a depth map with the same size as the RGB color image and one-to-one pixel correspondence is generated. The value of each pixel in the depth map intuitively reflects the spatial depth of the corresponding position of the beam limiting device. For example, the bottom surface depth value of the frustum-shaped body of the beam limiting device is small (close to the camera), the top surface depth value is large (far from the camera), and the central opening area is invalid because there is no solid structure.

[0046] Step 223 involves registering and fusing the color information of the RGB color image with the depth information of the depth map, and generating a 3D color point cloud model of the beam confinement device through multimodal collaborative processing. Specifically, this includes: first, information registration is performed by calling the calibration parameters of the binocular RGB camera from the maintenance robot control system. These parameters include the intrinsic parameter matrix of the left-eye camera, recording the camera's physical focal length, principal point coordinates (i.e., the coordinates of the image center pixel), pixel size, etc. Based on the intrinsic parameter matrix, the depth map and the left-eye RGB color image are aligned at the pixel level. For the pixel in the i-th row and j-th column of the left-eye RGB color image, its corresponding red channel value R, green channel value G, and blue channel value B are bound one-to-one with the depth value Z of the pixel in the i-th row and j-th column of the depth map. To ensure that each color information is accurately matched to the corresponding spatial depth information and to avoid color and depth misalignment, an initial 3D geometric point cloud is constructed. For each pixel (row i, column j) corresponding to a valid depth value Z in the depth map, back projection calculation is performed using the intrinsic parameter matrix of the left eye camera. First, the deviation between the pixel coordinates and the principal point coordinates is calculated, i.e., pixel column coordinate j minus principal point column coordinate u0, to obtain the horizontal deviation Δu; pixel row coordinate i minus principal point row coordinate v0, to obtain the vertical deviation Δv. Then, the horizontal deviation Δu is multiplied by the depth value Z and divided by the physical focal length F to obtain the X-axis coordinate of the corresponding spatial point in the left eye camera coordinate system (X = Δu × Z ÷ F). Similarly, the vertical deviation Δv is multiplied by the depth value Z and divided by the physical focal length F. The focal length F is used to obtain the Y-axis coordinate (Y = Δv × Z ÷ F); the depth value Z of this pixel is the Z-axis coordinate of the spatial point. This determines the three-dimensional spatial coordinates (X, Y, Z) of a point on the beam confinement device corresponding to this pixel. Following this method, back projection calculations are performed on all pixels corresponding to effective depth values ​​to obtain a series of three-dimensional spatial coordinates. This set of coordinates constitutes the initial three-dimensional geometric point cloud of the beam confinement device. Then, color information is assigned. Based on the previously established color-depth binding relationship, the R, G, and B channel values ​​of each pixel in the left-eye RGB color image are assigned to the corresponding three-dimensional spatial coordinates (X, Y, Z) of the point in the initial three-dimensional geometric point cloud, giving each spatial point red, green, and blue color attributes, thus constructing the initial three-dimensional geometric point cloud of the beam confinement device. The initial 3D color point cloud is processed by a statistical filtering algorithm. First, the average distance of each spatial point to its 50 nearest neighbors is calculated. Then, the standard deviation of the average distance of all points is calculated. Spatial points whose deviation from the average distance exceeds twice the standard deviation are identified as outliers. These outliers are mostly caused by image noise and depth calculation errors, such as isolated points that deviate from the main structure of the beam confinement device, and are removed from the point cloud. After denoising, a voxel lattice filtering algorithm is used to simplify the remaining point cloud. While maintaining the geometric features of the beam confinement device, such as the curvature of the frustum side and the shape of the central opening, the amount of point cloud data is reduced. Finally, a structurally complete, detailed, and noise-free 3D color point cloud model of the beam confinement device is generated.

[0047] Step 224: Extract the outer contour geometric features of the beam confinement device from the 3D color point cloud model to obtain a complete outer contour image of the beam confinement device. Specifically, this includes: First, preprocessing the 3D color point cloud model. The first stage is point cloud downsampling, using a uniform sampling algorithm. Sampling points are selected in the 3D point cloud at a preset sampling interval, such as 50 micrometers, ensuring that the sampling points are evenly distributed across the various surfaces of the beam confinement device while preserving key geometric features, such as the edges of the upper and lower bases of the frustum and the edge of the central opening. Downsampling reduces the amount of data processed and improves computational efficiency. The second stage is point cloud segmentation. Segmentation conditions are set based on the frustum-shaped structural features of the beam confinement device. First, the point cloud belonging to the beam confinement device is filtered out based on the Z-axis coordinate range, and then... The central opening region is identified using a cylindrical fitting algorithm, and the cylindrical surface of the central opening is fitted. The point cloud inside the cylindrical surface is removed, resulting in a point cloud containing only the physical part of the confinement device. Next, the outer contour features are extracted, and an edge detection algorithm based on normal vector analysis is used to calculate the normal vector of each point in the preprocessed point cloud (reflecting the orientation of the surface where the point is located). The angle between the normal vectors of adjacent points is compared. If the angle exceeds a preset threshold, such as 30 degrees, the point is determined to be an edge point (for example, at the junction of the side surface and the top surface of the frustum, the normal vector changes from perpendicular to the side surface to perpendicular to the top surface, resulting in a larger angle, and the corresponding point is an edge point). Simultaneously, based on the X-axis and Y-axis coordinate distribution of the point cloud, the outer edge points of the top and bottom surfaces of the frustum are identified (the outer edge points of the top surface...). + The value is a fixed maximum value, and the value is the value at the outer edge of the bottom surface. + The value is another fixed maximum value) and the inner edge point of the center opening ( + (The value is a fixed minimum value); connect all identified edge points in geometric order to form the three-dimensional outer contour line of the beam limiting device (including the outer contour circle of the upper bottom surface, the outer contour circle of the lower bottom surface, the inner contour circle of the central opening, and the side contour line connecting the outer contour circles of the upper and lower bottom surfaces). Finally, generate the outer contour image, select a plane parallel to the mounting end face of the beam limiting device as the projection plane (the Z-axis coordinate of this plane is consistent with the Z-axis coordinate of the mounting end face), and project the extracted three-dimensional outer contour line onto this plane. During the projection process, maintain the geometric proportions of the contour line. For example, the diameters of the outer contour circles of the upper and lower bottom surfaces and the inner contour circle of the central opening are consistent with the actual dimensions in the three-dimensional point cloud. After the projection is completed, draw the contour line as black lines on a white background to form a complete outer contour image of the beam limiting device. This image clearly presents the overall shape of the beam limiting device and the size proportions of each part, and can be directly used to calculate the plane normal vector, spatial coordinates, and offset parameters of the beam limiting device relative to the tool head.

[0048] Synchronous acquisition and parallax calculation by binocular RGB cameras can fully capture the three-dimensional spatial differences of the beam confinement device. Combined with depth map generation and 3D color point cloud model construction, it can completely restore the frustum-shaped structure and central opening feature of the beam confinement device, ensuring that the maintenance robot can accurately identify the physical shape of the beam confinement device. Pixel-level registration and fusion of color and depth information improves the clarity and geometric accuracy of the outer contour image. The accurate outer contour image provides clear guidance for the robotic arm to adjust its posture and the tool head to align with the beam confinement device, ensuring smooth and efficient subsequent disassembly and installation operations, avoiding operation interruptions caused by image problems, and indirectly improving the clinical efficiency of the boron neutron capture therapy system.

[0049] In a preferred embodiment of the present invention, step 3 above, which calculates the planar normal vector, spatial coordinates, and offset angle and displacement between the confinement device and the tool head based on the outer contour image, may include:

[0050] In this embodiment of the invention, step 330 involves extracting point cloud data of the mounting end face of the beam limiting device based on the outer contour image, forming a point cloud dataset of the beam limiting device end face. Specifically, this includes: first, determining the source of the outer contour image, which is a three-dimensional color point cloud model of the beam limiting device previously generated through a vision system. This model contains point cloud points of all parts of the beam limiting device, each point cloud point carrying corresponding spatial rectangular coordinate system coordinates and color information; then, identifying the boundary feature points of the mounting end face of the beam limiting device. Since beam limiting devices are mostly frustum-shaped structures, their mounting end face is a flat circular plane with a clear connection boundary to the side of the frustum. In the three-dimensional color point cloud model, this boundary... The point cloud points exhibit subtle differences in color depth, and their z-values ​​transition from a gradual change on the sides to a constant value on the end face. Points at the connecting boundaries are selected as boundary feature points. Then, the boundary contour of the mounting end face is fitted, and the selected boundary feature points are connected sequentially in a clockwise direction, ensuring uniform distance between adjacent boundary feature points. If the number of boundary feature points is small, intermediate points can be calculated between adjacent points. The calculation method is to take the average x-value of two adjacent points as the x-value of the intermediate point, the average y-value of two adjacent points as the y-value of the intermediate point, and the constant z-value of the end face as the z-value of the intermediate point, ultimately forming a closed regular polygon. The outline of the regular polygon closely matches the actual circular outline of the mounting end face. Then, a polygon interior point detection algorithm from computational geometry is used to filter the point cloud points on the mounting end face. For each point cloud point in the 3D color point cloud model, the following operations are performed: starting from that point cloud point, a virtual ray is drawn along the positive x-axis of the spatial rectangular coordinate system. The intersection of this virtual ray with the boundary of the closed regular polygon is then observed, and the number of intersection points is counted. If the virtual ray happens to pass through a vertex of the closed regular polygon, or happens to completely coincide with a side of the regular polygon, the direction of the virtual ray needs to be slightly adjusted by 0.1 degrees along the positive y-axis. The adjustment angle must ensure that the ray no longer passes through a vertex or... The points coincide at the edges, and then the number of intersections is counted again. If the number of intersections is odd, the point cloud is determined to be inside the closed regular polygon and belongs to the point cloud of the mounting face of the confinement device. If the number of intersections is even, the point cloud is determined to be outside the closed regular polygon and does not belong to the point cloud of the mounting face. Finally, the point cloud dataset of the mounting face is formed. All point cloud points determined to be inside the closed regular polygon are collected. Then, the collected point cloud points are deduplicated. The criterion is that if the x, y, and z values ​​of two point cloud points are exactly the same, only one point cloud point is kept. After deduplication, the remaining point cloud points together form the point cloud dataset of the mounting face of the confinement device.

[0051] Step 331: Based on the point cloud dataset, perform plane fitting on the point cloud using the least squares method to calculate the plane normal vector of the end face of the confinement device. Specifically, this includes: first, setting the mathematical expression of the spatial plane, using the general equation of the spatial plane Ax + By + Cz + D = 0 as the fitting target, where A, B, C, and D are parameters to be determined, and the square of A plus the square of B plus the square of C is not equal to 0, ensuring that the equation represents an effective plane. x, y, and z represent the spatial rectangular coordinate values ​​of any point in the point cloud dataset. Then, calculate the equation error for each point, and extract the coordinates (x1, y1, z1), (x2, y2, z2), ..., (x...) of each point in the point cloud dataset of the end face of the confinement device obtained in step 330. n y n , z n ), where n represents the total number of point cloud points in the point cloud dataset. Substituting the x, y, and z values ​​of each point cloud point into the general equation of the plane yields the calculated value for each point cloud point: A multiplied by x1 plus B multiplied by y1 plus C multiplied by z1 plus D (corresponding to the first point), A multiplied by x2 plus B multiplied by y2 plus C multiplied by z2 plus D (corresponding to the second point)... A multiplied by x n Add B multiplied by y n Add C multiplied by z nAdd D (corresponding to the nth point), then take the absolute value of each equation's calculated value. This absolute value is the error value of the corresponding point cloud point relative to the fitting plane. Then, construct and call the total error sum of squares function. The specific description of this function is as follows: it quantifies the overall deviation of the plane corresponding to the current plane parameters A, B, C, and D from all point cloud points on the end face, providing a basis for judgment in finding the final parameters. At the same time, it avoids excessive interference of single extreme errors on the fitting results through squaring operations. The input parameters are: first, the error values ​​e1, e2...en of all point cloud points in the end face point cloud dataset; second, the total number of point cloud points n. The specific processing procedure is as follows: First, perform a squaring operation on each error value, multiplying e1 by... The first step is to calculate the square of e1, multiply e2 by e2 to get the square of e2, and so on, until en is multiplied by en to get the square of en. The second step is to calculate the total sum of squares of errors: sum all the squared error values, i.e., the square of e1 plus the square of e2 plus... plus the square of en. The sum is the total sum of squares of errors, a non-negative value. The smaller the value, the higher the fit between the current plane and the installation end face. Then, determine the final plane parameters. By adjusting the values ​​of A, B, C, and D, and repeatedly calling the total sum of squares of errors function, find the parameter combination that minimizes the total sum of squares of errors. The first step is to fix the value of parameter A at 1. The second step is to adjust parameter B in increments of 0.01. The first step involves adjusting parameter B. Each time B is adjusted, the total sum of squared errors (SSE) function is called to calculate the SSE, and the B value that minimizes the SSE is recorded as the current final B value. The second step involves adjusting parameter C. Using a fixed A=1 and the optimal B value as a base, the C value is adjusted in steps of 0.01. Each adjustment to C calls the SSE function to find the C value that minimizes the SSE, which is then recorded as the current final C value. The third step involves adjusting parameter D. Using A=1, the final B value, and the final C value as a base, the D value is adjusted in steps of 0.01. Each adjustment to D calls the SSE function to find the D value that minimizes the SSE, which is then recorded as the current final D value. The fifth step is to fine-tune A and verify it iteratively. Fine-tune the value of A in steps of 0.01 (e.g., from 1 to 1.01 or 0.99). Repeat the operations from the second to the fourth step until the sum of squared errors no longer decreases after adjusting the parameters. At this point, A, B, C, and D are the final combination of plane parameters. Finally, determine the plane normal vector of the mounting end face. According to the mathematical properties of the equation of a space plane, in the general equation of a plane Ax + By + Cz + D = 0, the vector composed of parameters A, B, and C is completely consistent with the direction of the normal to the plane. Therefore, combine the values ​​of A, B, and C in the final parameter combination in order to obtain the vector (A, B, C), which is the plane normal vector of the mounting end face of the beam limiting device.

[0052] Step 332: Based on the plane normal vector and the spatial distribution of the point cloud dataset, calculate the coordinates of the geometric center point of the end face of the beam confinement device, which will be used as the spatial coordinates of the beam confinement device. Specifically, this includes: firstly, extracting the coordinates of all points in the point cloud dataset. From the point cloud dataset of the end face of the beam confinement device obtained in step 330, extract all the spatial rectangular coordinates of all point cloud points to obtain a set of coordinate data, namely (x1, y1, z1), (x2, y2, z2)...(xn, yn, zn), where n is the total number of point cloud points in the point cloud dataset, and x1 to xn represent each point. The x-axis coordinates of the cloud points are given by y1 to yn, representing the y-axis coordinates of each point cloud point, and z1 to zn, representing the z-axis coordinates of each point cloud point. Next, the x-axis coordinates of the geometric center point are calculated by summing the x-axis coordinates of all extracted point cloud points (x1 + x2 + x3 + ... + xn) to obtain the total x-axis coordinates. Then, the total x-axis coordinates are divided by the total number of point cloud points, n. The result is the x-axis coordinate of the geometric center point on the end face of the beam confinement device. The calculation process can be described as (x1 + x2 + ... + xn) ÷ n. Then, the y-axis coordinates of the geometric center point are calculated using... The same method is used to calculate the x-axis coordinates. Add the y-axis coordinates of all point cloud points (y1 + y2 + ... + yn) to obtain the total y-axis coordinates. Divide this total by the total number of point cloud points, n, to get the y-axis coordinate of the geometric center point: (y1 + y2 + ... + yn) ÷ n. Next, calculate the z-axis coordinates of the geometric center point. Since the mounting surface of the beam limiter is a flat plane, its z-axis coordinate value is essentially constant. Therefore, similarly, add the z-axis coordinates of all point cloud points (z1 + z2 + z3 + ... + zn) to obtain the total z-axis coordinates. The sum of the z-axis coordinates is divided by the total number of points n in the point cloud to obtain the z-axis coordinate of the geometric center point, i.e., (z1+z2+…+zn)÷n. Finally, the spatial coordinates of the beam confinement device are determined by combining the calculated x-axis, y-axis, and z-axis coordinates of the geometric center point in the form of (x-center, y-center, z-center) to form a complete three-dimensional spatial coordinate. Since the geometric center point is located at the center of the mounting end face of the beam confinement device, it can accurately represent the overall spatial position of the beam confinement device in the treatment system. Therefore, this three-dimensional spatial coordinate is used as the spatial coordinate of the beam confinement device.

[0053] Step 333: Based on the spatial coordinates and planar normal vector of the clamping device, the relative pose relationship between the tool head coordinate system and the clamping device coordinate system is calculated through the coordinate transformation matrix to obtain the offset angle and displacement between the tool head and the clamping device. Specifically, this includes: First, establishing the tool head coordinate system, determining the origin and the directions of each coordinate axis, with the origin set at the center of the tool head gripper; the x-axis direction is the opening and closing direction of the tool head gripper, with the two gripper arms moving in the positive and negative x-axis directions respectively when the gripper opens, and in opposite directions when it closes; the y-axis direction is parallel to the tool head end face and perpendicular to the x-axis (if the tool head end face is horizontal and the x-axis is left-right, then the y-axis is front-back); the z-axis direction is perpendicular to the tool head end face (if the tool head end face is horizontal, the x-axis is left-right, and the y-axis is front-back, then the z-axis is up-down), and follows the right-hand coordinate system rule (the four fingers of the right hand turn from the x-axis to the y-axis, and the thumb points to the positive z-axis direction).

[0054] Next, a coordinate system for the beam confinement device is established, determining the origin and the directions of each coordinate axis. The origin is set as the spatial coordinate of the beam confinement device obtained in step 332 (the geometric center point of the mounting end face); the z-axis direction is the direction of the plane normal vector obtained in step 331 (since the plane normal vector is perpendicular to the mounting end face, the z-axis direction is consistent with the direction of the normal vector of the mounting end face); the x-axis direction is parallel to the beam output direction of the boron neutron capture therapy system (if the beam output direction is horizontal to the right, then the positive x-axis direction is horizontal to the right); the y-axis direction is perpendicular to the x-axis and z-axis, and follows the right-hand coordinate system rule (the four fingers of the right hand turn from the x-axis to the y-axis, and the thumb points to the positive z-axis direction); then, a coordinate transformation matrix is ​​constructed, which consists of a translation transformation part and a rotation transformation part. The translation transformation part is used to describe the origin of the beam confinement device coordinate system relative to the workpiece. The tool head coordinate system's origin is offset; the rotation transformation describes the angular offset of each coordinate axis of the clamping device coordinate system relative to each coordinate axis of the tool head coordinate system; then, the displacement corresponding to the translation transformation is calculated, and the displacement components in the x, y, and z directions are calculated respectively. The x-direction displacement component is equal to the x-axis coordinate value of the clamping device coordinate system's origin minus the x-axis coordinate value of the tool head coordinate system's origin; the y-direction displacement component is equal to the y-axis coordinate value of the clamping device coordinate system's origin minus the y-axis coordinate value of the tool head coordinate system's origin; the z-direction displacement component is equal to the z-axis coordinate value of the clamping device coordinate system's origin minus the z-axis coordinate value of the tool head coordinate system's origin. Combining these three displacement components yields the displacement between the tool head and the clamping device, which reflects the spatial position deviation of the clamping device relative to the tool head.

[0055] To calculate the offset angle corresponding to the rotation transformation, the vector dot product function and the inverse cosine function need to be called. The specific descriptions of the two functions are as follows: The vector dot product function calculates the dot product of two spatial unit vectors, providing basic data for finding the included angle using the inverse cosine function. The input parameters are the components of the two spatial unit vectors, such as vector 1 (v1x, v1y, v1z) and vector 2 (v2x, v2y, v2z). The specific processing procedure is to calculate the result of multiplying v1x by v2x, add the result of multiplying v1y by v2y, and add the result of multiplying v1z by v2z. The sum obtained is the dot product of the two vectors. The output result is a numerical value, ranging from -1 to 1. The inverse cosine function derives the angle between two unit vectors from their dot product, quantifying the attitude deviation between coordinate systems. Input parameters include the dot product value, which is the output of the vector dot product calculation function. The specific processing follows the mathematical properties of the dot product (dot product = magnitude of vector 1 × magnitude of vector 2 × cosθ, where θ is the angle between the two vectors). Since the input is a unit vector (both with a magnitude of 1), the dot product value is cosθ. An inverse cosine operation is then performed on this dot product value to obtain the angle θ, which ranges from 0 to 180 degrees. The output is the angle value, representing the angle between the two unit vectors.

[0056] Based on the two functions mentioned above, two key angles are calculated. The first angle is the angle between the z-axis of the tool head coordinate system and the z-axis of the clamping device coordinate system. First, obtain the unit vector of the tool head z-axis (e.g., if the z-axis is perpendicular to the tool head end face and pointing upwards, the unit vector is (0, 0, 1)) and the unit vector of the clamping device z-axis (by dividing the plane normal vector (A, B, C) by its magnitude, where the magnitude is the square root of the sum of the squares of A, B, and C, resulting in the unit vector (A ÷ magnitude, B ÷ magnitude, C ÷ magnitude)). Then, call the vector dot product function to calculate the dot product of the two unit vectors. Finally, call the inverse cosine function to calculate this dot product value; the resulting angle is the angle around the tool head along the x-axis or y-axis. The first angle is the offset angle of the axis (determined around the axis based on the actual coordinate system direction, reflecting the attitude deviation in the plane perpendicular to the z-axis); the second angle is the angle between the x-axis of the tool head coordinate system and the x-axis of the beam limiter coordinate system. First, obtain the unit vector of the tool head x-axis (e.g., if the x-axis is the opening and closing direction of the gripper, the unit vector is (1, 0, 0)) and the unit vector of the beam limiter x-axis (parallel to the beam output direction, e.g., when the beam output is to the right, the unit vector is (1, 0, 0)); call the vector dot product calculation function to calculate the dot product of the two unit vectors; call the inverse cosine function to operate on the dot product value, and the resulting angle is the offset angle of the tool head around the z-axis (reflecting the attitude deviation around the z-axis rotation direction).

[0057] Finally, the relative pose relationship is determined. The calculated displacements (x, y, z direction components) and offset angles (around the x-axis or y-axis, around the z-axis) are integrated into the coordinate transformation matrix. Consistency is verified through matrix operations. The coordinates of the origin of the constraining device coordinate system in the tool head coordinate system are calculated based on the transformation matrix, and must be consistent with the previously calculated displacement components. The angles between the coordinate axes of the constraining device coordinate system and the coordinate axes of the tool head coordinate system are calculated based on the transformation matrix, and must be consistent with the previously calculated offset angles. After verification, the relative pose relationship between the tool head coordinate system and the constraining device coordinate system can be determined, and thus the offset angle and displacement between the tool head and the constraining device can be obtained.

[0058] By combining polygon interior point judgment algorithm to filter point cloud points on the installation end face, the point cloud data of the end face and non-end face can be accurately distinguished. The least squares method combined with the total error sum of squares function is used for plane fitting, which can offset the small measurement errors that may exist in the point cloud data to the greatest extent, so that the fitted plane parameters are highly consistent with the actual shape of the installation end face.

[0059] In a preferred embodiment of the present invention, step 4 above, adjusting the positions of the robotic arm and the tool head according to the offset angle and displacement, so that the gripper of the tool head connects with the constraint device and performs flexible clamping, may include:

[0060] In this embodiment of the invention, step 440 involves driving the joints of the robotic arm to move based on the offset angle and displacement, so that the tool head moves to a predetermined position in front of the limiting device. Specifically, this includes: firstly determining the offset angle and displacement data to be used, which is the result calculated in step 333. The displacement includes components in three directions: x, y, and z. The x-direction displacement is the x-coordinate of the origin of the limiting device coordinate system minus the x-coordinate of the origin of the tool head coordinate system; the y-direction displacement is the y-coordinate of the origin of the limiting device coordinate system minus the y-coordinate of the origin of the tool head coordinate system; and the z-direction displacement is the z-coordinate of the origin of the limiting device coordinate system minus the z-coordinate of the origin of the tool head coordinate system. The offset angle includes the angle of the tool head around the x-axis or y-axis, corresponding to the angle between the z-axis of the tool head and the z-axis of the limiting device, and the angle of the tool head around the z-axis, corresponding to the angle between the x-axis of the tool head and the x-axis of the limiting device.

[0061] Next, the displacement and offset angle are decomposed into motion parameters of each joint of the robotic arm. In this embodiment, the robotic arm is a six-degree-of-freedom robotic arm, with each joint corresponding to a different spatial motion direction. For example, the first joint controls the rotation of the robotic arm around the moving platform, the second joint controls the up-and-down swing of the upper arm, the third joint controls the back-and-forth swing of the forearm, and the fourth to sixth joints control the attitude adjustment of the tool head. The decomposition process is as follows: For the x-direction displacement, based on the link lengths of the first and second joints of the robotic arm (link lengths are fixed parameters in the design of the robotic arm), the required joint rotation angle is calculated. The x-direction displacement is subtracted from the link length of the first joint to obtain the required rotation angle of the first joint. For angles, if the displacement is positive, the joint rotates clockwise; if it is negative, it rotates counterclockwise. For y-direction displacement, the y-direction position is subtracted from the length of the second joint link to obtain the required rotation angle of the second joint. For z-direction displacement, the z-direction position is subtracted from the length of the third joint link to obtain the required rotation angle of the third joint. For offset angles, the angle of the tool head around the x-axis is adjusted by the fourth joint, and this offset angle is directly used as the required rotation angle of the fourth joint. The angle of the tool head around the y-axis is adjusted by the fifth joint, and this offset angle is used as the required rotation angle of the fifth joint. The angle of the tool head around the z-axis is adjusted by the sixth joint, and this offset angle is used as the required rotation angle of the sixth joint.

[0062] Then, the robotic arm is driven to move each joint according to the calculated parameters. Each joint of the robotic arm is equipped with a drive motor and a motion controller. The motion controller receives the target rotation angle of each joint and controls the corresponding motor to operate. During the operation of the motor, the rotation progress is fed back to the motion controller in real time. When the actual rotation angle of a certain joint reaches the target rotation angle, the motion controller controls the motor to stop operating. After all joints have completed the target rotation, the tool head moves to the predetermined position in front of the constraint device. The predetermined position is a certain gap from the mounting end face of the constraint device, and the center of the tool head gripper is approximately on the same vertical line as the geometric center point of the constraint device.

[0063] Step 441: Based on the tool head positioning result, acquire the relative position image between the tool head and the constraint device through the vision system. Specifically, this includes: first, confirming the working status of the vision system, which is a stereo vision camera installed on the third joint of the robotic arm; first, checking if the camera lens is clean, and cleaning it using the camera's built-in cleaning component if necessary; then adjusting the camera's shooting angle, controlling the third joint to rotate slightly so that the camera's lens axis aligns with the connection area between the tool head gripper and the constraint device mounting surface, ensuring that the shooting range simultaneously and completely includes the overall outline of both the tool head gripper and the constraint device mounting surface; next, initiating the image acquisition process, the vision system's control module sends a synchronous acquisition command to the two RGB cameras, and the two cameras acquire an RGB color image simultaneously, forming a set of images with parallax: a left-eye image and a right-eye image. To reduce interference from ambient light, such as light reflections in the treatment room, five sets of images were continuously acquired during the acquisition process. Then, the left-eye images in each set were averaged. The RGB values ​​of corresponding pixels in the five sets of left-eye images were added together and then divided by 5 to obtain the averaged left-eye image. The same averaging operation was performed on the right-eye images to obtain two sets of denoised left-eye average images and right-eye average images. Finally, the average images were preliminarily labeled. Using image recognition technology, such as comparing the preset tool head gripper contour template and the beam limiter mounting end face contour template, the edge contour of the tool head gripper was marked with white lines in the left-eye average image, and the edge contour of the beam limiter mounting end face was marked with red lines. The same labeling operation was performed in the right-eye average image to form a relative position image with contour markings. This image can intuitively reflect the current relative position relationship between the tool head and the beam limiter.

[0064] Step 442: Based on the relative position image and encoder feedback data, adjust the rotation angles of each joint of the robotic arm to align the tool head with the constraint device. Specifically, this includes: first, determining the ideal alignment state between the tool head and the constraint device. The standard for this state is that the center of the tool head gripper and the geometric center of the constraint device are not offset in the x, y, and z directions; the end face of the gripper is parallel to the mounting end face of the constraint device, i.e., the z-axis of the gripper is completely coincident with the z-axis of the constraint device, and the x-axis of the gripper is completely coincident with the x-axis of the constraint device. Next, analyze the offset in the relative position image and compare the average left-eye image with the contour markers with the ideal alignment state. For the image template, if the center of the white gripper contour in the image deviates from the center of the red mounting end face contour in the x direction, the deviation distance is measured and represented by the number of image pixels. Then, according to the conversion relationship between the pixels of the vision system and the actual distance, the number of pixels is converted into the actual deviation distance. The conversion relationship is that the actual distance is equal to the number of pixels multiplied by the calibrated pixel size of the vision system. The calibrated pixel size is a preset fixed value. If the gripper end face contour and the mounting end face contour are not parallel, the angle between the two contours is measured and calculated by the slope difference of the two contour edge lines in the image. The slope difference is equal to the difference of the slopes of the two edge lines. Then, the actual angle is obtained according to the angle relationship corresponding to the slope difference.

[0065] Simultaneously, feedback data from the encoders of each joint of the robotic arm is read. The encoders are mounted on the rotation axis of each joint and can output the current rotation angle of the joint in real time. For example, the current angle of the first joint is α1, the second joint is α2, and so on up to the sixth joint is α6. Based on the actual deviation distance and included angle obtained from image analysis, the required adjustment angle for each joint is calculated. For the actual deviation distance in the x-direction, if an adjustment to the left is needed, the angle that the first joint needs to increase is calculated. The adjustment angle is equal to the actual deviation distance divided by the link length of the first joint, where the link length is a fixed value. The target angle after adjustment is α1 plus the adjustment angle. For the angle between the gripper and the mounting end face, if it is necessary to make the gripper end face flat... When the robot arm is positioned at the mounting end face, the angle that the fourth joint needs to be adjusted is calculated. The adjustment angle is equal to the measured included angle. If the included angle is positive, the target angle is α4 minus the adjustment angle. Then, the robot arm joint is driven to perform the adjustment. Based on the calculated target angle of each joint, a running command is sent to the drive motor of the corresponding joint. The motor drives the joint to rotate to the target angle. The encoder provides real-time feedback on the rotation progress. When the actual angle of the joint reaches the target angle, the motor stops running. After the adjustment is completed, a new relative position image is obtained again through the vision system. The above analysis, calculation, and adjustment process is repeated until the tool head gripper and the constraint device reach an ideal alignment state in the new image. At this point, the joint adjustment is stopped.

[0066] Step 443: Based on the precise alignment of the tool head, control the gripper to close and monitor the clamping force in real time through a force feedback sensor. When the clamping force reaches a preset threshold, complete the flexible clamping of the constraint device. Specifically, this includes: first, setting the gripper closing parameters, with the gripper closing speed preset to slow, the initial closing position being fully open, and the distance between the two gripper arms being greater than the diameter of the constraint device mounting end face to ensure smooth clamping of the constraint device; sending a closing start command to the tool head's gripper control mode, and the gripper control mode driving the two gripper arms to slowly close at a preset speed. The device closes inwards, and then the monitoring process of the force feedback sensor is initiated. The force feedback sensor is integrated on the gripper arm of the gripper and can detect the pressure of the gripper on the limiting device in real time. The sensor monitors 10 times per second. The gripping force data obtained each time is transmitted to the main controller of the maintenance robot in real time. The main controller has a preset threshold for the gripping force. This threshold is determined according to the material of the limiting device, such as lead or aluminum, and the structural strength of the mounting end face. This ensures that the gripping force is sufficient to keep the limiting device stable and prevent it from falling off, while also avoiding excessive gripping force that could damage the sealing layer of the limiting device.

[0067] During the gripper closure process, the main controller continuously compares the real-time gripping force transmitted by the sensor with a preset threshold. If the real-time gripping force is less than the preset threshold, the gripper closure speed is maintained until the real-time gripping force approaches the preset threshold. When the real-time gripping force reaches the preset threshold, the main controller immediately sends a stop closure command to the gripper control module, and the gripper arms stop moving. At this time, the gripper's gripping state on the constraint device is flexible (both firm and without damaging the device). If the real-time gripping force exceeds the preset threshold during monitoring (such as sensor malfunction or gripper movement deviation), the main controller will immediately send a reverse command to control the gripper arms to slightly open outward (the opening distance is a preset small distance) until the real-time gripping force drops below the preset threshold. Then, the gripper is slowly closed again to ensure that the final gripping force accurately reaches the preset threshold, completing the flexible gripping.

[0068] By precisely decomposing displacement and offset angle into motion parameters of each joint of the robotic arm, the tool head can be stably moved to the predetermined position in front of the beam limiter. The relative position image with contour markings is obtained by the vision system, which can intuitively reflect the spatial positional relationship between the tool head and the beam limiter. At the same time, environmental interference is reduced by noise reduction processing. By combining the visual feedback of the relative position image and the joint angle feedback of the encoder, dual calibration is achieved. This can not only accurately correct the position offset and attitude deviation of the tool head, but also ensure the alignment accuracy through repeated adjustments, avoiding the alignment failure of the tool head and the beam limiter due to the error of a single feedback.

[0069] In a preferred embodiment of the present invention, step 5 above, which involves controlling the robotic arm and tool head to disassemble the constraint device based on the gripper's holding state of the constraint device, and transferring the disassembled constraint device to a shielded container for storage, may include:

[0070] In this embodiment of the invention, step 550 involves controlling the tool head to disassemble the restraint device using a multi-stage torque disassembly method. The disassembly torque is monitored in real-time by a torque sensor, and the disassembly force is adjusted in stages according to a preset torque threshold. Specifically, this includes: first, determining the stages of the multi-stage torque disassembly and the corresponding preset torque thresholds; combining the installation tightness and material characteristics of the restraint device, dividing the disassembly process into three stages: a pre-loosening stage, a main disassembly stage, and a finishing stage. Each stage has a preset torque threshold: the pre-loosening stage threshold is 30% of the restraint device installation torque, the main disassembly stage threshold is 70% of the installation torque, and the finishing stage threshold is 20% of the installation torque. Then, the real-time monitoring function of the torque sensor is activated. The torque sensor is integrated on the gripper rotation shaft of the tool head and can... The torque value generated on the restraint device during the rotation and disassembly of the gripper is detected in real time at a frequency of 15 times per second. Each detected torque data is transmitted to the main controller of the maintenance robot in real time. The main controller first sends a pre-loosening disassembly command to the gripper control mode. The gripper begins disassembly by rotating slowly (to avoid a sudden increase in torque). At the same time, the main controller continuously compares the current torque value transmitted by the sensor with the preset threshold of the pre-loosening stage. If the current torque value is less than the pre-loosening stage threshold, it sends a command to the gripper control mode to increase the rotation driving force of the gripper, so that the disassembly force gradually increases. When the current torque value reaches the pre-loosening stage threshold, the increase in driving force is stopped, and the gripper continues to rotate at this force until the restraint device is slightly loosened (judged by a slight drop in torque value within 0.5 seconds), at which point the pre-loosening stage ends.

[0071] The main disassembly phase then begins. The main controller automatically switches the comparison benchmark to the preset torque threshold for the main disassembly phase and sends a command to the gripper control module to appropriately increase the gripper rotation speed. Simultaneously, it continues to monitor the current torque value. If the current torque value is lower than the main disassembly phase threshold, the rotational driving force is increased until the threshold is reached. Once the threshold is reached, the driving force remains constant, and the gripper continues to rotate. At this point, the clamping device's fastening state is quickly released, and the torque value monitored by the torque sensor fluctuates around the threshold until most of the connection between the clamping device and the installation interface is disengaged, ending the main disassembly phase. Finally, the finishing phase begins. The main controller switches the comparison benchmark to the preset torque threshold for the finishing phase and sends a command to reduce the gripper rotation speed and driving force, causing the current torque value to drop to the finishing phase threshold. If the current torque value is higher than the finishing phase threshold, the gripper rotation driving force is reduced. Once the threshold is reached, the gripper is slowly rotated with this force until the gripper causes the clamping device to begin to exhibit slight displacement (determined by subsequent infrared ranging sensor data). At this point, the gripper rotation stops, completing the core process of the multi-stage torque disassembly.

[0072] Step 551: During disassembly, the infrared ranging sensor on the tool head monitors the displacement distance of the beam-limiting device. When the displacement distance reaches a preset value, the disassembly of the beam-limiting device is deemed complete. Specifically, this includes: first, determining the monitoring reference and initial value of the infrared ranging sensor. The infrared ranging sensor is installed on the outside of the tool head gripper, with its lens facing the mounting end face of the beam-limiting device, i.e., the fixed plane of the beam outlet of the boron neutron capture therapy system. The monitoring direction is parallel to the normal direction of the mounting end face, i.e., consistent with the z-axis direction of the beam-limiting device coordinate system. Before step 550 begins, the sensor first collects an initial distance value between itself and the mounting end face, recorded as the initial distance. The initial distance is L0. At this point, the clamping device is not disassembled, and the distance between the sensor and the mounting surface is equal to the fixed distance between the tool head and the mounting surface. This initial value is stored in the main controller. Then, during the disassembly process, real-time monitoring is started. As the gripper rotates and disassembles in step 550, the clamping device will gradually move away from the mounting surface. The infrared ranging sensor will continuously collect the real-time distance value between itself and the mounting surface, which is recorded as the real-time distance Lt. The collection frequency is the same as that of the torque sensor. After each collection, the real-time distance Lt is transmitted to the main controller. The main controller calculates the displacement distance = real-time distance Lt - initial distance L0 to obtain the current displacement distance of the clamping device relative to the mounting surface.

[0073] Then, a preset value for the displacement distance is set. This preset value is equal to the depth to which the constricting device extends into the outlet of the treatment system during installation. It is determined by the structural dimensions of the constricting device. For example, the installation end of a frustum-shaped constricting device extends to a depth of 5 cm. When the displacement distance of the constricting device reaches this value, it means that it has completely detached from the installation interface of the outlet. The main controller continuously compares the calculated current displacement distance with the preset value. If the current displacement distance is less than the preset value, it is determined that the constricting device has not been completely disassembled, and the disassembly action in step 550 continues. If the current displacement distance is equal to or greater than the preset value, a stop disassembly command is immediately sent to the tool head, the gripper stops rotating, and the main controller determines that the constricting device has been disassembled. If the displacement distance growth stops during the comparison process, that is, the displacement distance collected for 3 consecutive times remains unchanged, the main controller will backtrack the real-time data of the torque sensor. If the torque value is still within the threshold range of the final stage, the torque threshold of the final stage will be appropriately increased, driving the gripper to continue to rotate slowly until the displacement distance grows again and reaches the preset value, ensuring that the constricting device is completely detached from the installation interface.

[0074] Step 552: After disassembly, the position image of the shielding container is acquired through the vision system, and the spatial coordinates and opening posture of the shielding container are calculated based on image processing. Specifically, this includes: first, adjusting the shooting angle and range of the vision system, which is a binocular RGB camera mounted on the third joint of the robotic arm. After the constraint device is disassembled, the main controller sends a command to the robotic arm to drive the third joint to rotate slowly, so that the camera lens faces the shielding container on the moving platform. The shielding container is fixed to the right side of the moving platform, ensuring that the shooting range can completely encompass the overall outline of the shielding container, while avoiding interference from other equipment in the treatment room entering the shooting frame. Next, binocular images of the shielding container are acquired and preprocessed. A synchronous acquisition command is sent to the binocular cameras, and each camera acquires an RGB color image (left and right eye images) simultaneously. Three sets of images are acquired continuously to reduce ambient light interference. Noise reduction processing is performed on each set of images. The R, G, and B color values ​​of corresponding pixels in the three sets of left-eye images are added together and then divided by 3 to obtain the averaged denoised left-eye image. The same averaging operation is performed on the three sets of right-eye images to obtain the denoised right-eye image, ensuring that the outline of the shielding container in the image is clear. Then, the feature points of the shielding container are extracted and a 3D point cloud model is constructed. Using image recognition technology, the key feature points of the shielding container are marked in the left-eye denoised image, including the four corner points of the top opening of the container (the rectangular vertices of the opening of the cuboid container) and the four corner points of the bottom surface of the container body. According to the calibration parameters of the binocular camera (the preset distance between the two cameras, focal length, etc.), the disparity between each feature point in the left-eye image and the corresponding feature point in the right-eye image is calculated (represented by the difference in the x-coordinate of the feature point in the two images). Then, the disparity is converted into depth information (depth = camera distance × focal length ÷ disparity) to obtain the spatial rectangular coordinate z-axis coordinate of each feature point (with the robotic arm base as the origin).

[0075] Next, the spatial coordinates of the shielding container are calculated. Taking the four corner points of the opening at the top of the container as the reference, the average values ​​of the x-axis, y-axis, and z-axis coordinates of the four corner points are calculated respectively. The x-axis coordinate values ​​of the four corner points are added together and then divided by 4 to obtain the x-axis coordinate of the opening center; the y-axis coordinate values ​​of the four corner points are added together and then divided by 4 to obtain the y-axis coordinate of the opening center; the z-axis coordinate values ​​of the four corner points are added together and then divided by 4 to obtain the z-axis coordinate of the opening center. The three-dimensional coordinates formed by the combination of these three coordinate values ​​are the spatial coordinates of the shielding container (representing the center position of the container opening); finally, the opening orientation of the shielding container is calculated. The opening orientation is represented by the normal vector of the opening plane. Take the three corner points of the top opening (such as the top left, top right, and bottom left corners), and calculate the normal vector of the opening plane based on the spatial coordinates of these three points. First, calculate the vector from the top left corner to the top right corner (vector 1, top right x-coordinate minus top left x-coordinate, top right y-coordinate minus top left y-coordinate, top right z-coordinate minus top left z-coordinate), then calculate the vector from the top left corner to the bottom left corner (vector 2, bottom left x-coordinate minus top left x-coordinate, bottom left z-coordinate minus top left z-coordinate). The normal vector of the opening plane is obtained by subtracting the y-coordinate of the top left corner from the y-coordinate of the angle, and subtracting the z-coordinate of the bottom left corner from the z-coordinate of the angle. The normal vector is then obtained through the cross product operation (multiplying the y-component of vector 1 by the z-component of vector 2, and subtracting the product of the z-components of vector 1 and 2 to obtain the normal vector x-component; multiplying the z-component of vector 1 by the x-component of vector 2, and subtracting the product of the x-components of vector 1 and 2 to obtain the normal vector y-component; multiplying the x-component of vector 1 by the y-component of vector 2, and subtracting the product of the x-components of vector 1 and 2 to obtain the normal vector z-component). The direction of this normal vector is the orientation of the opening of the shielding container (representing the vertical direction of the opening plane).

[0076] Step 553: Based on the spatial coordinates and opening orientation of the shielding container, control the robotic arm to move the disassembled restraint device above the shielding container and adjust the tool head orientation to accurately place the restraint device into the shielding container for storage. Specifically, this includes: first, calculating the movement parameters of each joint of the robotic arm; based on the spatial coordinates of the shielding container (x_container, y_container, z_container) obtained in step 552 and the current spatial coordinates of the tool head (x_claw, y_claw, z_claw), calculating the displacement differences in the x, y, and z directions respectively. The displacement difference in the x direction is x_container minus x_claw; the displacement difference in the y direction is y_container minus y_claw; and the displacement difference in the z direction is (z_container plus 10 cm) minus z_claw (the 10 cm increase is to move the restraint device directly above the container opening). (Maintaining a safe distance from the opening to avoid collision with the container edge). Based on the link lengths of each joint of the robotic arm (preset fixed parameters, such as the link length L1 of the first joint, the link length L2 of the second joint, etc.), the displacement difference in the three directions is decomposed into the rotation angle of each joint. For the displacement difference in the x-direction, the displacement difference is divided by the link length L1 of the first joint to obtain the required rotation angle of the first joint (if the displacement difference is positive, the joint rotates clockwise; if it is negative, it rotates counterclockwise). For the displacement difference in the y-direction, the displacement difference is divided by the link length L2 of the second joint to obtain the required rotation angle of the second joint. For the displacement difference in the z-direction, the displacement difference is divided by the link length L3 of the third joint to obtain the required rotation angle of the third joint. The calculated target angles of each joint are sent to the drive motor of the corresponding joint. The motor drives the joint to rotate, causing the tool head carrying the restraint device to move directly above the opening of the shielded container.

[0077] Next, adjust the tool head posture to match the opening posture. Based on the normal vector of the shielding container opening plane obtained in step 552, calculate the deviation angle between the current tool head posture and the opening posture. The direction of the central axis of the tool head gripper, i.e., the direction of the axis of the constraint device, must be consistent with the direction of the normal vector of the opening plane. If there is an angle between the current tool head axis direction and the normal vector, adjust the angle by rotating the fourth, fifth, and sixth joints. For example, if the z-component of the normal vector is larger than the z-component of the tool head axis, drive the fourth joint to rotate clockwise, and simultaneously fine-tune through the sixth joint until the tool head axis direction is aligned with the normal vector of the opening plane. The quantities are completely aligned to ensure that the confinement device can be placed vertically into the container along the normal vector direction. Then, the tool head is controlled to slowly lower the confinement device, and a slow lowering command is sent to the gripper control mode to drive the third joint of the robotic arm to move slowly downward (the displacement in the z direction gradually decreases), so that the confinement device approaches the opening of the shielded container at a speed of 2 centimeters per second. During the lowering process, the relative position of the confinement device and the container opening is captured in real time by the vision system. If the edge of the confinement device is found to be offset from the edge of the opening, the angles of the first and second joints are immediately finely adjusted to correct the positional deviation and ensure that the confinement device is always above the center of the opening.

[0078] Finally, after confirming that the clamping device is in place and stored, when the device is lowered to the bottom and contacts the magnesium fluoride liner (the inner layer material of the shielding container), a slight pressure feedback is detected by the force feedback sensor of the tool head (at this time, the pressure value is less than 50% of the preset clamping force threshold). The main controller determines that the bottom of the container has been reached, sends a stop lowering command to the robotic arm, and simultaneously sends an opening command to the gripper, causing the gripper to slowly open to the fully open state (ensuring no friction with the clamping device). After opening, the robotic arm drives the tool head to move upward by 5 cm, moving it out of the opening range of the shielding container, completing the storage operation of the clamping device. Afterwards, an image of the inside of the container is captured by the vision system to confirm that the clamping device is stably placed inside the container without tilting or protrusion.

[0079] Through multi-stage torque control and real-time torque monitoring, damage to the sealing layer of the beam limiting device or difficulty in disassembly caused by a single disassembly force is avoided. At the same time, the small force control in the final stage prevents the device from suddenly falling off, protecting the structural integrity and radiation protection sealing performance of the beam limiting device. The displacement distance is accurately monitored by an infrared ranging sensor, which can objectively determine whether the beam limiting device has completely detached from the installation interface, avoiding damage to the device or installation interface caused by excessive disassembly, and also preventing the risk of collision caused by moving before disassembly is completed, ensuring the safety and integrity of the disassembly process.

[0080] In a preferred embodiment of the present invention, step 6 above, after completing the disassembly and storage operations, involves controlling the robotic arm and tool head to retrieve the restraint device with a predetermined opening size from the shielded container and performing an installation operation, which may include:

[0081] In this embodiment of the invention, step 660 involves scanning the interior of the shielding container using a vision system based on the completed disassembly and storage operations to locate a new confinement device with a predetermined opening size, thereby obtaining a positioning result. Specifically, this includes: firstly, determining the predetermined opening size parameter of the new confinement device, which is determined based on the location and size of the tumor in the patient being treated. For example, for small brain tumors, the predetermined opening size is a circle with a diameter of 3 cm; for trunk tumors, the predetermined opening size is a circle with a diameter of 8 cm. This size parameter is preset in the main controller of the maintenance robot. Next, the scanning angle and range of the vision system are adjusted. The vision system is a binocular RGB camera mounted on the third joint of the robotic arm. The main controller sends instructions to the robotic arm to drive the third joint to rotate slowly, so that the camera lens is vertically aligned with the top opening of the shielding container. At the same time, the robotic arm is controlled to move the camera slowly along the edge of the container opening (the movement path is the circular trajectory of the opening), ensuring that the scanning range can cover all areas inside the container (the container can accommodate two confinement devices; the old device has been placed on one side as per step 553, and the new device is located on the other side).

[0082] Then, the internal scanning and image acquisition of the binocular camera were initiated. A synchronous scanning command was sent to the camera, which continuously acquired RGB color images (left and right eye images) of the container's interior at a frequency of 5 frames per second, acquiring a total of 10 sets of images to cover different locations inside the container. Each set of images was preprocessed. First, reflective areas in the images were removed (the tungsten layer on the inner wall of the container may produce reflections; by comparing the brightness difference between adjacent pixels, pixels with brightness exceeding the normal range were replaced with the average value of surrounding pixels). Then, the R, G, and B values ​​of corresponding pixels in the 10 sets of left eye images were added together and divided by 10 to obtain the denoised left eye image. The same operation was performed on the right eye image to obtain the denoised right eye image, ensuring that the outline of the confinement device in the image was clearly discernible. Afterward, a 3D point cloud model of the container's interior was constructed and the features of the new confinement device were extracted, based on the calibration parameters of the binocular camera (preset camera spacing). The parallax of corresponding pixels in the left and right denoised images is calculated (represented by the difference in x-coordinate of the same pixel in the two images). The parallax is then converted into depth information (depth value = camera spacing × focal length ÷ parallax) to obtain the spatial rectangular coordinate system z-axis coordinates of all pixels inside the container (with the robotic arm base as the origin). Combining RGB color information and depth information, a three-dimensional color point cloud model of the container is generated. The characteristic structure of the confinement device (frustum-shaped main body, top center opening) is identified in the model. The opening diameter of each confinement device is measured through the point cloud model. Multiple point cloud points (no less than 8) at the edge of the opening are selected, and the distance between adjacent points is calculated. The diameter of the opening is then calculated based on the spatial coordinates of the point cloud points (the diameter of the circle formed by the point cloud points at the edge of the opening is taken as the measured value, and the average of multiple diameter measurements is taken as the actual opening size of the device).

[0083] Finally, the opening size is compared and the positioning result is determined. The actual opening size of each beam confinement device is compared with the preset opening size in the main controller. If the actual opening size of a beam confinement device is consistent with the preset opening size, the device is determined to be the target new beam confinement device. The spatial coordinates of the new beam confinement device are extracted through the three-dimensional point cloud model (based on the geometric center point of the opening at the top of the device, the average x-axis coordinate, average y-axis coordinate, and average z-axis coordinate of the point cloud points at the opening edge are calculated, and the three are combined to form the spatial coordinates of the new device). At the same time, the attitude information of the device is extracted (based on the plane normal vector of the device mounting end face, the normal vector direction is obtained by fitting the mounting end face plane through the point cloud model, which is the attitude of the device). The spatial coordinates and attitude information are integrated to form the positioning result and stored in the main controller.

[0084] Step 661: Based on the positioning results, control the movement of the robotic arm to move the tool head directly above the new confinement device. Specifically, this includes: first, acquiring the current spatial coordinates of the tool head; using encoder feedback data from each joint of the robotic arm (real-time rotation angle of each joint); combining this with the link length parameters of the robotic arm (preset fixed lengths of each joint link, such as L1 for the first joint link, L2 for the second joint link, etc.); calculating the current spatial coordinates (x_i, y_i, z_i) of the tool head gripper center; calculating the contribution of each joint to the tool head coordinates based on the geometric relationship between the joint rotation angle and the link length; summing these values ​​to obtain the final current coordinates; then calculating the target movement parameters of the tool head; the spatial coordinates of the new confinement device in the positioning results are (x_i, y_i, z_i); the tool head needs to move to 10 cm directly above the new device (to avoid direct contact with the device); therefore, the target spatial coordinates of the tool head are (x_i, y_i, z_i). (y-axis, z-axis + 10 cm) Calculate the displacement difference of the tool head in the x, y, and z directions. The difference in the x direction = x_eye - x_time, the difference in the y direction = y_eye - y_time, and the difference in the z direction = (z_eye + 10 cm) - z_time. Then, decompose the displacement difference into the rotation angle of each joint of the robotic arm. According to the movement direction of each joint and the link length, calculate the adjustment angle of the corresponding joint. For the difference in the x direction, divide the difference by the link length L1 of the first joint to get the angle that the first joint needs to rotate. If the difference is positive, the joint rotates clockwise; if the difference is negative, the joint rotates counterclockwise. For the difference in the y direction, divide the difference by the link length L2 of the second joint to get the angle that the second joint needs to rotate. For the difference in the z direction, divide the difference by the link length L3 of the third joint to get the angle that the third joint needs to rotate. Send the calculated target rotation angle of each joint to the drive motor of the corresponding joint.

[0085] Finally, the robotic arm is driven to move and its position is confirmed. After receiving the target angle command, the motor drives the corresponding joint to rotate slowly. The encoder provides real-time feedback on the actual rotation angle of the joint. When the actual angle of all joints reaches the target angle, the motor stops running. At this time, the vision system captures an image of the relative position of the tool head and the new constraint device. The positions of the tool head gripper center and the opening center of the new device are compared. If there is no offset between the two in the x and y directions, it is determined that the tool head has reached the top of the new device. If there is an offset, the displacement difference in the offset direction and the joint adjustment angle are recalculated, and the joint is driven to make fine adjustments until the centers of the two are completely aligned in the vision image, thus completing the positioning of the tool head.

[0086] Step 662: Based on the tool head positioning, control the gripper to perform a flexible clamping operation on the new confinement device, and ensure that the clamping force reaches a preset threshold through a force feedback sensor. Specifically, this includes: first, setting the clamping parameters of the gripper; based on the material (lead, aluminum, boron compound, etc.) and structural strength of the new confinement device, the main controller presets a preset threshold for the clamping force (this threshold must meet the following conditions: ensuring that the device is stably clamped and does not fall off, and avoiding damage to the sealing layer or opening structure of the device due to excessive clamping force); at the same time, setting the opening width of the gripper (the initial opening width is greater than the diameter of the top opening of the new device to ensure that the device can be smoothly fitted) and the closing speed (slow closing to avoid collision with the device); then controlling the gripper to open and lower the tool head, sending an opening command to the gripper control mode of the tool head, and the two arms of the gripper opening outward at a preset speed to the set initial opening width; at the same time, sending a lowering command to the robotic arm, driving the third joint to slowly move downward. The tool head moves the opening gripper closer to the new confinement device. During the lowering process, the relative position of the gripper and the device is monitored in real time by the vision system to ensure that the gripper is always aligned with the center of the device opening until the gripper's holding arms are located on both sides of the device opening (at this time, the distance between the bottom of the gripper and the top of the device is 2 cm), at which point the lowering stops. Then, the gripper is controlled to close and the force feedback sensor is activated to monitor and send a closing command to the gripper control mode. The two arms of the gripper slowly close inward at a preset speed. At the same time, the force feedback sensor, integrated on the gripper holding arms, is activated. The sensor detects the gripping force of the gripper on the new device in real time at a frequency of 10 times per second and transmits the detection data to the main controller. The main controller continuously compares the real-time gripping force with a preset threshold. If the real-time gripping force is less than the preset threshold, the gripper closing speed is maintained. If the real-time gripping force is close to the preset threshold (reaching 90% of the threshold), the gripper closing speed is reduced to avoid a sudden increase in force.

[0087] Finally, after confirming that the clamping force meets the standard and completing flexible clamping, when the real-time clamping force detected by the force feedback sensor reaches the preset threshold, the main controller immediately sends a stop closing command to the gripper control mode, and the two arms of the gripper stop moving. At this time, the gripper's clamping state on the new device is flexible clamping (both firm and without damage). To ensure clamping stability, the clamping force is continuously monitored for 5 seconds. If the clamping force remains within the range of ±5% of the preset threshold within 5 seconds, the flexible clamping is determined to be completed. If the clamping force decreases (less than 90% of the threshold), the gripper is controlled to close slightly to restore the clamping force to the preset threshold. After confirming stability again, the clamping operation is completed.

[0088] Step 663: Based on the gripper's holding state, control the robotic arm to remove the new confinement device from the shielded container and move it to the installation position of the boron neutron capture system. Specifically, this includes: first, controlling the robotic arm to lift the tool head to remove the new device; the main controller sends a lifting command to the third joint of the robotic arm, driving the joint to move slowly upwards, causing the tool head to move the gripped new confinement device upwards at a speed of 3 cm per second. During the lifting process, the relative position of the device and the container is captured in real time by a vision system to ensure that the device does not collide with the inner wall of the container (especially the shielding layer) during movement, until the bottom of the device is completely detached from the top opening of the shielded container. The distance between the bottom of the device and the container opening is monitored by an infrared ranging sensor. When the distance reaches 15 cm, it is determined that the device is completely detached, and the lifting stops. Then, the installation position coordinates of the boron neutron capture system are determined. This installation position is the spatial coordinates of the confinement device calculated in step 332 (the geometric center point coordinates of the installation end face, denoted as x, y, and z). These coordinates are pre-stored in the main controller, representing the position of the confinement device at the beam exit of the treatment system. The fixed installation position of the port is determined, followed by the calculation of the tool head's movement path and joint parameters. Based on the current spatial coordinates (xcurrent, ycurrent, zcurrent) and installation position coordinates (xan, yan, zan), the tool head's movement path is planned (the path is a straight line, avoiding passage through other equipment in the treatment room), and the movement differences in the x, y, and z directions are calculated: x-displacement = xan - xcurrent, y-displacement = yan - ycurrent, z-displacement = zan - zcurrent. Based on the link lengths of each joint of the robotic arm (L1, L2, L3, etc.), the movement... The difference is decomposed into the rotation angle of each joint. The x-displacement difference corresponds to the rotation angle of the first joint (angle = x-displacement difference ÷ L1), the y-displacement difference corresponds to the rotation angle of the second joint (angle = y-displacement difference ÷ L2), and the z-displacement difference corresponds to the rotation angle of the third joint (angle = z-displacement difference ÷ L3). At the same time, the tool head posture is adjusted by the fourth, fifth, and sixth joints to ensure that the mounting end face of the new device is parallel to the mounting plane of the treatment system's outlet (the posture adjustment is based on the consistency between the plane normal vector of the new device and the normal vector of the mounting plane, which is confirmed in real time by the vision system).

[0089] Finally, the robotic arm is moved to the installation position, and the target rotation angle of each joint is sent to the corresponding drive motor. The motor drives the joint to rotate at the target angle, and the encoder provides real-time feedback on the rotation progress. When all joints have reached the target angle, the tool head carries the new device to a position 5 cm in front of the installation position to avoid direct contact with the installation surface. The vision system captures an image of the relative position of the new device and the installation position, and compares the deviation between the geometric center point of the installation end face of the new device and the coordinates of the installation position. If there is a deviation, the angles of the first and second joints are finely adjusted until the deviation is eliminated. At this point, the new device is aligned with the installation position, and the robotic arm stops moving.

[0090] Step 664: Based on the installation location, a multi-stage torque installation operation is performed using a torque sensor. When the torque value reaches the preset installation completion threshold, the new clamping device is confirmed to be installed in place. Specifically, this includes: first, dividing the multi-stage torque installation into stages and preset thresholds; combining the installation requirements and material characteristics of the new clamping device, the installation process is divided into three stages: pre-tightening stage, main installation stage, and finishing stage. Each stage sets a corresponding torque threshold. The pre-tightening stage threshold is 30% of the installation completion threshold (used to initially fix the device in the installation position to ensure that the posture does not shift); the main installation stage threshold is 70% of the installation completion threshold (used to make the device fit tightly against the installation surface and establish a preliminary seal); and the finishing stage threshold is 100% of the installation completion threshold (i.e., the installation completion threshold, used to ensure that the sealing performance meets the standard and the installation is firm). All thresholds are preset in the main controller according to the device material and installation interface structure.

[0091] Then, the torque sensor is activated and the pre-tightening stage installation is performed. The torque sensor is integrated on the gripper rotation axis of the tool head. A start monitoring command is sent to the sensor, which detects the torque value of the gripper rotation during installation at a frequency of 15 times per second in real time. The data is transmitted to the main controller in real time. The main controller sends a pre-tightening rotation command to the gripper control module. The gripper drives the new restraint device to rotate slowly clockwise (the installation direction is clockwise). At the same time, the real-time torque value is compared with the pre-tightening stage threshold. If the real-time torque value is less than the threshold, the driving force of the gripper rotation is increased, so that the torque value gradually increases. When the real-time torque value reaches the pre-tightening stage threshold, the driving force remains unchanged, and the device continues to rotate one revolution (to ensure that the device is initially fixed). The pre-tightening stage ends.

[0092] Next, the main installation phase begins. The main controller automatically switches the torque comparison benchmark to the main installation phase threshold, sends a main installation rotation command to the gripper, appropriately increases the gripper rotation speed, and continuously monitors the real-time torque value. If the real-time torque value is lower than the main installation phase threshold, the rotation driving force is further increased. Once the threshold is reached, the driving force remains unchanged, causing the device to rotate 2 revolutions (so that the device mounting end face is completely in contact with the mounting plane, eliminating gaps). During this period, the visual system captures the fit between the device and the mounting position. If uneven fit is found (such as gaps on one side), the angle of the fourth joint is finely adjusted to correct the posture, ensuring a smooth fit. The main installation phase then ends.

[0093] Then, in the final stage, the main controller switches the comparison benchmark to the installation completion threshold and sends a final rotation command to reduce the gripper's rotation speed and driving force, causing the real-time torque value to rise slowly. If the real-time torque value approaches the installation completion threshold (reaching 95%), the rotation speed is further reduced. When the real-time torque value reaches the installation completion threshold, a stop rotation command is immediately sent to the gripper, and the gripper stops rotating, ending the final stage. Finally, the installation is confirmed to be in place through three dimensions: first, the torque sensor continuously monitors for 3 seconds to confirm that the real-time torque value is stable within ±3% of the installation completion threshold without any decrease (to prevent loosening after installation); second, the vision system captures the contact point between the device's mounting end face and the mounting plane to confirm that there are no obvious gaps; and third, the infrared ranging sensor monitors the displacement of the device after installation (the device should have no axial offset, and the displacement value should be 0). After all three dimensions meet the standards, the main controller determines that the new constraint device is installed in place, sends an opening command to the gripper, and the gripper slowly opens to a fully open state, driving the robotic arm to move the tool head upward by 10 centimeters, removing it from the installation area, thus completing the entire installation operation.

[0094] By using a vision system to scan and create 3D point cloud models, the new confinement device that meets the treatment requirements is accurately located, avoiding installation errors caused by mismatched opening sizes. At the same time, no manual intervention is required inside the container, reducing the risk of radiation exposure. Based on the positioning results, the joint motion parameters of the robotic arm are decomposed to ensure that the tool head can move accurately to the top of the new device, avoiding clamping errors caused by initial position deviations. This lays a stable foundation for flexible clamping operations and improves the overall consistency of the operation.

[0095] like Figure 2 As shown, embodiments of the present invention also provide a maintenance robot for the beam confinement device of a boron neutron capture therapy system, comprising:

[0096] Mobile platform 1;

[0097] The robotic arm 2 and the robotic arm base 5 are mounted on the mobile platform 1, and the robotic arm 2 can move flexibly.

[0098] A special tool head 6 is located at the end of the robotic arm 2 and has the function of replacing the restraint device;

[0099] Vision system 3, mounted on the robotic arm 2, is used to acquire an image of the outer contour of the beam-limiting device;

[0100] Shielding container 4 is used to store the beam confinement device to shield it from radioactivity.

[0101] It should be noted that the maintenance robot for the beam confinement device of the boron neutron capture therapy system is a maintenance robot for the beam confinement device of the boron neutron capture therapy system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0102] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0103] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0104] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A control method for a maintenance robot of a beam-limiting device in a boron neutron capture therapy system, characterized in that, The method includes: Step 1: Obtain the position of the beam limiting device, and control the maintenance robot to automatically move to the front of the beam limiting device based on its position; Step 2: Based on the position of the beam limiting device, use a vision system to obtain an image of the outer contour of the beam limiting device; Step 3: Based on the outer contour image, calculate the planar normal vector, spatial coordinates, and offset angle and displacement between the clamping device and the tool head. This includes extracting point cloud data of the clamping device's mounting end face from the outer contour image to form a point cloud dataset of the clamping device's end face; performing plane fitting on the point cloud dataset using the least squares method to calculate the planar normal vector of the clamping device's end face; calculating the coordinates of the geometric center point of the clamping device's end face based on the planar normal vector and the spatial distribution of the point cloud dataset, using this as the spatial coordinates of the clamping device; and using the spatial coordinates and planar normal vector of the clamping device, performing coordinate transformation matrix... The relative pose relationship between the tool head coordinate system and the beam limiter coordinate system is calculated to obtain the offset angle and displacement between the tool head and the beam limiter. Specifically: in the 3D color point cloud model, the color depth of the point cloud points at the boundary will have slight differences, and the z-value of the point cloud points will change from a gradual state on the side to a constant state on the end face. Based on this, these point cloud points at the connecting boundary are selected as boundary feature points. Then, the boundary contour of the mounting end face is fitted, and the selected boundary feature points are connected sequentially in a clockwise direction. When connecting, it is ensured that the distance between two adjacent boundary feature points is uniform. If the number of boundary feature points is small, adjacent points can be connected. The intermediate point is calculated between two points. The calculation method is to take the average x-value of two adjacent points as the intermediate point x-value, the average y-value of two adjacent points as the intermediate point y-value, and the constant z-value of the end face as the intermediate point z-value, ultimately forming a closed regular polygon. The outline of this regular polygon closely matches the actual circular outline of the installation end face. Then, a polygon interior point judgment algorithm from computational geometry is used to filter the point cloud points of the installation end face. For each point cloud point in the 3D color point cloud model, the following operation is performed: starting from that point cloud point, a virtual ray is drawn along the positive x-axis of the spatial rectangular coordinate system, and then this virtual ray is observed. The intersection of the line with the boundary of the closed regular polygon is recorded, and the number of intersection points is counted. If the virtual ray happens to pass through a vertex of the closed regular polygon or happens to coincide with a side of the regular polygon, the direction of the virtual ray needs to be slightly adjusted by 0.1 degrees along the positive y-axis. The adjustment angle must ensure that the ray no longer passes through a vertex or coincides with a side. Then, the number of intersection points is counted again. If the number of intersection points is odd, the point cloud point is determined to be inside the closed regular polygon and belongs to the point cloud point of the mounting face of the beam limiting device. If the number of intersection points is even, the point cloud point is determined to be outside the closed regular polygon and does not belong to the point cloud point of the mounting face. Step 4: Adjust the position of the robotic arm and tool head according to the offset angle and displacement, so that the gripper of the tool head connects with the constraint device and performs flexible clamping; Step 5: Based on the gripping state of the clamping device, control the robotic arm and tool head to disassemble the clamping device, and transfer the disassembled clamping device to a shielded container for storage. Step 6: After completing the disassembly and storage operations, control the robotic arm and tool head to remove the confinement device with a predetermined opening size from the shielded container and perform the installation operation.

2. The control method for the maintenance robot of the beam-limiting device of the boron neutron capture therapy system according to claim 1, characterized in that, Based on the position of the beam confinement device, an image of the outer contour of the beam confinement device is acquired using a vision system, including: The binocular RGB camera mounted on the third joint of the robotic arm acquires images of the beam-limiting device, simultaneously obtaining two RGB color images with parallax. Based on the positional differences of corresponding pixels in the two RGB color images, the disparity value of each pixel is calculated according to the geometric relationship between the two cameras; The parallax values ​​are converted into depth information to generate a depth map that corresponds one-to-one with the pixels of the RGB color image. The color information of the RGB color image is registered and fused with the depth information of the depth map, and a three-dimensional color point cloud model of the beam confinement device is generated through multimodal collaborative processing. Extract the outer contour geometric features of the beam confinement device from the 3D color point cloud model to obtain a complete outer contour image of the beam confinement device.

3. The control method for the maintenance robot of the beam-limiting device of the boron neutron capture therapy system according to claim 2, characterized in that, The color information of the RGB color image is registered and fused with the depth information of the depth map. A three-dimensional color point cloud model of the beam confinement device is generated through multimodal collaborative processing, including: Based on the calibration parameters of the binocular RGB camera, the depth map and the left eye RGB color image are aligned at the pixel level to establish a one-to-one mapping relationship between depth information and color information. Based on the mapping relationship, for each effective pixel in the depth map, back projection calculation is performed using the camera intrinsic parameter matrix to generate three-dimensional spatial point coordinates in the left camera coordinate system, forming the initial three-dimensional geometric point cloud of the beam confinement device. Based on the pixel correspondence between each point in the initial three-dimensional geometric point cloud and the left-eye RGB color image, each three-dimensional spatial point is assigned a corresponding RGB color value to construct the initial three-dimensional color point cloud of the beam-limiting device. The initial 3D color point cloud is subjected to noise reduction filtering to remove outliers caused by calculation errors, thereby generating a 3D color point cloud model.

4. The control method for the maintenance robot of the beam-limiting device of the boron neutron capture therapy system according to claim 3, characterized in that, Based on the offset angle and displacement, the positions of the robotic arm and tool head are adjusted so that the gripper of the tool head connects with the constraint device and performs flexible clamping, including: Based on the offset angle and displacement, drive the movement of each joint of the robotic arm to move the tool head to a predetermined position in front of the constraint device; Based on the tool head positioning results, the relative position image between the tool head and the beam limiting device is obtained through a vision system; Based on the relative position image and combined with encoder feedback data, the rotation angle of each joint of the robotic arm is adjusted so that the tool head is aligned with the beam limiting device. Based on the precise alignment of the tool head, the clamping jaws are controlled to close, and the clamping force is monitored in real time by a force feedback sensor. When the clamping force reaches a preset threshold, the flexible clamping of the constraint device is completed.

5. The control method for the maintenance robot of the beam-limiting device of the boron neutron capture therapy system according to claim 4, characterized in that, Based on the gripper's holding state of the restraint device, the robotic arm and tool head are controlled to disassemble the restraint device, and the disassembled restraint device is transferred to a shielded container for storage, including: The control tool head uses a multi-stage torque disassembly method to disassemble the restraint device. The torque sensor monitors the disassembly torque in real time and adjusts the disassembly force in stages according to the preset torque threshold. During the disassembly process, the displacement distance of the beam limiting device is monitored by the infrared ranging sensor on the tool head. When the displacement distance reaches the preset value, the disassembly of the beam limiting device is determined to be complete. After disassembly, the position image of the shielding container is obtained through a vision system, and the spatial coordinates and opening orientation of the shielding container are calculated based on image processing. Based on the spatial coordinates and opening orientation of the shielding container, the robotic arm is controlled to move the disassembled restraint device above the shielding container and adjust the tool head orientation to accurately place the restraint device into the shielding container for storage.

6. The control method for a maintenance robot of a beam-limiting device in a boron neutron capture therapy system according to claim 5, characterized in that, After completing the disassembly and storage operations, the robotic arm and tool head are controlled to retrieve the confinement device with a predetermined opening size from the shielded container and perform the installation operation, including: Based on the completed disassembly and storage operations, the interior of the shielding container is scanned using a vision system to locate the new confinement device with a predetermined opening size, and the positioning result is obtained. Based on the positioning results, control the movement of the robotic arm to move the tool head directly above the new beam-limiting device; Based on tool head positioning, the gripper is controlled to perform a flexible clamping operation on the new constraint device, and the force feedback sensor ensures that the clamping force reaches a preset threshold. Based on the gripper's holding state, the robotic arm is controlled to remove the new beam-limiting device from the shielding container and move it to the installation position of the boron neutron capture system. Based on the installation location, a multi-stage torque installation operation is performed using a torque sensor. When the torque value reaches the preset installation completion threshold, the installation of the new beam limiter is confirmed to be in place.

7. A robot for maintaining the beam confinement device of a boron neutron capture therapy system, the robot implementing the method as described in any one of claims 1 to 6, characterized in that, include: Mobile platform; A robotic arm, with its base mounted on the mobile platform, and the robotic arm capable of flexible movement; A special tool head is located at the end of the robotic arm and has the function of replacing the restraint device; A vision system, mounted on the robotic arm, is used to acquire an image of the outer contour of the beam-limiting device; Shielded container used to store beam-limiting devices to shield against radioactivity.

8. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Operation and maintenance manipulator intelligent control method and system based on visual identification

    CN120680525A