The rotary-piston machine consists of two operating units. The first one comprises a horizontal operating cylinder (1) with cylindrical shaft (5), connected to the main shaft (4) and sealed with rings to the walls of the cylinder (1). The shaft (5) has a first friction element (9) pressed against the internal wall of the cylinder (1). The second unit comprises a cylindrical body (15) mounted to the main shaft (4) with a firmly connected to its circumference inner ring (16) of a bearing with an outer ring (17) provided of an articulated joint (18) connected to a frame (19) that is connected to a valve (13) which press a second friction element (14) to the shaft (5). Both units move in synchronization.