In this paper, to address the cooperative localisation of a heterogeneous UAV swarm in the GNSS-denied environment, an adaptive simulated annealing-particle swarm optimisation (SA-PSO) cooperative localisation algorithm is proposed. Firstly, the forming principle of the communication and measurement framework is investigated in light of a heterogeneous UAV swarm composition. Secondly, a reasonably cooperative localisation function is established based on the proposed forming principle, which can minimise the relative localisation error with limited available information. Then, an adaptive weight principle is incorporated into the particle swarm optimisation (PSO) for better performance. Furthermore, in order to overcome the drawbacks of PSO algorithm easily falling into the local extreme point, an adaptive SA-PSO algorithm is improved to promote the convergence speed of cooperative localisation. Finally, comparative simulations are performed among the adaptive SA-PSO, adaptive PSO, and PSO algorithms to demonstrate the feasibility and superiority of the proposed adaptive SA-PSO algorithm. Simulation results show that the proposed algorithm has better performance in convergence speed, and the cooperative localisation precision can be guaranteed.