This project implements a complete perception-to-manipulation pipeline for automated waste sorting using ROS2, a Convolutional Neural Network (CNN), and a simulated IRB360 delta robot in CoppeliaSim.
The system captures images from a simulated camera, classifies objects into waste categories, and performs real-time pick-and-place operations to sort them into the correct bins.
- ROS2-based modular architecture (camera, classifier, controller)
- CNN-based image classification (TensorFlow/Keras)
- Real-time integration with CoppeliaSim via Remote API
- Event-driven perception using trigger signals
- Robust synchronization using
robot_busystate - Failure handling (missed grasp → reject to default bin)
- End-to-end autonomous pipeline
CoppeliaSim Camera ↓ camera_node ↓ /camera/image_raw ↓ classifier_node (CNN) ↓ /waste/class ↓ controller_node ↓ CoppeliaSim IRB360 Robot
- ROS2 (Humble)
- Python (rclpy)
- TensorFlow / Keras
- OpenCV + cv_bridge
- CoppeliaSim (Edu)
- Remote API (legacy)
- NumPy
The classifier predicts 4 classes:
- Carton
- Glass
- Metal
- Plastic
- Object reaches the inspection zone.
- Conveyor stops and triggers image capture.
camera_nodepublishes image + trigger.classifier_noderuns CNN and outputs class.controller_nodesends command to robot.- IRB360 performs pick-and-place.
- Conveyor resumes.
If the robot fails to grasp an object:
- The conveyor resumes automatically.
- The object is sent to a default (gray) bin.
- The system continues without blocking.
| Metric | Value |
|---|---|
| Throughput | 14 objects/min |
| Avg Cycle Time | ~4.29 s/object |
| Classification Accuracy | 100% |
| End-to-End Success Rate | 96% |
git clone https://github.com/YOUR_USERNAME/waste-sorting-ros2.git
cd waste-sorting-ros2cd ros2_ws colcon build source install/setup.bash
Make sure you have installed:
-
ROS2 Humble
-
Python 3
-
TensorFlow
-
OpenCV
-
cv_bridge
Start CoppeliaSim
Load the simulation scene
Press Play
Run ROS2 Nodes (in order)
-
Terminal 1 ros2 run waste_control controller_node
-
Terminal 2 ros2 run waste_perception classifier_node
-
Terminal 3 ros2 run waste_perception camera_node
ros2_ws/
│
├── src/
│ ├── waste_perception/
│ │ ├── camera_node.py
│ │ ├── classifier_node.py
│ │ ├── sim.py
│ │ └── remoteApi.so
│ │
│ ├── waste_control/
│ │ └── controller_node.py
│
├── models/
│ └── classifier_second.h5-
Synchronization between perception and actuation
-
Remote API communication conflicts
-
Event-driven classification (trigger-based)
-
Avoiding duplicate classification
-
Handling failed grasp scenarios
-
Multi-node coordination in ROS2
-
Improve CNN accuracy with larger dataset
-
Implement real robot deployment
-
Use ROS2 actions instead of topics
-
Replace legacy Remote API with ZeroMQ API
-
Optimize robot motion planning
-
Add reinforcement learning for grasping
Luisa Chávez Vásquez
M.S. Electrical & Computer Engineering
North Carolina State University