Unmanned pharmacy composite robot autonomous medicine sorting method and system
By combining a hybrid robot with QR code recognition and an improved YOLO v13 model, the positioning error and collision problems in the drug sorting process were solved, achieving high-precision and safe drug sorting, and improving the system's flexibility and space utilization.
Patent Information
- Application Number
- CN202511768910.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-01-16
AI Technical Summary
Existing unmanned pharmacy robots suffer from problems during drug sorting, such as QR code navigation being susceptible to slight deviations caused by shooting angle, lighting, and wear, leading to inaccurate grasping or even collisions. Furthermore, traditional equipment has low space utilization and poor flexibility.
A hybrid robot, combining QR code recognition, an improved YOLO v13 model, and inverse reachability analysis, achieves high-precision drug sorting by compensating for errors through visual positioning. Specific steps include: scanning road QR codes to obtain location, generating a planned path, using the robotic arm's end-effector vision module to identify medicine cabinet information, performing inverse reachability assessment and closed-loop control to ensure accurate and safe grasping.
It achieves high-precision drug sorting, improves the safety and robustness of the sorting process, enhances the system's flexibility and space utilization, and can adapt to dynamic environmental changes.
Smart Images

Figure CN121340282A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to an unmanned pharmacy composite robot autonomous medicine sorting method and system, and belongs to the technical field of intelligent robots and cross-application of medical devices. BACKGROUND
[0002] With the development of intelligent and efficient medical service mode, pharmacy automation has become a trend. Traditional pharmacy automation equipment mainly includes fixed automatic dispensing machines or track type mechanical arms. These existing technologies have the following limitations:
[0003] 1. Limited coverage: traditional fixed equipment can only serve the fixed storage area around the installation location, and cannot cope with medicines distributed in different areas and different types of shelves in the pharmacy.
[0004] 2. Low space utilization: fixed equipment and tracks require special space, and once deployed, it is difficult to adjust, limiting the overall layout of the pharmacy.
[0005] With the maturity of mobile robots and collaborative mechanical arm technology, composite robots combining mobile platforms and mechanical arms have emerged. They do not rely on fixed tracks, navigate to shelves through pharmacy QR codes, and use multi-degree-of-freedom mechanical arms to complete grabbing. However, existing composite robots have small deviations when facing high-precision tasks such as medicine sorting due to the influence of shooting angle, light, and wear during QR code navigation. The end error of the mechanical arm overlaps, resulting in inaccurate grabbing or even collision.
[0006] Therefore, there is an urgent need for a technical solution that combines global map and QR code navigation data, compensates for errors through visual positioning, and introduces inverse reachability analysis to optimize chassis pose, to solve the high-precision grabbing problem of unmanned pharmacy medicine sorting. SUMMARY
[0007] Objective: In view of at least one of the above technical problems, the application provides an unmanned pharmacy composite robot autonomous medicine sorting method and system.
[0008] The technical scheme adopted by the application is:
[0009] In a first aspect, the application provides an unmanned pharmacy composite robot autonomous medicine sorting method, comprising:
[0010] Step S1, after starting the composite robot, a road QR code pre-set on the ground is scanned in real time by a QR code recognition module to obtain the current position of the robot;
[0011] Step S2, receiving a user prescription order, mapping all medicines in the user prescription order to logical addresses respectively; the logical addresses include the storage area, row, layer, and compartment information of the corresponding medicine in the target medicine cabinet and the target medicine cabinet two-dimensional code information;
[0012] Step S3, determining the road two-dimensional code sequence from the current position of the robot to sequentially pass through all target medicine cabinets according to the target medicine cabinet two-dimensional code information of all medicines, generating a planned path and a sorting task list for each medicine; the sorting task list includes the medicine information and the logical address of the corresponding medicine;
[0013] Step S4, the compound robot sequentially executes each sorting task list according to the planned path;
[0014] Step S5, after completing the grabbing and temporary storage of all medicines in the user prescription order according to each sorting task list, the compound robot navigates to the user medicine taking place based on the road two-dimensional code sequence from the current position to the user medicine taking place, and sends a medicine taking reminder;
[0015] Step S6, in response to the user completing the medicine taking, the compound robot autonomously returns to the standby position along the road two-dimensional code.
[0016] In some embodiments, step S4, the compound robot sequentially executes each sorting task list according to the planned path, including:
[0017] Step S41, after the compound robot navigates and drives to the vicinity of the ith target medicine cabinet according to the planned path, where i takes 1-n and n is the number of medicine types in the user prescription order; the zone and row information of the medicine cabinet is obtained by using the end-of-arm vision module to scan the two-dimensional code on the target medicine cabinet, and is rechecked with the zone and row information of the logical address in the sorting task list;
[0018] Step S42, after the recheck is successful, the target compartment in the target layer position is driven to move by the mechanical arm according to the layer and compartment information in the logical address, the local image of the target compartment is collected by the end-of-arm vision module, and the bounding box coordinates of all candidate medicine boxes in the local image are identified by using the improved YOLO v13 model; the medicine information on each candidate medicine box is extracted based on the bounding box coordinates of each candidate medicine box, and is matched with the medicine information in the sorting task list to determine the target medicine box; the center point coordinates of the target medicine box in the pixel coordinate system are obtained and converted to the center point coordinates of the target medicine box in the mechanical arm coordinate system;
[0019] Step S43, based on the center point coordinates of the target medicine box in the mechanical arm coordinate system, inverse reachability judgment is performed, and if it is judged that it is not reachable or the posture is not optimal, the mobile chassis is adjusted until the mechanical arm suction condition is met;
[0020] Step S44: The robotic arm performs a grasping action to adsorb the target drug by a preset pressure. The OCR recognition module at the end of the robotic arm is used to verify the drug information again. After the verification is passed, the target drug is moved to the temporary storage area on the composite robot according to the planned safe trajectory.
[0021] In some embodiments, during step S44, the process of the robotic arm performing the grasping action further includes:
[0022] The three-dimensional deviation between the center point of the target medicine box and the end point of the robotic arm is calculated in real time based on the coordinates of the center point of the target medicine box and the end point of the robotic arm in the robotic arm coordinate system, and then published to the PID control node.
[0023] The PID control node calculates the three-dimensional correction value in Cartesian space based on the three-dimensional deviation, converts it into the angle correction value of each joint of the robotic arm to control the robotic arm, and feeds back the end-effector coordinates of the robotic arm after angle correction, forming a closed-loop control.
[0024] Secondly, this application provides an autonomous drug sorting system for unmanned pharmacies using a composite robot, including a processor and a storage medium;
[0025] The storage medium is used to store instructions;
[0026] The processor is configured to operate according to the instructions to execute the method according to the first aspect.
[0027] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0028] Fourthly, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0029] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0030] Beneficial effects: The autonomous drug sorting method and system for unmanned pharmacies provided in this application have the following advantages:
[0031] (1) High-precision sorting capability. Through layered positioning, local visual recognition and high-precision positioning of YOLO v13 model, the problem of confusion and mis-grabbing of multiple medicine boxes and irregularly shaped medicine boxes in the same medicine cabinet is completely solved. Combined with the secondary verification of OCR after grabbing, the accuracy and reliability of medicine sorting are ensured.
[0032] (2) Enhance operational safety and robustness. An inverse reachability judgment mechanism is introduced to pre-assess the feasibility of the grasping posture before the movement is executed, effectively detect potential collision risks and joint movement limitations, and significantly improve the safety and robustness of the sorting process.
[0033] (3) Enhance system flexibility. The use of composite robots to replace traditional fixed automated equipment gives the system extremely high spatial flexibility; the robots have the ability to plan paths autonomously, search medicine cabinets and adjust their postures, without the need for manual parameter presets, and can efficiently adapt to dynamic environments such as order volume fluctuations and changes in medicine cabinet layout. Attached Figure Description
[0034] Figure 1 This is a block diagram of an autonomous drug sorting system for an unmanned pharmacy using a composite robot, as described in an embodiment of this application.
[0035] Figure 2 This is a flowchart illustrating the autonomous drug sorting method of the unmanned pharmacy composite robot according to an embodiment of this application.
[0036] Figure 3 This is a schematic diagram of the improved YOLO v13-MobileNetV4 model structure in an embodiment of this application.
[0037] Figure 4 This is a diagram of the composite robot URDF model in the embodiments of this application.
[0038] Figure 5 This is a schematic diagram of the medicine cabinet structure in an embodiment of this application. Detailed Implementation
[0039] The present application will be further described below with reference to the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and should not be used to limit the scope of protection of the present application.
[0040] In the description of this application, "several" means one or more, "multiple" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0041] In the description of this application, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0042] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0043] Example 1: This example provides an autonomous drug sorting method using a composite robot in an unmanned pharmacy, such as... Figure 1 , Figure 2 As shown, it includes:
[0044] Step S1: After the composite robot is started, it scans the preset road QR code on the ground in real time through the QR code recognition module to obtain the robot's current location.
[0045] In this embodiment, as Figure 4 As shown, the composite robot includes a mobile chassis and a robotic arm mounted on the chassis. A QR code recognition module for scanning QR codes on the ground roads is installed at the front of the mobile chassis. The road QR codes are arranged at 1-meter intervals, covering all passageways, and each road QR code stores absolute coordinate information. In addition to the associated information of adjacent QR codes, the robot uses this information to achieve real-time positioning. These represent the horizontal and vertical coordinates of the location of the road QR code, respectively.
[0046] Step S2: Receive the user's prescription order and map all the medicines in the user's prescription order to logical addresses; the logical address includes the storage area, row, layer, and compartment information of the corresponding medicine in the target medicine cabinet, as well as the target medicine cabinet's QR code information.
[0047] In this embodiment, the main controller of the composite robot receives the user's prescription order through the WIFI module and queries the detailed information of the medicine in the order through the pharmacy management system, mapping it to a unique logical address (such as A2-5-3, representing the 2nd row, 5th floor, 3rd cell of area A). Figure 5 This is a schematic diagram of the medicine cabinet structure in an embodiment of this application.
[0048] Step S3: Based on the QR code information of all target medicine cabinets, determine the QR code sequence of the path from the robot's current position to the path that passes through all target medicine cabinets in sequence, and generate the planned path and the sorting task list for each medicine; the sorting task list includes the medicine information and logical address of the corresponding medicine.
[0049] It should be noted that the main controller of the composite robot generates a planned path for all sorting tasks, starting from the real-time positioning coordinates obtained by the robot through the road QR code and ending with the last road QR code in the sequence.
[0050] Step S4: The composite robot executes each sorting task list sequentially according to the planned path, specifically including steps S41-S44:
[0051] Step S41: After the composite robot navigates to the vicinity of the i-th target medicine cabinet according to the planned path, where i is 1-n and n is the number of medicine types in the user's prescription order; the robot uses the end vision module of the robotic arm to scan the QR code on the target medicine cabinet to obtain the area and row information of the medicine cabinet, and verifies it with the area and row information of the logical address in the sorting task list;
[0052] In this embodiment, the mobile chassis is driven to initiate autonomous navigation along the planned path. At the same time, the QR code recognition module at the front of the chassis is activated to scan and track the road QR codes along the path in real time. Combined with the robot's driving trajectory, the robot's real-time positioning in the pharmacy environment is updated. Based on the positioning update results, the driving deviation is corrected through chassis differential control to ensure that the robot drives accurately along the planned path.
[0053] If the QR code recognition module fails to recognize the target road QR code within a preset time due to temporary obstruction by debris or other reasons, the composite robot's main controller immediately initiates an emergency response procedure. In some embodiments, this step may specifically include:
[0054] Step S411: Record the coordinates of the last successfully recognized road QR code and the current direction of the robot's travel.
[0055] Step S412: Drive the mobile chassis to continue traveling at low speed along the current driving direction, with a maximum travel distance of 0.5m.
[0056] Step S413: During low-speed driving, the QR code recognition module continues scanning. Once the next target road QR code is scanned, the low-speed driving stops immediately, the coordinates of the road QR code are parsed and the positioning is updated, and the normal speed is resumed to drive along the planned path. If the target road QR code is not recognized after driving at low speed for 0.5m, the main controller of the composite robot drives the chassis to rotate in place by a fixed angle to expand the scanning range until the target road QR code is recognized, ensuring that the navigation process is not interrupted.
[0057] After the robot reaches the vicinity of the target medicine cabinet, it activates the end-effector vision module, driving the robot to adjust its initial pose and scan the QR code on the target medicine cabinet. Specifically, this includes:
[0058] Step S414: The main controller of the composite robot drives the robotic arm to move from the position to the preset initial working posture. The entire robotic arm linkage is perpendicular to the robot base, the upper arm is perpendicular to the base, the forearm is perpendicular to the upper arm, and the end effector extends horizontally to ensure that the center of the vision module and the center of the target medicine cabinet QR code are on the same vertical plane and the same horizontal straight line, so as to achieve the posture positioning of the end effector facing the target medicine cabinet QR code.
[0059] Step S415: After starting the vision module, the robot acquires images in front in real time and feeds back the center coordinates of the screen. The main controller of the composite robot calculates the center coordinates of the vision module and the center coordinates of the target medicine cabinet QR code. If the deviation exceeds... This drives the robotic arm's end effector to make fine adjustments to ensure that the vision module can capture the QR code.
[0060] Step S416: The main controller of the composite robot matches the identified target medicine cabinet QR code information with the logical address in the sorting task list. If they match completely, the current aligned medicine cabinet is confirmed as the target medicine cabinet, and the precise alignment of the medicine cabinet is completed.
[0061] Step S42: After successful verification, the robotic arm is driven to move to the target cell in the target layer according to the layer and cell information in the logical address. The end vision module of the robotic arm acquires a local image of the target cell and uses the improved YOLO v13 model to identify the bounding box coordinates of all candidate medicine boxes in the local image. Based on the bounding box coordinates of each candidate medicine box, the medicine information on the medicine box is extracted and matched with the medicine information in the sorting task list to determine the target medicine box. The center point coordinates of the target medicine box in the pixel coordinate system are obtained and converted into the center point coordinates of the target medicine box in the robotic arm coordinate system.
[0062] In this embodiment, the method for constructing and training the improved YOLO v13 model includes:
[0063] Step S421: Control the end vision module of the robotic arm to acquire images of medicine boxes in the target compartment of the target medicine cabinet in the pharmacy environment, covering different lighting conditions, different placement angles, and different stacking states, and calibrate the medicine boxes in the image.
[0064] Step S422: Replace the Backbone module in YOLOv13 with the MobileNetV4 motion recognition module to achieve lightweight feature extraction. Train the dataset labeled in step S71 using the improved YOLO v13 for offline detection.
[0065] Step S4221: The Convbn module is the basic feature extraction unit of MobileNetV4. Its core is to perform a series collaboration of Conv2D feature extraction, BatchNorm2D distribution calibration and ReLU6 nonlinear enhancement on the input feature map.
[0066] In this step, Conv2D encodes spatial information from the input feature map using a sliding convolution kernel, while simultaneously increasing or decreasing the dimensionality of the channels. It forms the foundational computational layer of the entire module, and the convolution operation formula is as follows:
[0067]
[0068] in For the convolutional layer The output feature map is located in space. eigenvalues at that location For convolution kernel weights, These are the height and width of the convolution kernel, respectively. For batch indexing, The spatial coordinates of the feature map These are the number of channels in the input feature map and the output feature map, respectively. The input feature map contains the pixel values of the corresponding positions and channels. This is the bias term for the convolutional layer.
[0069] In this step, BatchNorm2D addresses the internal covariate shift problem in deep learning by standardizing in-batch features, thereby accelerating training convergence and improving generalization ability. The standardization process consists of two steps:
[0070] (1) Batch statistics calculation:
[0071]
[0072]
[0073] in, For the first Batch mean and variance for each channel For batch size, The height and width of the output feature map for the convolution.
[0074] (2) Standardization and scaling offset:
[0075]
[0076] in The output feature values of the batch normalization layer BatchNorm2D To avoid numerically stable terms with a denominator of 0, These are learnable channel-level scaling and offset parameters.
[0077] In this step, ReLU6 adds an output upper bound constraint while retaining the activation characteristics of ReLU, adapting to low-precision computation scenarios on mobile devices and enhancing model robustness. Its activation function... for:
[0078]
[0079] That is, negative values of BatchNorm2D output are set to 0, and positive values greater than 6 are truncated.
[0080] Step S423: After the robotic arm's end-effector vision module acquires images of the inside of the medicine cabinet, it inputs the images into a pre-trained model. After inference, it outputs the prediction results of the medicine boxes. The prediction results are filtered in two stages to remove redundant candidate boxes with overlap exceeding the threshold. Finally, the bounding box coordinates of all valid candidate medicine boxes are output, providing accurate basis for subsequent OCR text recognition and medicine box center point localization.
[0081] Step S43: Based on the coordinates of the center point of the target medicine box in the robotic arm coordinate system, perform an inverse reachability judgment. If it is determined that it is unreachable or the posture is not optimal, adjust the moving chassis until the robotic arm adsorption conditions are met.
[0082] In some embodiments, step S43 specifically includes:
[0083] Step S431: In offline mode, based on the DH relation parameters of the robotic arm, establish the forward kinematic equation, and solve the set of reachable poses of the robotic arm end effector for all accessible objects and the homogeneous transformation matrix of the end effector-base through spatial traversal to generate the reachability space R.
[0084] Step S432: Mesh the robot arm's workspace (perform self-collision checks on the robot arm and filter out meshes that cause collisions); map the reachability space onto the mesh, and construct the reachability score of the mesh by combining the number of reachable poses of the robot arm in each mesh (C) with the total number of meshes (N). , represented as:
[0085] ;in, This is the proportionality coefficient;
[0086] Step S433: Convert the given pose of the grasped object into a homogeneous transformation matrix. and the homogeneous transformation matrix The corresponding end-to-base homogeneous transformation matrix in reachability space Multiplying the inverse matrices yields the pose of the robotic arm base. Set; a matrix representation of the pose set of the robotic arm base and the relative transformation matrix from the moving chassis to the robotic arm base. Multiplying the inverse matrices yields the pose of the moving chassis. A set;
[0087] ;
[0088] ;
[0089] Move the chassis position Mapping the set of values onto a plane with horizontal height z=0 yields a two-dimensional inverse reachability map; inverse reachability map Accessibility score based on the corresponding grid in the accessibility space The inverse accessibility map is divided into three regions as indicators: inaccessible region, relatively accessible region, and easily accessible region. Store;
[0090] ;
[0091] Step S434: During online operation, the RGB image information and depth value of the target item are obtained using the end vision module of the robotic arm, and the position of the target item is calculated; then the position of the target item is used as input to query the corresponding inverse reachability map;
[0092] Step S435: Determine whether the current pose of the moving chassis is in an easily accessible area in the inverse reachable map;
[0093] If the mobile chassis is in an easily accessible area, proceed with the subsequent step of the robotic arm grasping the medicine.
[0094] If the mobile chassis is not in an easily accessible area, then query the accessibility score in the reverse accessibility map. The location of the maximum value is taken as the navigation point, and the mobile chassis is driven to the navigation point. After the mobile chassis reaches the navigation point, the subsequent robotic arm grasping task is performed.
[0095] Step S44: The robotic arm performs a grasping action to adsorb the target drug by a preset pressure. The OCR recognition module at the end of the robotic arm is used to verify the drug information again. After the verification is passed, the target drug is moved to the temporary storage area on the composite robot according to the safe trajectory (planned by calling the robot operating system ROS tool to create a collision-free safe trajectory).
[0096] In some embodiments, step S44, during the process of the robotic arm performing the grasping action, further includes:
[0097] The three-dimensional deviation between the center point of the target medicine box and the end point of the robotic arm is calculated in real time based on the coordinates of the center point of the target medicine box and the end point of the robotic arm in the robotic arm coordinate system, and then published to the PID control node.
[0098] The PID control node calculates the three-dimensional correction value in Cartesian space based on the three-dimensional deviation, converts it into the angle correction value of each joint of the robotic arm to control the robotic arm, and feeds back the end-effector coordinates of the robotic arm after angle correction, forming a closed-loop control.
[0099] More specifically, in some embodiments, the three-dimensional deviation between the center point of the target medicine box and the end effector of the robotic arm is calculated in real time based on the coordinates of the center point of the target medicine box and the coordinates of the end effector of the robotic arm in the robotic arm coordinate system, including:
[0100] Step S441, during the process of the robotic arm performing the grasping action, also includes: the vision module acquires the image of the medicine box in real time at a frequency of 100Hz, dynamically updates the coordinates of the center point of the target medicine box, and acquires the real-time angles of each joint through the joint encoder of the robotic arm. Combined with the robot's forward kinematics model, the coordinates of the end of the robotic arm are calculated at a frequency of 100Hz. Finally, based on the ROS timestamp mechanism, the coordinates and posture data of the medicine box are synchronized and aligned.
[0101] Step S442: Using the robotic arm coordinate system as a unified reference, calculate the three-dimensional deviation between the center point of the target medicine box and the end effector of the robotic arm based on the synchronized real-time coordinates. The deviation calculation formula is as follows:
[0102] ;
[0103] in, These are the X, Y, and Z coordinates of the center point of the target medicine box in the robotic arm coordinate system; These are the X, Y, and Z axis coordinates of the robotic arm's end effector in the robotic arm coordinate system; These represent the X, Y, and Z axis deviations between the center point of the target medicine box and the end of the robotic arm in the robotic arm coordinate system.
[0104] Specifically, deviation values are retained to three significant decimal places, and a deviation threshold range is set. If the error exceeds this range, it is marked as an abnormal error, triggering the vision module to recalibrate.
[0105] Step S443: Create a custom ROS topic, encapsulate the obtained 3D deviation, synchronization timestamp, and coordinate system name, and publish the topic at a frequency of 100Hz; if data is not successfully sent for 3 consecutive cycles, trigger a warning and pause the robotic arm's grasping action.
[0106] More specifically, the PID control node calculates the three-dimensional correction value in Cartesian space based on the three-dimensional deviation, converts it into the angle correction value of each joint of the robotic arm to control the robotic arm, and feeds back the end-effector coordinates of the robotic arm after angle correction, including the following steps:
[0107] Step S444: The PID control node receives the three-dimensional deviation at a frequency of 100Hz, and uses a first-order low-pass filter to filter the three-dimensional deviation, obtaining the filtered deviation; the formula is:
[0108] ;
[0109] in These are the filter coefficients, used to suppress deviation fluctuations caused by visual noise and mechanical vibration. Similarly, we obtain... , , , , These represent the deviations after filtering along the X, Y, and Z axes, respectively.
[0110] Step S445: A three-dimensional independent PID control strategy is adopted, and the PID controller of each axis calculates the correction amount of the corresponding axis based on the filtered deviation.
[0111]
[0112] in, for The correction amount for the axis at any given time. for The deviation after filtering corresponding to the axis at any given time; , , These are the proportional coefficient, integral coefficient, and differential coefficient, respectively.
[0113] Step S445: Use the inverse kinematics model of the robotic arm to convert the correction amount of the corresponding axis into the angle correction amount of each joint of the robotic arm.
[0114] In this step, the correction amount output by the PID calculation is converted into the angle correction amount of each joint through the inverse kinematics model of the robotic arm. During the correction process, the actual angle of each joint is collected in real time through the joint encoder, and the updated pose of the robotic arm end is calculated in combination with the forward kinematics model and fed back to the deviation calculation node in step S441 to form a closed-loop control.
[0115] Step S5: Repeat steps S41-S44. After picking up and temporarily storing all medicines in the user's prescription order according to each sorting task list, the composite robot navigates to the user's medicine collection point based on the road QR code sequence from the current location and sends a medicine collection reminder.
[0116] Step S6: In response to the user completing medication collection (recording task completion status), the composite robot autonomously returns to its standby position via the road QR code navigation. The task is now complete.
[0117] Example 2: Based on Example 1, this example provides an unmanned pharmacy composite robot autonomous drug sorting system, including a processor and a storage medium;
[0118] The storage medium is used to store instructions;
[0119] The processor is configured to operate according to the instructions to execute the method according to Embodiment 1.
[0120] Example 3: Based on Example 1, this example provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in Example 1.
[0121] Example 4: Based on Example 1, this example provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in Example 1.
[0122] Example 5: Based on Example 1, this example provides a computer program product, including a computer program that, when executed by a processor, implements the method described in Example 1.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0125] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0127] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An unmanned pharmacy composite robot autonomous medicine sorting method, characterized in that, The application relates to a compound robot for dispensing medicines, and a method for dispensing medicines by using the compound robot. Step S1, after the compound robot is started, a two-dimensional code recognition module is used to scan a preset road two-dimensional code on the ground in real time to obtain the current position of the robot; Step S2, a user prescription order is received, and all medicines in the user prescription order are mapped into logical addresses; the logical addresses include storage area, row, layer and compartment information of the corresponding medicines in a target medicine cabinet and target medicine cabinet two-dimensional code information; Step S3, according to the target medicine cabinet two-dimensional code information of all medicines, a road two-dimensional code sequence from the current position of the robot to all target medicine cabinets is determined, a planning path and a sorting task list of each medicine are generated, and the sorting task list includes medicine information and logical addresses of the corresponding medicines; Step S4, the compound robot executes each sorting task list according to the planning path; Step S5, after all medicines in the user prescription order are grabbed and temporarily stored according to the sorting task list, the compound robot navigates to a user medicine taking place based on a road two-dimensional code sequence from the current position to the user medicine taking place, and sends a medicine taking reminder; Step S6, in response to the user completing the medicine taking, the compound robot autonomously returns to a standby position along the road two-dimensional code.
2. The method of claim 1, wherein, Step S4, the compound robot executes each sorting task list according to the planning path, including: Step S41, after the compound robot navigates and drives to the vicinity of the ith target medicine cabinet according to the planning path, wherein i is 1-n, and n is the number of medicine types in the user prescription order; the zone and row information of the target medicine cabinet is scanned by using a mechanical arm end vision module to obtain the zone and row information of the target medicine cabinet, and the zone and row information is rechecked with the zone and row information in the logical address in the sorting task list; Step S42, after the rechecking is successful, the target layer position and the target compartment position are driven to move to the target layer position according to the layer and compartment information in the logical address, a local image of the target compartment position is collected by the mechanical arm end vision module, all candidate medicine box boundary box coordinates in the local image are identified by using an improved YOLO v13 model, medicine information on each candidate medicine box boundary box coordinate is extracted, and the medicine information is matched with the medicine information in the sorting task list to determine the target medicine box; the target medicine box center point coordinates in a pixel coordinate system are obtained, and the target medicine box center point coordinates are converted into target medicine box center point coordinates in a mechanical arm coordinate system; Step S43, based on the target medicine box center point coordinates in the mechanical arm coordinate system, inverse reachability is judged, if the judgment is unreachable or the posture is not optimal, the mobile chassis is adjusted until the mechanical arm adsorption condition is met; Step S44, the mechanical arm performs a grabbing action to adsorb the target medicine according to a preset pressure, the medicine information is verified again by using an OCR identification module at the end of the mechanical arm, and after the verification is passed, the target medicine is moved to a temporary storage area on the compound robot according to a planning safety track.
3. The method of claim 2, wherein, Step S43, based on the target medicine box center point coordinates in the mechanical arm coordinate system, inverse reachability is judged, if the judgment is unreachable or the posture is not optimal, the mobile chassis is adjusted until the mechanical arm adsorption condition is met, including: Step S431, in the offline state, based on the D-H relationship parameters of the robot arm, a forward kinematics equation is established, and the reachable poses of all reachable objects and the set of end-base homogeneous transformation matrices of the robot arm end effector are solved through space traversal to generate a reachability space R; Step S432, grid the robot workspace, map the reachability space into the grid, and construct the reachability score of the grid in terms of the number of robot reachable poses C contained in each grid combined with the total number of grids N is expressed as: ; wherein, is a proportionality factor; Step S433, convert the given pose of the grasped object into a homogeneous transformation matrix , and multiply the homogeneous transformation matrix by the inverse of the corresponding end-base homogeneous transformation matrix in the reachability space to obtain the pose of the robot base ; multiply the matrix form of the set of poses of the robot base by the inverse of the relative transformation matrix of the mobile chassis to the robot base to obtain the set of poses of the mobile chassis ; ; ; Mapping the set of mobile chassis poses to a plane at horizontal height z = 0, resulting in a two-dimensional inverse reachability map; inverse reachability map with the corresponding grid in the reachability space is divided into three regions as an indicator: unreachable region, less easily reachable region, and easily reachable region, the generated inverse reachability map is stored; ; Step S434, when running online, the RGB image information and depth value of the target object are obtained using the robot arm end vision module, and the position of the target object is solved; then the position of the target object is used as input query to obtain the corresponding inverse reachability map; Step S435, judging whether the pose of the current mobile chassis is in the easily accessible region in the inverse reachable map; if the mobile chassis is in the easily accessible region, the subsequent step of grabbing the medicine by the mechanical arm is performed; if the mobile chassis is not in the easily accessible region, the accessibility score in the inverse reachable map is queried The position at the maximum value is taken as a navigation point, the mobile chassis is driven to the navigation point, and after the mobile chassis reaches the navigation point, the subsequent mechanical arm grabbing task is performed.
4. The method of claim 2, wherein, In step S44, during the execution of the grabbing action of the robot arm, further comprising: According to the target medicine box center point coordinates in the robot arm coordinate system and the robot arm end coordinates, a three-dimensional deviation of the target medicine box center point and the robot arm end is calculated in real time, and is published to a PID control node; The PID control node calculates a three-dimensional correction amount in Cartesian space according to the three-dimensional deviation, converts it into an angle correction amount of each joint of the robot arm to control the robot arm, and feeds back the robot arm end coordinates after angle correction to form a closed-loop control.
5. The method of claim 4, wherein, The PID control node calculates a three-dimensional correction amount in Cartesian space according to the three-dimensional deviation, converts it into an angle correction amount of each joint of the robot arm to control the robot arm, including: The PID control node uses a first-order low-pass filter to filter the three-dimensional deviation to obtain a filtered deviation; A three-dimensional independent PID control strategy is adopted, and each axis PID controller calculates the correction amount of the corresponding axis according to the filtered deviation; ; wherein, is the correction amount of the axis corresponding to the time, is the filtered deviation of the axis corresponding to the time; , , are respectively a proportional coefficient, an integral coefficient, and a differential coefficient. The inverse kinematics model of the robot arm is used to convert the correction amount of the corresponding axis into an angle correction amount of each joint of the robot arm.
6. The method of claim 2, wherein, The composite robot navigates according to the planned path, including: The main controller of the composite robot drives the mobile chassis to autonomously navigate along the planned path, and simultaneously uses a two-dimensional code recognition module to scan and track the road two-dimensional code on the path in real time; According to the scanned and tracked road two-dimensional code, a composite robot driving trajectory is generated, and the real-time positioning of the composite robot in the pharmacy environment is updated; Based on the positioning update result, the driving deviation is corrected through differential control of the mobile chassis to ensure that the robot accurately travels along the planned path.
7. An unmanned pharmacy composite robot autonomous medicine dispensing system, characterized by, It includes a processor and a storage medium; The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1 to 6. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to implement the method of any one of claims 1 to 6.