Behind those dancing robots, scientists had to bust a move