In engineering an automatic rocker you should consider the following:
a) How much rocking motion is comfortable for Grandma?
b) How fast does Grandma like to rock?
c) Is the design safe?
d) How much will it cost?
Any of the following devices/mechanisms may be used in your design. However, your choices are not limited to the devices below, these are just some options. Be creative!

Electric Motor - Electric power will cause the shaft to rotate at a speed, which you designate. A selector switch to control the motor has three positions: clockwise, counter-clockwise, and off. ($15)

Hydraulic Cylinder - A device with a handle will allow the rod to move in or out of the cylinder. How fast and how much the handle is moved will control how fast the rod moves and to what position it moves. ($20)

4-Bar Linkage - You may designate the lengths of each link. Turning link number 2 will cause movement in links 3 & 4. ($10)

6-Bar Linkage With Screw - Turning the screw will cause link number 4 to move up or down. ($12)

Rack & Pinion -- As the pinion turns, the rack moves back and forth ($12)