Analysis and optimal design of an underactuated finger mechanism for robotic fingers