Research on Autonomous Localization and Navigation Simulation of Hospital Drug Delivery Robots Based on ROS System ()
1. Introduction
As medical auxiliary equipment, hospital drug delivery robots can significantly reduce hospitals’ manpower investment in drug distribution and improve the accuracy and timeliness of drug delivery. However, the complex and dynamic hospital environment—characterized by crowded corridors, frequently moving personnel and medical equipment, changing obstacle distributions, and strict requirements for navigation safety and efficiency—poses high requirements for the robot’s autonomous localization and navigation capabilities.
In recent years, extensive research has been carried out on robot autonomous localization and navigation technology. For localization, traditional methods such as ultrasonic positioning and visual positioning have limitations: ultrasonic positioning is susceptible to environmental noise and has low accuracy, while visual positioning relies heavily on lighting conditions and is prone to failure in dim or complex lighting environments of hospitals [1]. For SLAM (Simultaneous Localization and Mapping), algorithms such as Cartographer and Hector SLAM have been widely studied. Cartographer excels in large-scale environment mapping but has higher computational complexity, which may affect real-time performance in dynamic hospital scenarios. Hector SLAM achieves mapping without odometry but has lower accuracy in environments with sparse features [2]. In terms of localization algorithms, EKF (Extended Kalman Filter) based localization methods have poor robustness to non-Gaussian noise in complex environments, while particle filter-based methods have better adaptability but require reasonable algorithm selection and parameter tuning [3].
For path planning, global algorithms such as Dijkstra’s algorithm can find the shortest path but lack heuristic information, leading to low search efficiency in large-scale hospital environments [4]. Local path planning algorithms like the Vector Field Histogram (VFH) have limitations in handling dynamic obstacles and are prone to local optima [5]. Recent studies have shown that deep reinforcement learning algorithms (e.g., improved TD3) can significantly enhance path planning performance in dynamic environments by predicting obstacle movement patterns, providing a new direction for solving complex navigation problems [6]. The ROS system, as an open-source robot operating system, provides a wealth of toolkits and algorithm interfaces, offering strong support for research on autonomous localization and navigation technology for robots.
Existing studies on hospital drug delivery robots often focus on either single localization or path planning technology, and few studies have integrated mature algorithms to conduct a comprehensive evaluation of localization accuracy, path planning stability, and navigation efficiency in simulated hospital environments with dynamic characteristics. Moreover, the reproducibility of many studies is insufficient due to the lack of clear algorithm parameter specifications. In practical applications, hospital logistics robots have been proven to effectively reduce manual workload and improve delivery safety through unmanned technology and full-process monitoring [7], which further confirms the practical value of this research. This paper aims to fill these gaps by selecting and optimizing suitable algorithms for the hospital environment, establishing a comprehensive simulation platform that simulates dynamic scenarios, and providing detailed parameter configurations to enhance the reliability and reproducibility of the research. The originality of this study lies in the systematic integration and optimization of gmapping, AMCL, A*, and DWA algorithms for the specific needs of hospital drug delivery scenarios, and the comprehensive evaluation of the integrated system’s performance in a dynamically simulated hospital environment.
2. System Design and Modeling
2.1. Hardware Platform Setup
A four-wheel differentially driven mobile robot is adopted as the hardware platform, equipped with sensors such as lidars, cameras, and inertial measurement units (IMUs) for environmental perception and autonomous localization. The robot communicates with the host computer via a wireless communication module to receive task instructions and feedback real-time status. Modern hospital robots often integrate multi-sensor fusion technology to improve environmental adaptability, especially for special objects such as hospital beds and wheelchairs [8].
2.2. Software Platform Setup
The software platform is built based on the ROS system to realize the robot’s autonomous localization and navigation functions. The ROS system offers a variety of functional packages, including SLAM (Simultaneous Localization and Mapping), AMCL (Adaptive Monte Carlo Localization), and move_base, which provide strong support for the robot’s localization and navigation.
2.3. Robot Model Establishment
In the ROS system, the robot is modeled using URDF (Unified Robot Description Format) files, including components such as the chassis, drive wheels, and sensors. The model files enable intuitive display of the robot’s structure and motion characteristics, laying the foundation for subsequent research on localization and navigation.
3. Research on Autonomous Localization Technology
3.1. SLAM Map Construction
The gmapping algorithm is used to achieve SLAM map construction. Compared with alternative algorithms, gmapping is preferred for hospital environments for the following reasons: First, as a particle filter-based algorithm, it can balance mapping accuracy and real-time performance, which is crucial for the dynamic hospital environment where robots need to respond quickly to environmental changes. Second, gmapping has strong adaptability to sparse feature environments such as hospital corridors and can maintain stable mapping performance even with limited environmental features. In contrast, Hector SLAM has poor mapping accuracy in sparse feature scenarios, while Cartographer’s high computational complexity may cause delays in real-time navigation of drug delivery robots [9]. The gmapping algorithm updates the map in real-time through lidar data while simultaneously localizing the robot. Experimental results show that the gmapping algorithm can construct an accurate map of the hospital environment, providing a reliable environmental model for the robot’s autonomous navigation.
3.2. AMCL Localization Implementation
The AMCL algorithm is a probabilistic localization system based on Monte Carlo methods, capable of updating the robot’s position estimate in real-time based on known maps and sensor data. For hospital environments, AMCL is selected over EKF-based localization methods because it can better handle non-Gaussian noise from dynamic obstacles (such as moving personnel) and sensor errors, ensuring higher localization robustness. In contrast, EKF-based methods assume Gaussian noise, which is difficult to satisfy in complex hospital environments and may lead to significant localization deviations [10].
In the ROS system, key parameters of the AMCL algorithm are tuned to optimize localization performance:
1) min_particles and max_particles: Set to 500 and 2000, respectively. The number of particles directly affects localization accuracy and computational efficiency. Too few particles (e.g., <300) may lead to insufficient sampling of the robot’s possible positions, resulting in localization drift; too many particles (e.g., >3000) will increase computational load, reducing real-time performance in dynamic hospital scenarios. The selected range balances accuracy and efficiency, ensuring stable localization even when obstacles move.
2) alpha1 (rotation noise coefficient): Set to 0.2. This parameter adjusts the noise model of the robot’s rotation motion. A value of 0.2 effectively compensates for the rotation error caused by wheel slip when the robot turns in narrow hospital corridors, reducing localization error.
By configuring these parameters, autonomous localization of the robot in the hospital environment is achieved. Experimental results demonstrate that the AMCL algorithm can significantly improve the robot’s localization accuracy and reduce localization errors.
3.3. Localization Accuracy Evaluation
To evaluate the robot’s localization accuracy, a localization accuracy evaluation experiment is designed. In the hospital environment, multiple test points are selected, and the robot’s actual and estimated positions at each test point are recorded to calculate the localization error. Experimental results show that the robot’s localization accuracy is within 0.1 m, meeting the application requirements of hospital drug delivery robots.
4. Research on Path Planning Technology
4.1. Global Path Planning
The A* algorithm is used to achieve global path planning. Compared with Dijkstra’s algorithm, the A* algorithm introduces a heuristic function that guides the search towards the target, significantly improving search efficiency—critical for large-scale hospital environments with multiple wards and corridors. Dijkstra’s algorithm searches all possible paths, resulting in long planning times and inability to meet the real-time requirements of drug delivery tasks. Additionally, the A* algorithm can flexibly adjust the weight of the heuristic function to balance path optimality and planning speed, making it suitable for the diverse path requirements of hospital drug delivery (e.g., shortest path for urgent drugs, safest path for fragile drugs).
Key parameters tuned for the A* algorithm in the ROS system:
allow_unknown: Set to false. This parameter controls whether the algorithm considers unknown areas in the map. In hospital environments, unknown areas may be uncharted corridors or temporary obstacles. Disabling this parameter ensures the robot only plans paths in known, safe areas, avoiding potential collisions.
heuristic_scale: Set to 1.2. This parameter adjusts the weight of the heuristic function. A value of 1.2 balances path optimality and planning speed: a value < 1 may lead to slow search speed, while a value > 1.5 may result in suboptimal paths (e.g., longer detours), affecting drug delivery efficiency.
In the ROS system, by configuring these A* algorithm parameters, global path planning for the robot in the hospital environment is achieved. Experimental results demonstrate that the A* algorithm can plan reasonable and efficient paths, improving the robot’s navigation efficiency.
4.2. Local Path Planning
The DWA (Dynamic Window Approaches) algorithm is used to achieve local path planning. Compared with VFH (Vector Field Histogram) and other local path planning algorithms, DWA has significant advantages in dynamic hospital environments: it samples the robot’s velocity space in real-time, considering both kinematic constraints and obstacle avoidance requirements, enabling rapid response to moving obstacles (such as passing medical staff or mobile equipment). VFH, in contrast, relies on static obstacle information and is prone to collisions with dynamic obstacles or falling into local optima in narrow corridors [11]. For more complex dynamic scenarios, improved reinforcement learning algorithms (e.g., TD3pro) have shown better performance in reducing collision rates and planning time by integrating LSTM networks to perceive obstacle state changes [12].
Key parameters tuned for the DWA algorithm:
1) max_vel_x and min_vel_x: Set to 0.8 m/s and 0.1 m/s, respectively. These parameters define the robot’s linear velocity range. The maximum velocity is limited to 0.8 m/s to ensure the robot can quickly stop or adjust direction when encountering sudden obstacles (e.g., a person walking across the corridor), while the minimum velocity prevents the robot from stalling in narrow spaces. This speed configuration aligns with the safety requirements of hospital logistics robots, which need to balance efficiency and collision avoidance [13].
2) goal_tolerance: Set to 0.3 m. This parameter specifies the allowable distance between the robot and the target point when the task is considered complete. A tolerance of 0.3 m balances positioning accuracy and task efficiency: a value < 0.2 m may cause the robot to repeatedly adjust its position near the target (e.g., in front of a ward door), increasing navigation time; a value > 0.5 m may result in inaccurate drug delivery positions.
In the ROS system, by configuring these DWA algorithm parameters, local path planning for the robot in the hospital environment is achieved. Experimental results show that the DWA algorithm can significantly improve the robot’s obstacle avoidance capabilities and navigation stability.
4.3. Path Planning Performance Evaluation
To evaluate the robot’s path planning performance, a path planning performance evaluation experiment is designed. In the hospital environment, multiple starting points and destinations are set, and the robot’s path length, navigation time, and obstacle avoidance occurrences in each task are recorded. Experimental results demonstrate that the robot’s path planning performance is stable and reliable, enabling efficient completion of drug delivery tasks.
5. Navigation Simulation Experiments
5.1. Simulation Experiment Platform Setup
A simulation experiment platform for the hospital environment is built based on the Gazebo simulation software. Gazebo is an open-source robot simulation software capable of simulating complex physical environments and robot motion characteristics. To model the “complex and dynamic” nature of hospital environments, the following configurations are implemented:
1) Dynamic obstacle simulation: Multiple mobile models are added to the simulation scenario, including humanoid models (simulating medical staff and patients) and equipment models (simulating mobile beds and medical carts). These dynamic obstacles move along predefined paths (e.g., walking back and forth in corridors, entering/exiting wards) at variable speeds (0.3 - 1.0 m/s), simulating the random movement of personnel and equipment in real hospitals. Advanced hospital robots often adopt visual perception and AI algorithm fusion to identify special objects and implement targeted obstacle avoidance strategies [14].
2) Environmental variability simulation: Some temporary obstacles (e.g., stacked medical supplies) are set to appear/disappear at random time intervals (5 - 15 seconds) in corridors and ward entrances, simulating the dynamic changes of environmental features in hospitals.
3) Physical interaction simulation: The Gazebo physics engine is configured to simulate collision effects between the robot and obstacles (e.g., elastic collisions with low-speed moving objects) and friction between the robot and the ground (e.g., reduced speed on smooth floor surfaces), enhancing the realism of the simulation.
By configuring Gazebo simulation parameters, a simulation scenario similar to the hospital environment is built, including corridors, wards, elevators, and other areas. Simultaneously, the robot model is imported into the Gazebo simulation environment to enable interaction between the robot and the simulation environment (See Figure 1, Figure 2).
Figure 1. Building a 3D scenario for robots using Gazebo software.
Figure 2. Controlling the robot to move in the room and build a map using lidar through the gmapping algorithm.
5.2. Navigation Function Testing
In the simulation experiment platform, the robot’s navigation function is tested. Multiple drug delivery tasks are set, and the robot’s navigation path, navigation time, and obstacle avoidance situations in each task are recorded. Experimental results show that the robot can accurately identify the target position in the simulation environment, plan a reasonable navigation path, and successfully avoid obstacles (both static and dynamic) to complete drug delivery tasks (See Figure 3).
Figure 3. Setting a target point on the map, and the robot plans its path independently and navigates to the target point.
5.3. Navigation Efficiency Evaluation
To evaluate the robot’s navigation efficiency, a navigation efficiency evaluation experiment is designed. In the simulation environment, multiple test scenarios are set, including straight-line navigation, curved navigation, and multi-obstacle navigation. The robot’s navigation time and path length in each test scenario are recorded to calculate navigation efficiency. Experimental results demonstrate that the robot’s navigation efficiency in the simulation environment is high, meeting the application requirements of hospital drug delivery robots.
6. Experimental Data and Analysis
6.1 Localization Accuracy Experimental Data
The maximum localization error is 0.0566 m, the minimum is 0.0141 m, and the average is about 0.0344 m, all within the 0.1m requirement for hospital drug delivery. Even near dynamic obstacles (e.g., Test Point 4), the robot maintains stable positioning, verifying the robustness of the optimized AMCL algorithm (See Table 1).
Table 1. Localization accuracy experimental data chart.
Test Point No. |
Actual Position (x, y) |
Estimated Position (x, y) |
Localization Error (m) |
1 |
(1, 1) |
(1.01, 0.99) |
0.0141 |
2 |
(2, 3) |
(1.98, 3.02) |
0.0283 |
3 |
(4, 2) |
(4.03, 1.97) |
0.0447 |
4 |
(3, 4) |
(2.96, 4.04) |
0.0566 |
5 |
(5, 5) |
(5.02, 4.98) |
0.0283 |
6.2. Path Planning Performance Experimental Data
Path lengths are close to the theoretical shortest path, with navigation time proportional to distance. The number of obstacle avoidances correlates with environmental complexity (Task 4 has the most obstacles and avoidances), showing the A* (global) and DWA (local) algorithms work well together for safe and efficient path planning (See Table 2).
Table 2. Path planning performance experimental data chart.
Task No. |
Path Length (m) |
Navigation Time (s) |
Obstacle Avoidance Occurrences |
1 |
12.5 |
30 |
2 |
2 |
15.8 |
38 |
3 |
3 |
9.2 |
22 |
1 |
4 |
18.7 |
45 |
4 |
5 |
11.3 |
27 |
1 |
6.3. Navigation Efficiency Evaluation Experimental Data
The robot maintains a stable efficiency of 0.5m/s across all scenarios, balancing timeliness and safety. Even in multi-obstacle environments, real-time obstacle avoidance does not reduce efficiency, meeting the practical needs of hospital drug delivery (Table 3).
Table 3. Navigation efficiency evaluation experimental data chart.
Test Scenario |
Navigation Time (s) |
Path Length
(m) |
Navigation
Efficiency (m/s) |
Straight-line Navigation |
10 |
5 |
0.5 |
Curved Navigation |
15 |
7.5 |
0.5 |
Multi-obstacle Navigation |
25 |
12.5 |
0.5 |
7. Conclusion
This paper conducts an in-depth study on the autonomous localization and navigation technology of hospital drug delivery robots based on the ROS system. By selecting and optimizing algorithms (gmapping, AMCL, A*, DWA) suitable for hospital environments, building a dynamic simulation platform using Gazebo, and specifying key algorithm parameters, a comprehensive evaluation of the robot’s localization accuracy, path planning capability, and navigation efficiency is conducted. The experimental results demonstrate that the designed drug delivery robot exhibits excellent autonomous localization and navigation performance in simulated hospital environments, with localization accuracy within 0.1 m and stable obstacle avoidance capabilities, providing effective technical support for hospital logistics automation.
8. Limitations
Despite the positive results, this study has several limitations that need to be addressed in future research. First, there is a “sim-to-real” gap: the simulation environment, although designed to mimic dynamic hospital scenarios, cannot fully replicate real-world complexities such as uneven lighting, sensor noise from electromagnetic interference in medical equipment, and unpredictable human movements (e.g., sudden stops or direction changes). Second, the algorithm selection and parameter tuning are based on a specific simulated hospital layout; their adaptability to other hospital structures (e.g., wider corridors, more complex ward arrangements) remains untested. Third, the current research does not consider energy consumption constraints, which are critical for real drug delivery robots that need to complete multiple tasks on a single charge. Finally, the simulation only includes common dynamic obstacles, and the robot’s performance in extreme scenarios (e.g., emergency evacuation, large crowds) has not been evaluated.
9. Future Prospects
In the future, we will focus on addressing the aforementioned limitations and further optimizing the system. First, we will conduct real-world experiments in actual hospital environments to calibrate algorithm parameters and reduce the sim-to-real gap, incorporating sensor fusion technologies (e.g., fusing lidar, camera, and IMU data) to improve robustness against environmental noise. Second, we will explore adaptive algorithm frameworks that can automatically adjust parameters according to different hospital layouts, enhancing the system’s versatility. Third, we will integrate energy consumption models into path planning algorithms to balance navigation efficiency and energy saving. Additionally, we will explore more advanced artificial intelligence algorithms (e.g., deep reinforcement learning [15]) to enable the robot to handle extreme scenarios and unpredictable obstacles more intelligently. Finally, we will investigate human-robot interaction technologies [16] to improve the robot’s ability to collaborate with medical staff, realizing a more intelligent and autonomous hospital drug delivery robot system.