mithi/hexapod-robot-simulator
A simple browser-based hexapod robot simulator built from first principles
repo name | mithi/hexapod-robot-simulator |
repo link | https://github.com/mithi/hexapod-robot-simulator |
homepage | |
language | Python |
size (curr.) | 2348 kB |
stars (curr.) | 484 |
created | 2020-02-14 |
license | MIT License |
β
π·οΈ Mithi’s Hexapod Robot Simulator
- A bare minimum browser-based hexapod robot simulator built from first principles π·οΈ
- If you like this project, consider buying me a few β cups of coffee. π
STATUS | FEATURE | DESCRIPTION |
---|---|---|
π | Forward Kinematics | Given the angles of each joint, what does the robot look like? |
π | Inverse Kinematics | What are the angles of each joint to make the robot look the way I want? Is it even possible? Why or why not? |
π | Uniform Movements | If all of the legs behaved the same way, how will the hexapod robot as a whole behave? |
π | Customizability | Set the dimensions and shape of the robot’s body and legs. (6 parameters) |
π | Usability | Control the camera view, pan, tilt, zoom, whatever. |
π | Simplicity | Minimal dependencies. Depends solely on Numpy for calculations. Uses only Plotly Dash for plotting, Dash can be safely replaced if a better 3d plotting library is available. |
β | Stability Check (WIP) | If we pose the robot in a particular way, will it fall over? |
β | Fast | Okay, it’s not as fast as I wanted, but when run locally, it’s okay |
β | Bug-free | Fine, right now there’s still room for improvement |
β | Well-tested | Yeah, I need to compile test cases first |
π·οΈ Preview
π·οΈ Requirements
- Python 3.8.1
- Plotly Dash 1.10.0
- Plotly Dash Daq 0.4.0
- Numpy 1.18.1
- See also ./requirements.txt
π·Run
$ python index.py
Running on http://127.0.0.1:8050/
- Modify default settings with ./settings.py
- Dark Mode is the default - modify page styles with ./style_settings.py
β οΈ Known Issues
- βPriority
- βGood First Issue
- βHelp Wanted
- βBugs
- βAll
π·οΈConventions and Algorithms
- Definitions
- The Inverse Kinematics Algorithm used for this project
- How to find the orientation of the hexapod with respect to the ground given we know all the orientations of the six legs with respect to the robot’s body.
- Algorithm 1 when we know which of the three points of each leg could contact the ground
- Algorithm 2 when we don’t know which of points of which legs could be in contact with the ground
- How to make the hexapod step on the correct target ground contacts
- How to determine if the hexapod should twist and by how much
π·οΈ Screenshots
π·οΈ Notes
-
Now live on https://hexapod-robot-simulator.herokuapp.com ! BUT (and a big one) I highly suggest that you run it locally. When run locally, it’s pretty speedy! On the other hand, the link above is barely usable. Might convert this to to be a fully client-side Javascript app later, maybe?
-
This implementation uses matrices, NOT quaternions. I’m aware that quaternions is far superior in every single way. In the (un)forseeable future, maybe?
-
Honestly, My IK algorithm is just something I came up with based on what I remember back in college plus browsing through the Mathematics Stack Exchange. It’s just the most intuitive that I can think of. If you want something closer to the state-of-the-art, maybe checkout Unity’s Fast IK or ROS IKFast.
-
I believe that the idea that it’s best if we are kind to one another shouldn’t be controversial. And I shouldn’t be afraid to say that.