A Path Optimization Technique with Obstacle Avoidance for an 8-DOF Robot in Bolt Looseness Detection Task