Something that push or push out and back a stick horizontally to 50cm

Hi, i'm searching for idea how to build something that will push or push out and back a stick horizontally to 50cm.Sorry i don't know how to explain better,ask me if you don't understand.thanks

Diagram

Not sure what you mean. Can you create a drawing or two showing what you need? It sound like you just want to move a stick in and out 50 cm? The more information you can provide about hte project, the better we can help.