DIY Walkers
  • Home
  • Walker ABC's
  • Build Instructions
    • TrotBot Builds >
      • TrotBot Linkage Plans
      • TrotBot's Legs Simplified
      • Quadruped TrotBot
      • Hexapod TrotBot
      • TrotBot
      • TrotBot, Ver 3
      • Mindstorms TrotBot, Ver 3
      • Wooden TrotBots by Automata Korea Design
      • 3D Printed TrotBot by Scott Anderson
      • Large-Scale TrotBot
    • Strider Builds >
      • Strider Linkage Plans
      • Strider Ver 3's Legs
      • Strider Ver 3's Frame
      • Mindstorms Strider Ver 3 Mod
      • Strider
      • Strider's Legs Simplified (ver 2's)
      • RC Strider
    • Mechanical Spider >
      • Klann's Linkage Plans
      • Klann Mechanical Spider - Climbing Mod
      • Klann's Spider, EV3 Long Legs
      • Klann High-Step Mod
      • Klann's Spider, Ver 2
      • Mindstorms Klann
    • Strandbeest
    • LEGO Spot Micro
    • Linkage Warm Ups >
      • Lever Paradox
      • LEGO Biters
      • LEGO Punchers (4 bar linkage warm-up)
      • LEGO Hopping Robot
    • Hiro Labo
    • Whegs (wheel-legs)
  • Customize
    • 4 Bar Linkage Optimizer
    • Strider Linkage Optimizer
    • Klann Linkage Optimizer
    • Strandbeest Optimizer for LEGO
    • TrotBot Optimizer
    • 4 Bar Walking Linkage
    • 6 Bar Walking Linkage
  • Linkage Simulation
    • Python Linkage Simulator
    • Scratch Linkage Simulator
  • Blog

Animating Linkages with Python 

....and Matplotlib's Animation Function

Sam Korman from Team TrotBot put his Python skills to work to improve our simulators, and shares his code below.  For those who are not that experienced with Python, Sam included many useful comments in his code.
Picture
TrotBot simulated by Sam Korman

​​First, here's Sam's simplest script that animates TrotBot in place.
trotbot_stationary.zip
File Size: 3 kb
File Type: zip
Download File

​Here's a slightly more complicated version with TrotBot moving across the screen:
trotbot_moving.zip
File Size: 3 kb
File Type: zip
Download File


Here's the python code for simulating  TrotBot, Klann, Strandbeest,and Strider that generated the video above (updated on 1-22-2024).   You can find the joint and bar maps for each mechanism on its Linkage Optimizer page.   Note:  this code was copy/pasted from 4 separate sims, so it's a bit sloppy and is not as streamlined as Sam's code, FYI
trotbot_strider_strandbeest_and_klann_ver_3.zip
File Size: 5 kb
File Type: zip
Download File


Finally, here's the python code for simulating Klann's Mechanical Spider (updated on 12-20-2018), which makes it easier to switch from Klann's patented linkage configuration to our LEGO approximation of Klann Ver 2. 
klann_mechanical_spider_ver_2.zip
File Size: 3 kb
File Type: zip
Download File


​​​In the below video of our LEGO approximation, Klann's linkage was animated in place by setting the "moving" variable to "False" (or you can simply set its average speed to zero).  Also, you can find the joint and bar maps used in this Klann simulator here, which the python script now matches. 
​

The algorithms, and how we used them to simulate linkages, are described here.
Picture
​  
​
  • Home
  • Walker ABC's
  • Build Instructions
    • TrotBot Builds >
      • TrotBot Linkage Plans
      • TrotBot's Legs Simplified
      • Quadruped TrotBot
      • Hexapod TrotBot
      • TrotBot
      • TrotBot, Ver 3
      • Mindstorms TrotBot, Ver 3
      • Wooden TrotBots by Automata Korea Design
      • 3D Printed TrotBot by Scott Anderson
      • Large-Scale TrotBot
    • Strider Builds >
      • Strider Linkage Plans
      • Strider Ver 3's Legs
      • Strider Ver 3's Frame
      • Mindstorms Strider Ver 3 Mod
      • Strider
      • Strider's Legs Simplified (ver 2's)
      • RC Strider
    • Mechanical Spider >
      • Klann's Linkage Plans
      • Klann Mechanical Spider - Climbing Mod
      • Klann's Spider, EV3 Long Legs
      • Klann High-Step Mod
      • Klann's Spider, Ver 2
      • Mindstorms Klann
    • Strandbeest
    • LEGO Spot Micro
    • Linkage Warm Ups >
      • Lever Paradox
      • LEGO Biters
      • LEGO Punchers (4 bar linkage warm-up)
      • LEGO Hopping Robot
    • Hiro Labo
    • Whegs (wheel-legs)
  • Customize
    • 4 Bar Linkage Optimizer
    • Strider Linkage Optimizer
    • Klann Linkage Optimizer
    • Strandbeest Optimizer for LEGO
    • TrotBot Optimizer
    • 4 Bar Walking Linkage
    • 6 Bar Walking Linkage
  • Linkage Simulation
    • Python Linkage Simulator
    • Scratch Linkage Simulator
  • Blog