This system implements an autonomous medicine delivery robot for hospital environments. The robot is capable of:
- Reading QR codes to receive delivery tasks
- Navigating to medicine storage shelves using ArUco markers
- Precise positioning for medicine pickup
- Autonomous navigation to hospital wards
- Confirming delivery by entering wards
- Front Camera: QR code detection for task reception and ward entry
- Side Camera: ArUco marker detection for shelf alignment
- Opposite Side Camera: Extended vision and safety monitoring
- Precise positioning using ArUco markers
- Mecanum wheel-based movement
- ROS-based control system
-
Camera Manager (
src/camera/camera_manager.py)- Handles all camera operations
- QR code detection
- ArUco marker detection
- Position calculation
-
Navigation Controller (
src/navigation/navigation_controller.py)- Precise positioning
- Movement control
- State management
-
Main Controller (
src/main_controller.py)- System coordination
- Task execution
- ROS integration
- Python 3.10+
- ROS Noetic
- OpenCV
- Dynamixel SDK
-
Clone the repository:
git clone https://github.com/yourusername/python_dynamixel_106.git cd python_dynamixel_106 -
Install dependencies:
pip install -r requirements.txt
-
Configure camera devices in
src/main_controller.py
-
Start ROS core:
roscore
-
Run the main controller:
python src/main_controller.py
- Front camera: Device ID 0
- Side camera: Device ID 1
- Opposite side camera: Device ID 2
- Optimal distance to shelf: 60mm
- Distance tolerance: 5mm
- Angle tolerance: 0.05 radians
QR codes should be formatted as:
medicine_id:ward1,ward2,ward3
Example:
med123:101,102,103
- Continuous position monitoring
- Error detection and reporting
- Resource cleanup on shutdown
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
-
Build and start the container:
docker-compose up -d --build
-
Enter the container:
docker-compose exec ros2 bash
Once inside the container, you'll be in the /ros2_ws directory. Here are some common ROS 2 commands:
-
Source the ROS 2 environment:
source /opt/ros/jazzy/setup.bash -
Check ROS 2 installation:
ros2 --version
-
List available nodes:
ros2 node list
-
List available topics:
ros2 topic list
-
View topic messages:
ros2 topic echo /topic_name -
Run your nodes:
# Run main controller python3 src/main_controller.py # Run navigation node python3 src/navigation/navigation_controller.py # Run sensor node python3 src/sensors/sensor_manager.py
-
Run tests:
# Run all tests pytest tests/ # Run specific test file pytest tests/test_ros_nodes.py # Run with verbose output pytest -v tests/
-
View node info:
ros2 node info /node_name
-
View topic info:
ros2 topic info /topic_name
-
View service list:
ros2 service list
-
Call a service:
ros2 service call /service_name service_type "{}" -
View parameter list:
ros2 param list
-
Get parameter value:
ros2 param get /node_name parameter_name
-
Source your workspace:
source install/setup.bash -
Build your workspace:
colcon build
-
View build logs:
colcon build --event-handlers console_direct+
-
Clean build:
rm -rf build/ install/ log/ colcon build
-
If ROS 2 commands are not found:
source /opt/ros/jazzy/setup.bash -
If your nodes are not found:
source install/setup.bash -
If you get permission errors:
# Check if you're running as rosuser whoami # Should show: rosuser
-
To restart the container:
# From host machine docker-compose restart