diff --git a/README.md b/README.md index 5f7e576..0cd8e40 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ [![](https://img.shields.io/badge/Buy%20me%20-coffee!-orange.svg?logo=buy-me-a-coffee&color=795548)](https://ko-fi.com/minimithi) -[![Build Status](https://travis-ci.com/mithi/hexapod-robot-simulator.svg?branch=master)](https://travis-ci.com/github/mithi/hexapod-robot-simulator) +[![Build Status](https://travis-ci.com/mithi/hexapod-robot-simulator.svg?branch=master)](https://travis-ci.com/github/mithi/hexapod-robot-simulator) [![codecov](https://codecov.io/gh/mithi/hexapod-robot-simulator/branch/master/graph/badge.svg)](https://codecov.io/gh/mithi/hexapod-robot-simulator) [![Code Climate](https://codeclimate.com/github/mithi/hexapod-robot-simulator/badges/gpa.svg)](https://codeclimate.com/github/mithi/hexapod-robot-simulator) [![](https://img.shields.io/codeclimate/tech-debt/mithi/hexapod-robot-simulator)](https://codeclimate.com/github/mithi/hexapod-robot-simulator/trends/technical_debt) [![HitCount](https://hits.dwyl.com/mithi/hexapod-robot-simulator.svg)](https://hits.dwyl.com/mithi/hexapod-robot-simulator) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE) -[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -[![PRs welcome!](https://img.shields.io/badge/contributions-welcome-orange.svg?style=flat)](https://github.com/mithi/hexapod-robot-simulator/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![PRs welcome!](https://img.shields.io/badge/contributions-welcome-orange.svg?style=flat)](https://github.com/mithi/hexapod-robot-simulator/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) [![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blueviolet.svg?style=flat)](https://www.firsttimersonly.com/) # Mithi's Hexapod Robot Simulator @@ -20,7 +20,7 @@ # Announcement -You might be interested in checking out my [rewrite in Javascript](http://github.com/mithi/hexapod), live at: https://hexapod.netlify.app/ , which is like 10000000x faster. If you'd like tobuild you're own user interface with Node, you can download the algorithm alone as a package in the npm registry: [Hexapod Kinematics Library](https://github.com/mithi/hexapod-kinematics-library). There is also [a "fork" modified where you can use the app to control a physical hexapod robot](https://github.com/mithi/hexapod-irl) as you can see in the gif below. +You might be interested in checking out my [rewrite in Javascript](http://github.com/mithi/hexapod), live at: https://hexapod.netlify.app/ , which is like 10000000x faster. If you'd like to build you're own user interface with Node, you can download the algorithm alone as a package in the npm registry: [Hexapod Kinematics Library](https://github.com/mithi/hexapod-kinematics-library). There is also [a "fork" modified where you can use the app to control a physical hexapod robot](https://github.com/mithi/hexapod-irl) as you can see in the gif below.

drawing @@ -50,9 +50,9 @@ You might be interested in checking out my [rewrite in Javascript](http://github ## Requirements - [x] Python 3.8.1 -- [x] Plotly Dash 1.10.0 -- [x] Plotly Dash Daq 0.4.0 -- [x] Numpy 1.18.1 +- [x] Plotly Dash 1.18.1 +- [x] Plotly Dash Daq 0.5.0 +- [x] Numpy 1.19.5 - [x] See also [./requirements.txt](./requirements.txt) ## Run @@ -65,42 +65,14 @@ Running on http://127.0.0.1:8050/ - Modify default settings with [./settings.py](./settings.py) - Dark Mode is the default - modify page styles with [./style_settings.py](./style_settings.py) -## ⚠️ Known Issues - -- [ ] ❗[Good First Issue](https://github.com/mithi/hexapod-robot-simulator/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) -- [ ] ❗[Help Wanted](https://github.com/mithi/hexapod-robot-simulator/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) -- [ ] ❗[Bugs](https://github.com/mithi/hexapod-robot-simulator/issues?q=is%3Aissue+is%3Aopen+label%3Abug) -- [ ] ❗[All](https://github.com/mithi/hexapod-robot-simulator/issues) - ## Screenshots | ![Kinematics](https://mithi.github.io/robotics-blog/v2-kinematics-screenshot.png)| |---| | ![IK](https://mithi.github.io/robotics-blog/v2-ik-screenshot.png)| -## Conventions and Algorithms - -- Definitions - - [`Linkage`](./hexapod/linkage.py) - - [`VirtualHexapod`](./hexapod/models.py) -- The [Inverse Kinematics Algorithm](./hexapod/ik_solver/README.md) 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](./hexapod/ground_contact_solver/ground_contact_solver.py) when we know which of the three points of each leg could contact the ground - - [Algorithm 2](./hexapod/ground_contact_solver/ground_contact_solver2.py) 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](./hexapod/ik_solver/recompute_hexapod.py) -- How to determine if the hexapod should twist and by how much - - [`find_if_might_twist`](./hexapod/models.py#L248) - - [`find_twist_frame`](./hexapod/models.py#L273) - -## 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. - -- 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 Inverse Kinematics algorithm](./hexapod/ik_solver/README.md) and [orientation algorithm](./hexapod/ground_contact_solver) is just something I came up with based on what I remember back in college plus browsing through the [Mathematics Stack Exchange](https://math.stackexchange.com/). 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](https://assetstore.unity.com/packages/tools/animation/fast-ik-139972) or [ROS IKFast](http://wiki.ros.org/Industrial/Tutorials/Create_a_Fast_IK_Solution). - -- Don't be mean! [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://www.contributor-covenant.org/) +## More Information +Check the [Wiki](https://github.com/mithi/hexapod-robot-simulator/wiki/Notes) for more additional information ## 🤗 Contributors diff --git a/hexapod/ik_solver/helpers.py b/hexapod/ik_solver/helpers.py index 46bb0b4..d9f06e0 100644 --- a/hexapod/ik_solver/helpers.py +++ b/hexapod/ik_solver/helpers.py @@ -16,7 +16,7 @@ def cant_reach_alert_msg(leg_name, problem): - msg = f"Cannot reach target ground point.\n" + msg = "Cannot reach target ground point.\n" if problem == "femur": msg += f"Femur length of {leg_name} leg is too long." if problem == "tibia": diff --git a/index.py b/index.py index a32e6ce..3a96923 100644 --- a/index.py +++ b/index.py @@ -74,6 +74,7 @@ ROOT_PATH: page_landing.layout, } + # .................... # Callback to display page given URL # .................... diff --git a/pages/helpers.py b/pages/helpers.py index 14118f3..a04a8dd 100644 --- a/pages/helpers.py +++ b/pages/helpers.py @@ -10,7 +10,7 @@ ) NEW_POSES = deepcopy(BASE_POSE) -POSES_MSG_HEADER = f""" +POSES_MSG_HEADER = """ +----------------+------------+------------+------------+ | leg name | coxia | femur | tibia | +----------------+------------+------------+------------+""" @@ -53,7 +53,7 @@ def load_params(params_json, params_type): raise Exception( f'params_type must be "dims", "pose" or "ik", not {params_type}' - ) + ) from e return params diff --git a/requirements.txt b/requirements.txt index e57a5fc..dff6a0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,43 +1,30 @@ -appdirs==1.4.3 -astroid==2.3.3 -attrs==19.3.0 -black==19.10b0 -click==7.1.1 -dash==1.10.0 -dash-core-components==1.9.0 -dash-daq==0.4.0 -dash-html-components==1.0.3 -dash-renderer==1.3.0 -entrypoints==0.3 -flake8==3.7.9 +astroid==2.4.2 +Brotli==1.0.9 +click==7.1.2 +dash==1.18.1 +dash-core-components==1.14.1 +dash-daq==0.5.0 +dash-html-components==1.1.1 +dash-renderer==1.8.3 +dash-table==4.11.1 +flake8==3.8.4 Flask==1.1.2 -Flask-Compress==1.4.0 +Flask-Compress==1.8.0 future==0.18.2 gunicorn==20.0.4 -isort==4.3.21 +isort==5.7.0 itsdangerous==1.1.0 -Jinja2==2.11.1 +Jinja2==2.11.2 lazy-object-proxy==1.4.3 MarkupSafe==1.1.1 mccabe==0.6.1 -more-itertools==8.2.0 -numpy==1.18.2 -packaging==20.3 -pathspec==0.8.0 -pip-check-reqs-pip-gte-20==2.0.3.1 -plotly==4.6.0 -pluggy==0.13.1 -py==1.8.1 -pycodestyle==2.5.0 -pyflakes==2.1.1 -pylint==2.4.4 -pyparsing==2.4.7 -pytest==5.4.1 -regex==2020.4.4 +numpy==1.19.5 +plotly==4.14.1 +pycodestyle==2.6.0 +pyflakes==2.2.0 +pylint==2.6.0 retrying==1.3.3 -six==1.14.0 -toml==0.10.0 -typed-ast==1.4.1 -wcwidth==0.1.9 +six==1.15.0 +toml==0.10.2 Werkzeug==1.0.1 -wrapt==1.11.2 +wrapt==1.12.1 diff --git a/style_settings.py b/style_settings.py index 3528489..924b687 100644 --- a/style_settings.py +++ b/style_settings.py @@ -1,7 +1,7 @@ DARKMODE = True -DARK_CSS_PATH = "https://codepen.io/mithi-the-encoder/pen/BaoBOKa.css" -LIGHT_CSS_PATH = "https://codepen.io/mithi-the-encoder/pen/eYpObwK.css" +DARK_CSS_PATH = "https://mithi.github.io/hexapod-robot-simulator/dark.css" +LIGHT_CSS_PATH = "https://mithi.github.io/hexapod-robot-simulator/light.css" EXTERNAL_STYLESHEETS = [DARK_CSS_PATH] if not DARKMODE: