  Collaborative simultaneous localization and mapping (CSLAM) is essential for
autonomous aerial swarms, laying the foundation for downstream algorithms such
as planning and control. To address existing CSLAM systems' limitations in
relative localization accuracy, crucial for close-range UAV collaboration, this
paper introduces $D^2$SLAM-a novel decentralized and distributed CSLAM system.
$D^2$SLAM innovatively manages near-field estimation for precise relative state
estimation in proximity and far-field estimation for consistent global
trajectories. Its adaptable front-end supports both stereo and omnidirectional
cameras, catering to various operational needs and overcoming field-of-view
challenges in aerial swarms. Experiments demonstrate $D^2$SLAM's effectiveness
in accurate ego-motion estimation, relative localization, and global
consistency. Enhanced by distributed optimization algorithms, $D^2$SLAM
exhibits remarkable scalability and resilience to network delays, making it
well-suited for a wide range of real-world aerial swarm applications. The
adaptability and proven performance of $D^2$SLAM represent a significant
advancement in autonomous aerial swarm technology.
