A working machine (20, 120), comprising: an undercarriage including first and second ground engaging units (24, 26) including first and second travel motors (28, 30) for driving the first and second ground engaging units (24, 26), respectively; a main frame; a swing bearing supporting the main frame from the undercarriage such that the main frame is pivotable about a pivot axis relative to the undercarriage, the pivot axis being substantially vertical when a ground surface engaged by the ground engaging units (24, 26) is substantially horizontal; a swing motor configured to pivot the main frame on the swing bearing about the pivot axis relative to the undercarriage; a boom extending from the main frame along a working direction of the boom; a pivot angle sensor configured to provide a pivot angle signal corresponding to a pivot position of the main frame relative to the undercarriage about the pivot axis; and a controller configured to receive the pivot angle signal, the controller being configured to selectively drive the swing motor automatically to rotate the main frame about the pivot axis relative to the undercarriage to a target pivot position of the main frame relative to the undercarriage; characterized in that the controller is further configured to automatically drive both travel motors (28, 30) to change an orientation of the undercarriage relative to the ground surface from an initial orientation by rotating the undercarriage through a first angle relative to the ground surface; and automatically drive the swing motor to rotate the main frame about the pivot axis from an initial pivot position relative to the undercarriage through a second angle opposite and equal to the first angle, simultaneously with and at substantially the same rate as the undercarriage is rotated relative to the ground surface, so that an orientation of the main frame relative to the ground surface is maintained while the orientation of the undercarriage relative to the ground surface is changed, wherein the target pivot position of the main frame relative to the undercarriage is a position displaced by the second angle from the initial pivot position of the main frame relative to the undercarriage. an undercarriage including first and second ground engaging units (24, 26) including first and second travel motors (28, 30) for driving the first and second ground engaging units (24, 26), respectively; a main frame; a swing bearing supporting the main frame from the undercarriage such that the main frame is pivotable about a pivot axis relative to the undercarriage, the pivot axis being substantially vertical when a ground surface engaged by the ground engaging units (24, 26) is substantially horizontal; a swing motor configured to pivot the main frame on the swing bearing about the pivot axis relative to the undercarriage; a boom extending from the main frame along a working direction of the boom; a pivot angle sensor configured to provide a pivot angle signal corresponding to a pivot position of the main frame relative to the undercarriage about the pivot axis; and a controller configured to receive the pivot angle signal, the controller being configured to selectively drive the swing motor automatically to rotate the main frame about the pivot axis relative to the undercarriage to a target pivot position of the main frame relative to the undercarriage; characterized in that the controller is further configured to automatically drive both travel motors (28, 30) to change an orientation of the undercarriage relative to the ground surface from an initial orientation by rotating the undercarriage through a first angle relative to the ground surface; and automatically drive the swing motor to rotate the main frame about the pivot axis from an initial pivot position relative to the undercarriage through a second angle opposite and equal to the first angle, simultaneously with and at substantially the same rate as the undercarriage is rotated relative to the ground surface, so that an orientation of the main frame relative to the ground surface is maintained while the orientation of the undercarriage relative to the ground surface is changed, wherein the target pivot position of the main frame relative to the undercarriage is a position displaced by the second angle from the initial pivot position of the main frame relative to the undercarriage.