Camera Modules
The CoCube firmware provides two camera modules:
cocube_sengo1cocube_sengo2
Both connect over I2C. Once initialized, they occupy shared resources and switch cocube_module into camera mode.
Quick choice
- Sengo1: better for basic vision tasks Color, blob, card, line, QR code, and ball detection
- Sengo2: better for more advanced vision tasks AprilTag, deep learning, 20-class recognition, and motion detection
Shared characteristics
- both require
init()first - both require
change_algo(...)before you call the matching read function init()powers on the module and switchescocube_moduleinto camera mode- both support color recognition, blob detection, line following, card recognition, face recognition, and QR code reading
Main differences
| Feature | Sengo1 | Sengo2 |
|---|---|---|
| Color recognition | ✅ | ✅ |
| Blob detection | ✅ | ✅ |
| Line detection | ✅ | ✅ |
| Card recognition | ✅ | ✅ |
| Face recognition | ✅ | ✅ |
| QR code recognition | ✅ | ✅ |
| Ball detection | ✅ | ❌ |
| AprilTag | ❌ | ✅ |
| Deep learning classification | ❌ | ✅ |
| 20-class object recognition | ❌ | ✅ |
| Motion detection | ❌ | ✅ |
Continue reading
One important reminder
Camera APIs are usually tightly bound to the current algorithm.
If you do not switch to the correct algorithm first, the module throws an error directly instead of silently returning an empty result.
Also, after init(), the camera occupies shared resources, and the control path for the gripper and some peripherals changes as well.
So the safest order in the lessons is usually:
init()change_algo(...)- print the result first
- then map the result to actions