Skip to content

Using Webots to simulate 3D "Flippy" robots what emulate some insect swarm behaviors like bridge and tower building. Based on the work of J. Zerez, under the supervision of Olin College of Engineering.

Notifications You must be signed in to change notification settings

julesbrettle/Webots_3D_Flippy_Robots

 
 

Repository files navigation

Webots_3D_Flippy_Robots (Formerly Webots_Playground)

Table of Contents

  1. Project Purpose and Progress
  2. Environment Setup & Quick Start
  3. File Structure
  4. Useful Resources & References
  5. Recommendations and Next Steps

1 | Project Purpose and Progress

Section created by J. Brettle (Summer 2021), modified by __

This project builds upon the research done by Lucie Houel, Melinda Malley, and others in using "flippy" robots (modeled as two spheres that flip around each other to walk forwards and over each other) to mimic the self-assembly behaviors of army ants. Most of their simulations were done in 2D, so this project aims to create a framework for modeling similar behaviors and rulesets in 3D using the open source environment Webots.

As of 8/2/2021, the flippies can relatively reliably walk on the floor and each other. They use their four touch sensors to differentiate between touching another flippy and the floor, and change their behavior as such (see "The 4 touch sensors theory" section). They have the ability to change heading and navigate across the floor using two extra motors for turning, as well as a GPS and Inertial Unit for guidance. Their current default mode is to turn to face and walk toward the first goalCoords point given (see "Flippy steering" section). The flippies also take longer between flips as they near the first given slowCoords point in order to create traffic to facilitate self-assembly (see "Flip delay / distance variable speed control" section).


2 | Environment Setup & Quick Start

Section created by J. Zerez (Spring 2021), modified by J. Brettle (Summer 2021)

TL;DR: Download Webots, Install a C/C++ Compiler for Webots and make sure you have Python v3+. Then run a .wbt file from the worlds folder.

The simulation is built off of Webots, which is an open source robot simulator similar to gazebo. It support various different programming languages such as C, C++, Python, Java, and Matlab, as well as frameworks like ROS. The code for this project that interfaces directly with Webots is written in C++. As such, you'll need to make sure you have a C/C++ compiler. Instructions can be found here.

Additional python scripts have also been created in order to make the process of creating Webots simulations and worlds a bit more streamlined. Make sure you have some kind of Python version 3.

In Webots, one can choose to open and run flippy_sim.wbt. It usually contains a singular flippy and can be useful for testing flippy parameters and geometries. Run flippy_sim_autogenerated.wbt for more flippies (see "Using flippy_sim_autogenerated and Script Inputs" section).

For best viewing, go to "Optional Rendering" under the "View" menu and select "Show Coordinate System" and "Show All Bounding Objects". "Show Contact Points" can also be a useful feature for debugging.


3 | File Structure

Section created by J. Zerez (Spring 2021), modified by J. Brettle (Summer 2021)

./controllers Directory

The ./controllers directory contains folders for each of the controller files. The main controller for this project can be found in flippy_controller.cpp. Changing this file is the key to modifying flippy behavior.

./plugins Directory

This contains folders for various custom physics plugin files. This project relies on a custom physics plugins which can be found in flippy_physics.cpp. For more information about custom physics plugins, checkout Webot's Documentation on physics plugins.

./protos Directory

This contains .proto files. These files are essentially wrappers for complex Webots objects. These files are used for specifying object parameters and architectures, giving the user a simplified set of parameters to interact with in the Webots UI. It substantially simplifies the feature tree of the project. More information about protos can be found here. This project does not use .proto files to define each flippy robot. This is because of the way that Webot's physics plugins are implemented. Each flippy in a swarm must be its own unique robot with a unique ID and DEF. As such, .proto files will not work. However, 4-touch-sensor flippies (light and dark tints of green and blue) use hemisphere.proto to define the indexedFaceSet for the shape.

./script_inputs Directory

This contains template files for the make_flippys.py script. There are two required files:

./script_outputs Directory

This contains outputs from the make_flippys.py script (if write_to_wbt=False). These files will be .txt's and will be properly formatted to be pasted directly into any .wbt file.


4 | Useful Resources & References

Section created by J. Zerez (Spring 2021), modified by J. Brettle (Summer 2021)

This Repo's Wiki

Creating a Physics Plug-in with ODE

Webots General documentation

Conceptual


5 | Recommendations & Next Steps

Section created by J. Zerez (Spring 2021), modified by J. Brettle (Summer 2021)

  • Implement flippy-to-flippy fixed joints (see "The usage of exclusively "flippy-to-floor" fixed joints as opposed to including "flippy-to-flippy" fixed joints" section).
  • Do more debugging on the crashing problem (see "Individual robot crashing and running the simulation with multiple flippies" section).
  • Try building a tower and/or a bridge. You may have to:
    • Create a way for flippies to switch to the next point in the goalCoods list when they are within the error margin (the fourth/last element in each row)
    • Create a way for flippies to use all of the points in slowCoords instead of just the first row
  • Continue to adjust rulesets and parameters to more reliably create desired behaviors, and document effects of different changes.
  • Test valley traversal on valley angles of 90 degrees or greater so that exact placement of the first flippy isn't required for complete bridge disassembly. Try to get this to work for more random positions and orientations of flippies.
  • Test valley traversal where flippies aren't all in the same plane (e.g. four flippies in a square rather than a line)

About

Using Webots to simulate 3D "Flippy" robots what emulate some insect swarm behaviors like bridge and tower building. Based on the work of J. Zerez, under the supervision of Olin College of Engineering.

Resources

Stars

Watchers

Forks

Languages

  • C++ 60.7%
  • Makefile 20.2%
  • Python 12.8%
  • Jupyter Notebook 6.3%