In this paper, we study aggregation in a swarm of simple robots, called s-bots, having the capability to self-organize and self-assemble to form a robotic system, called a swarm-bot. The aggregation process, observed in many biological systems, is of fundamental importance since it is the prerequisite for other forms of cooperation that involve self-organization and self-assembling. We consider the problem of defining the control system for the swarm-bot using artificial evolution. The results obtained in a simulated 3D environment are presented and analyzed. They show that artificial evolution, exploiting the complex interactions among s-bots and between s-bots and the environment, is able to produce simple but general solutions to the aggregation problem.