A package intended to optimize planar leg mechanisms
Project description
leggedsnake
This package aims to provide reliable computation techniques in Python to build, simulate and optimize planar legged mechanisms. It is divided in three main parts:
- Linkage conception in simple Python and kinematic optimization relying on pylinkage.
- Leg mechanism definition, with
Walker
heriting from theLinkage
class. - Dynamic optimization thanks to genetic algorithms
Requirements
Python 3, numpy for calculation, matplotlib for drawing, and standard libraries.
For kinematic optimization you can either use the built-in algorithm, or PySwarms, under MIT license. PySwarms is a much more complexe package which provides quick calculations, however with modern laptops the built-in swarm optimization should be quick enough to fit your needs.
Dynamic optimization relies on multiple packages. First of all it uses Pymunk, made by Victor Blomqvist, as a physics engine. Then you can either use the built-in algorithm, or the GA module from PyGAD. PyGAD is a complete library providing much more than genetic algorithms, so it might be heavy. Once again, the benchmarks showed than PyGAD is way quicker than the built-in, however the dynamic simulation takes all the execution time so feel frre to use the package that fits the most to your needs.
Usage
The demo script is strider.py, which demonstrates all the techniques about the Strider linkage.
Requirements
Python 3, numpy for calculation, matplotlib for drawing, pylinkage and pygad. If you do not want to use Pygad, the built-in evolutive algorithms should be enough, even if less flexible.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for leggedsnake-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6701c889ddf918847d97225b1ed7e37acca813288d9761bc805a1924643f1c00 |
|
MD5 | 6c7666bf4fbe9a9c5d06062e620fb81a |
|
BLAKE2b-256 | c91738beca51b1c5de9f21d852e22e2ef9b724e84e75ba877be78b6304290035 |