View full-text article in PMC Sensors (Basel). 2021 Dec 20;21(24):8488. doi: 10.3390/s21248488 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 Algorithm to obtain the optimal joints to hit the target. 1:TargetPointcamera←CleaningZoneDetection(RGB,Deph) 2:TargetPointtool←TransformToTool(TargetPointcamera) 3:MinDistance←0.5m 4:forθ0i=Min(θ0) to Max(θ0) do 5: for θ1j=Min(θ1) to Max(θ1) do 6: Joints←(θ0i,θ1j) 7: WorkSpacePoint←DirectKinematic(Joints) 8: Pointtool←FluidTrajectory(WorkSpacePoint) 9: Distance←(TargetPointtool,Pointtool) 10: if Distance<MinDistance then 11: MinDistance←Distance 12: FinalJoints←Joints