In 1784, James Watt, the inventor of the steam machine, reached a practical solution to the problem. He used three connecting rods, of which two, AD and BC, are of equal length, with AB much shorter.
If C and D are points fixed at proper different heights, then moving the AB rod to its median point P appears to draw, for an appreciable length, a vertical rectilinear line.
"Appears" is the right word, because, by making a simple model of this mechanism with cardboard strips or any other material (ice cream sticks connected with pins are just fine), one realises immediately that it is an approximation. The complete movement of the articulated system causes the P point to draw a figure 8 (a "long inflection" curve). Notwithstanding these limitations, the Watt mechanism, thanks to its simplicity, has been widely used, and still is, to solve the problem of frictionless rectilinear motion.

To drive the piston rod in steam machines, rather than using the simple version described above, a variant of it was used, based on the same principle and known as "Watt's parallelogram".
DA = AE = BQ = BC and AB = EQ, the C and D points are fixed and therefore the DABC system is identical to the one described above: the median point P of the AB rod draws an approximate vertical rectilinear motion. Since ABQE is a parallelogram, the motion of the Q point is a 2-factor enlargement of the motion of P, thus Q, which obtains its impetus from the piston rod, also moves with a "nearly" rectilinear vertical motion.
The invention of this mechanism was certainly a step forward in the development of mechanical technology at the beginning of the 19th century, linked to the improvement and to the study of the application possibilities of the steam machine. It is thought that Watt was much prouder of this discovery than of the actual invention of the steam engine!