1. Purpose of the Case

Learn to use the 3D gesture module and create more interesting interactive applications.

The module integrates a high-precision, low-power gesture recognition sensor that supports gesture recognition in three-dimensional space, enabling interactive control with the robot.

Note: When using the 3D gesture module, do not place the CoCube robot on the CoMaps positioning map.

2. Materials Used

CoCube Robot × 1 3D Gesture Module Personal Computer or Tablet

3. Software Platform

MicroBlocks——CoCube & CoCube Module

4. Quick Experience

  1. Connect Device: Connect the MicroBlocks IDE to the CoCube robot via a wired or wireless connection, and attach the 3D gesture sensor module to the CoCube robot.

  2. Add Block Library: Under the "Robot" directory, add the "CoCube Module Library" — this library includes all functions of the external modules: "3D Gesture Connected" and "3D Gesture Read."

  • 3D Gesture Sensor Connected: Drag out the "3D Gesture Connected" block, place it in the workspace, and click to run. This block checks whether the CoCube robot is connected to the 3D gesture sensor module.

Note: Since the module requires some time to power up, there’s a chance that the first run might return "false." Please wait a little longer before testing again.

  • 3D Gesture Sensor Read Data: Drag out the "3D Gesture Read" block, wave your hand in front while clicking to run, and you will likely read a "?" (though you might be lucky and read "left," "right," or another gesture). Mimicking the approach used with the ToF laser rangefinder, looping the reading will still only give you individual "?". Clearly, this approach is not ideal.

The 3D gesture sensor supports 9 types of gesture recognition by default, with a maximum update frequency of 240Hz. It only provides correct input when a gesture is captured; otherwise, it outputs "?". Therefore, if you want to output measurement results in real-time, you need to write the following program:

5. Advanced Features

Can you write a program to control the robot with gestures? For example, waving to one side makes the robot rotate in that direction.

Example Program – Think and Try First!

6. Challenge Yourself

Try controlling the CoCube robot to play music or perform movements using other gestures!

7. Reference Code Examples

All tutorial code examples above:

MicroBlocks —— 3D Gesture Module Cases

CC-BY-SA

© by CoCube 2024-2025.

This work is licensed under a CC-BY-SA 4.0 license.