Study on gas deflagration-to-detonation transition (DDT) of is of great significance for industrial explosion prevention and detonation propulsion technology research and development. Staggered array of obstacles is a typical obstacle layout that may be involved in the gas ignition and explosion scenario. Its existence usually significantly promotes the occurrence of DDT. In view of the lack of understanding of DDT in staggered array of obstacles, high-precision algorithm and dynamic adaptive grid were applied to solve the two-dimensional, fully compressible reactivity Navier-Stokes equations coupled with a calibrated chemical-diffusive model. Numerical investigation on the initiation process of DDT of premixed hydrogen and air in staggered array of square obstacles under different obstacle spacings was carried out. The results showed that decreasing obstacle spacing is beneficial to increase flame surface area in the early stage of flame acceleration and enhance compression of unburned gas by shock wave in the later stage, thus shortening DDT run-up time and distance. However, when the obstacle spacing is reduced to a threshold value, stuttering detonation occurs and the DDT run-up distance increases. For the occurrence of DDT, it is mainly caused by the interaction between the flame and the shock wave reflected from the front wall of obstacle. The detonation partially decouples when it diffracts around an obstacle. Detonation re-initiation may be triggered when the decoupled detonation collides with a wall or with the shock wave or failure detonation wave from the other side of the obstacle. If the obstacle spacing is too small, the shock wave intensity decays seriously during detonation decoupling. This can easily lead to detonation failure. In addition, shock waves can be reflected off the staggered array of square obstacles in the vertical and parallel directions to the flame propagation direction, which help shock waves to act on the flame and unburned gas mixture. Therefore, DDT is more likely to be initiated in the staggered array of square obstacles than that of circular obstacles.