Design and optimization of a one-degree-of-freedom eight-bar leg mechanism for a walking machine