Skip to main content
. 2022 Dec 6;22(23):9545. doi: 10.3390/s22239545
Algorithm 3 Pseudocode of the visual-servo control of the robotic arms
While (true) {
        Calculate s=(thh*, θu), s*=(0, 0);
        Calculate e=ss*=(thh*, θu);
        if (|e(3)|<0.02 && |e(4)|<0.02 && |e(5)|<0.02) {
                if (|e(0)|<0.01 && |e(1)|<0.01 && |e(2)|<0.01) {
                        break;
                }
                else {
                        (vw)=λJa+WaLe+e
                        p=p+(vw) 
                        q=IK(p) 
                        Cmd(q)
                }
        }
        else {
                (vw)=λJa+WaLe+e
                p=p+(vw)
                Cmd(q);
        }
}