Context

The code below presents the different steps involved in the detection and sorting process of tokens by shape (circle/square) on Conveyor 2, in order to route them to the conveyor dedicated to each shape.

Initialization and Active Vision Monitoring

The robot begins by scanning its tools and verifying that the vacuum pump has successfully evacuated the air. It then enters its main loop:

  • Waiting Position: The robot moves to a high observation position to obtain an overview of the vision workspace.

  • Flow Monitoring: As long as the camera does not detect any geometric object, the robot runs Conveyor 2 at 80% of its maximum speed to bring incoming tokens into the vision area.

  • Interception: As soon as a token enters the vision area, the sub-loop ends. The robot immediately stops the conveyor and waits 1 second to ensure the part or parts are completely stationary before starting the sorting process.

Conditional Branch 1: Circle Handling

The robot first checks whether the detected and stationary object is a circular token:

  1. If the camera confirms that the object is a circle (regardless of its color), the robot automatically performs a pick operation. A vertical offset of 5 mm is configured to precisely adjust the end-effector approach based on the token thickness.

  2. Visual Feedback: If the pick is successful, the robot's LED ring lights up in a solid Purple/Magenta color.

  3. Placement (Circle Routing): The robot transfers the part to Conveyor 3, sending the circular token toward Robot 3.

Conditional Branch 2: Square Handling

If the object is not a circle, the robot checks whether it is a square token:

  1. If the camera detects a square shape, the robot uses the vision module to pick it up, again using the 5 mm safety offset to ensure a reliable grasp.

  2. Visual Feedback: When a square token is successfully picked, the LED ring changes color and turns solid Orange/Yellow.

  3. Placement (Square Routing): The robot rotates and places the square token at the entrance of Conveyor 4, directing it toward the Robot 4 and Robot 5 area.

Summary

Robot 2 is responsible for sorting tokens according to their shape (circle or square) through the following steps:

  • It keeps the conveyor running until a token arrives in the vision area.

  • It stops the conveyor, analyzes the shape, and picks the object using Vision Pick.

  • If the object is a circle, its LEDs turn purple and it places the token on Conveyor 3.

  • If the object is a square, its LEDs turn orange and it places the token on Conveyor 4.

Once the token has been sorted, the robot starts the same cycle again for the next token.

Video Demonstration

Last modified: Wednesday, 10 June 2026, 5:04 PM