A Decentralized Control Algorithm for Swarm Behavior and Obstacle Avoidance in Unknown Environments