Skip to content
Liani Lye edited this page Dec 16, 2015 · 13 revisions

Our code consists largely of object-oriented ROS nodes and helper scripts to simplify the process of running the code with multiple agents. The two main types of ROS nodes that we created were omniscient and agent. There is one omniscient node running that facilitates communication among the agents. There is one agent node running per agent that received packets of information from the Omniscient node and acts based on the contents of the packets.

Below is a class/interaction diagram showing our code structure:

About the Nodes

omniscient knows the positions of all agents by subscribing to the topics /robot[n]/STAR_pose/continuous. Based on the agents' locations, it publishes information packets to the topics /robot[n]/packet. Each packet contains:

  • three constants k_a, k_b, and k_c that play into our governing equations
  • centroid, the point each agent converges upon
  • the radius R about the centroid on which the agents quit converging
  • sensing_radius, each agent's artificially set sensing range
  • an array others containing the locations of all agents within the sensing range.

Each agent instance subscribes to its topic /robot[n]/packet. With the information in the packet, the agent calculates its destination point, all the while publishing to /robot[n]/STAR_pose/continuous.

Rationale: Our Definition of Swarms

Clone this wiki locally