Skip to main content
. 2021 Apr 1;21(7):2419. doi: 10.3390/s21072419
Algorithm 1 Security algorithm without human recognition

     Input: Stereo stream from the depth camera and tag position from the RTLS system.

     Output: Robotic system speed (%).

  • 1:

    Initialize depth camera parameters (resolution) and RTLS system (OPC UA).

  • 2:

    Set xRC, yRC, zRC, xRTLSR, yRTLSR, and zRTLSR as the known dimensions between the depth camera (C), robotic system (R), and beginning of the RTLS coordinate system.

  • 3:

    Save the reference depth image into point3Dreference.

  • 4:

    while the robotic workplace is switched on do

  • 5:

        Save actual depth image into point3Dactual.

  • 6:

        Determine point3Ddiff=substract(point3Dreference,point3Dactual).

  • 7:

        Convert point3Ddiff to grayscale.

  • 8:

        Eliminate initial measurement errors.

  • 9:

        Scale the point3Ddiff values using Equation (4).

  • 10:

        Convert into a binary image using the function cv2.threshold.

  • 11:

        Contour search with the function cv2.findContours.

  • 12:

        Perform distance calculation between each value in the contour and the robotic     system dist=(valuexxRC)2+(valueyyRC)2+(valuezzRC)2.

  • 13:

        Convert mindist coordinates to RTLS system coordinates.

  • 14:

        Find all contours where the RTLS system coordinates match with the contour coordinates and the RTLS tag ID is set to have an exception.

  • 15:

        if no other contours are found then

  • 16:

            Set robot_speed=20.

  • 17:

        else

  • 18:

            find mindist of the remaining contours.

  • 19:

            if mindistdanger_zone_size then

  • 20:

               Set robot_speed=0 for the danger zone.

  • 21:

            else if warning_zone_sizemindist>danger_zone_size then

  • 22:

               Set robot_speed=10 for the warning zone.

  • 23:

            else

  • 24:

               Set robot_speed=20 for the safe zone.

  • 25:

            end if

  • 26:

        end if

  • 27:

    end while