Skip to content

Consensus protocol implementation for multiple robots in ROS

License

Notifications You must be signed in to change notification settings

liviobisogni/consensus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consensus

A ROS-based consensus protocol for multiple robots to converge towards the centroid of their positions.

Prerequisite Compile Execute Use Screenshots

Prerequisite

  • ROS - An open-source, meta-operating system for your robots. The repository has been tested using ROS Kinetic.

How to Compile

  1. Move the package folder (consensus) to the src directory of your ROS workspace, for example ~/catkin_ws/src/.

  2. Open a terminal window and navigate to your ROS workspace directory:

    cd ~/catkin_ws/
  3. Build the package using the catkin_make command:

    catkin_make

This will compile the package and generate the necessary files for running the ROS nodes.

How to Execute

  1. Open a terminal window.

  2. Navigate to your ROS workspace directory.

  3. Launch the package using the following command:

    roslaunch consensus consensus.launch

This will launch the ROS nodes required to run the package.

How to Use

  1. Adjust the x, y, and theta variables in consensus.launch (starting from line 13) to set the initial positions of the additional robots (the first robot is spawned at the center of the workspace). Ensure that NUM_TURTLES in consensus.cpp is updated to reflect the total number of robots, including the first robot and any additional robots.
  2. Each robot will communicate its position with every other robot in the network.
  3. The consensus protocol will be executed on each robot in order to determine the centroid(s), which may slightly differ from the theoretical centroid.
  4. Upon completion, the robots will simultaneously move toward the calculated centroid(s).
  5. While the protocol is running, various types of information will be printed on the terminal. Wait until the consensus node is shut down or press ESC to exit the program at any time.

Screenshots

  • Initial positions:

  • Turtles move toward the centroid(s):

  • Turtles reach the centroid pose(s):

Releases

No releases published

Packages

No packages published