Cam and Gear Mechanism

Input is the green gear to which a long arm is fixed.
Two short arms (each carries two rollers) are connected to both ends of the long arm by revolution joints. Due to the orange gear cam and a slot in the base, the short arms change their directions after every revolution of the long arm.
Trasmission ratio of the gear drive is 2.