A construction machine comprising: an automotive lower traveling structure; an upper revolving structure mounted on the lower traveling structure to be capable of revolving thereon; a working mechanism that is disposed in the upper revolving structure and is provided with a plurality of movable parts (5A, 5B, 5C) coupled to each other; a plurality of inertial sensors (16, 17, 18) with the same specification that are respectively mounted on each of the plurality of movable parts (5A, 5B, 5C) to be capable of detecting angular velocities (ωa, ωb, ωc) of three coordinate axes (A, B, C) perpendicular to each other; a controller configured to calculate a posture of each of the movable parts (5A, 5B, 5C) by using a sensor output of each of the plurality of inertial sensors (16, 17, 18); a traveling operation pressure sensor that detects a traveling operation pressure (Pa) for causing the lower traveling structure to travel; and a revolving operation pressure sensor that detects a revolving operation pressure (Pb) for revolving the upper revolving structure, characterized in that: the plurality of inertial sensors (16, 17, 18) are respectively mounted on the plurality of movable parts (5A, 5B, 5C) to rotate in the coordinate axes (A, B, C) different from each other in case the plurality of movable parts (5A, 5B, 5C) are operated; and the controller is configured to, in case the plurality of movable parts (5A, 5B, 5C) are operated in a state where the traveling operation pressure (Pa) and the revolving operation pressure (Pb) are equal to or less than respective preset operation pressure threshold values (Pr, Pt), make a determination on which movable part of the plurality of movable parts (5A, 5B, 5C) each of the plurality of inertial sensors (16, 17, 18) is mounted, based upon the sensor output outputted from each of the plurality of inertial sensors (16, 17, 18) and set a corresponding relation between each of the plurality of movable parts (5A, 5B, 5C) and each of the plurality of inertial sensors (16, 17, 18) based upon the determination result. an automotive lower traveling structure; an upper revolving structure mounted on the lower traveling structure to be capable of revolving thereon; a working mechanism that is disposed in the upper revolving structure and is provided with a plurality of movable parts (5A, 5B, 5C) coupled to each other; a plurality of inertial sensors (16, 17, 18) with the same specification that are respectively mounted on each of the plurality of movable parts (5A, 5B, 5C) to be capable of detecting angular velocities (ωa, ωb, ωc) of three coordinate axes (A, B, C) perpendicular to each other; a controller configured to calculate a posture of each of the movable parts (5A, 5B, 5C) by using a sensor output of each of the plurality of inertial sensors (16, 17, 18); a traveling operation pressure sensor that detects a traveling operation pressure (Pa) for causing the lower traveling structure to travel; and a revolving operation pressure sensor that detects a revolving operation pressure (Pb) for revolving the upper revolving structure, characterized in that: the plurality of inertial sensors (16, 17, 18) are respectively mounted on the plurality of movable parts (5A, 5B, 5C) to rotate in the coordinate axes (A, B, C) different from each other in case the plurality of movable parts (5A, 5B, 5C) are operated; and the controller is configured to, in case the plurality of movable parts (5A, 5B, 5C) are operated in a state where the traveling operation pressure (Pa) and the revolving operation pressure (Pb) are equal to or less than respective preset operation pressure threshold values (Pr, Pt), make a determination on which movable part of the plurality of movable parts (5A, 5B, 5C) each of the plurality of inertial sensors (16, 17, 18) is mounted, based upon the sensor output outputted from each of the plurality of inertial sensors (16, 17, 18) and set a corresponding relation between each of the plurality of movable parts (5A, 5B, 5C) and each of the plurality of inertial sensors (16, 17, 18) based upon the determination result. the plurality of inertial sensors (16, 17, 18) are respectively mounted on the plurality of movable parts (5A, 5B, 5C) to rotate in the coordinate axes (A, B, C) different from each other in case the plurality of movable parts (5A, 5B, 5C) are operated; and the controller is configured to, in case the plurality of movable parts (5A, 5B, 5C) are operated in a state where the traveling operation pressure (Pa) and the revolving operation pressure (Pb) are equal to or less than respective preset operation pressure threshold values (Pr, Pt), make a determination on which movable part of the plurality of movable parts (5A, 5B, 5C) each of the plurality of inertial sensors (16, 17, 18) is mounted, based upon the sensor output outputted from each of the plurality of inertial sensors (16, 17, 18) and set a corresponding relation between each of the plurality of movable parts (5A, 5B, 5C) and each of the plurality of inertial sensors (16, 17, 18) based upon the determination result.