Skip to main content

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 the Linkage 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leggedsnake-0.0.2.tar.gz (93.6 kB view hashes)

Uploaded Source

Built Distribution

leggedsnake-0.0.2-py3-none-any.whl (86.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page