A quantum mechanical formalism capable of describing the scattering, trapping, sticking, and desorption of an atom from a moving corrugated surface is presented. While the instantaneous particle-bath interaction is assumed to be weak, the particle and the bath can exchange energy over long periods of time. We have explored the trapping desorption and trapping-relaxation-sticking of He on Cu(110) and of H on graphite(0001). Higher substrate temperatures generally lead to increased trapping, but a higher desorption rate eventually leads to less, or zero sticking, at long times. In both cases, we observe that trapping in diffraction-mediated selective adsorption resonances can enhance sticking at low incident energies. While trapped in the resonance, the atom can relax toward the ground state of the gas-substrate attractive well. If the binding energy is larger than the amount of energy in the atom's motion parallel to the surface, it remains stuck at long times, at sufficiently low temperatures. We find sticking probabilities on the order of 1% at very low energies for both systems. In the vicinity of a selective adsorption resonance, this sticking can increase by several percent, depending on the size of the corrugation.