GithubHelp home page GithubHelp logo

liviobisogni / consensus Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 286 KB

Consensus protocol implementation for multiple robots in ROS

License: MIT License

CMake 25.67% C++ 74.33%
consensus-algorithm consensus-protocol ros centroid multi-robot-systems robot-control

consensus's Introduction

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):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.