Distributed Consensus in Networks of Dynamic Agents