{ "info": { "author": "Ian Danforth", "author_email": "iandanforth@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# MuscledAgents\nOpenAI Gym MuJoCo environments rigged with muscles which can be used with\n[PyMuscle](http://github.com/iandanforth/pymuscle) fatigable muscle models.\n\n\n\n## Prerequisites\n\n - MuJoCo 1.5\n - mujoco-py\n - gym\n\n## Setup\n\n```\npython setup.py develop\n```\n\n## Usage\n\n```python\nimport gym\nimport muscledagents\nimport math\n\n\ndef main():\n\n # Load a muscled ant\n env = gym.make(\"MuscledAnt-v0\") # Only functional env at the moment\n env.reset()\n\n print(\"Observation Space Dims\", env.observation_space.shape)\n print(\"Action Space Dims\", env.action_space.shape)\n\n action_size = env.action_space.shape[0]\n\n action = [0.0] * action_size\n total_steps = 60 * 10\n for i in range(total_steps):\n action[1] = ((math.sin(i / 25) + 1) / 2)\n action[5] = ((math.sin(i / 35) + 1) / 2)\n action[9] = ((math.sin(i / 45) + 1) / 2)\n action[13] = ((math.sin(i / 55) + 1) / 2)\n env.step(action)\n env.render()\n\n\nif __name__ == '__main__':\n main()\n\n```\n\nTo explore these environments and models further you will need to understand\nhow input values get translated into final simulated movements.\n\n### Control Signals\n\nThe action space for an ant is continuous control over 16 muscles. For\neach of four legs there are four muscles. One leg extensor, one leg flexor,\nand two hip muscles which move the leg left and right (or forward and back\ndepending on your perspective.)\n\n### Gym Environment\n\nThe `step` method takes an array of 16 values which represent the input to\nthe fatigable muscle model for each muscle. Inputs should be in the range [0-1].\n\n### PyMuscle Fatigue\n\nAfter use muscles produce less force for the same level of input. So if you\nwere to send an input signal which recruited all motor units in a muscle\nconstantly for several seconds the output the model will return will rapidly\ndecrease. A period of light or no use is required for the muscle to recover.\n\n### MuJoCo Model\n\nEach tendon actuator is control limited to the range [-1.0, 0.0]. When a\nGeneral actuator is tied to a Tendon in MuJoCo negative values are the\nequivalent of contractions. Muscles cannot produce force in extension so no\npositive non-zero values are allowed.\n\nActuators have a `gainprm` which scales this input value. This is tuned to\na value of 100 to work with the mass of the ant and the resistances of opposing\ntendons.\n\n## Altering the Models\n\nDue to frustration editing XML files the `ant` model is generated by a python\nscript that uses the [mjcf](http://github.com/iandanforth/mjcf) library which \nI wrote to wrap MuJoCo xml elements in python classes. Note: This may\nbe replaced with the mjcf library from [dm_control](https://github.com/deepmind/dm_control/tree/master/dm_control/mjcf) in the future.\n\nYou can view and modify that script in `scripts/gen_ant.py`.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/iandanforth/muscledagents", "keywords": "", "license": "MIT + No Military Use", "maintainer": "", "maintainer_email": "", "name": "muscledagents", "package_url": "https://pypi.org/project/muscledagents/", "platform": "", "project_url": "https://pypi.org/project/muscledagents/", "project_urls": { "Homepage": "https://github.com/iandanforth/muscledagents" }, "release_url": "https://pypi.org/project/muscledagents/0.0.2/", "requires_dist": [ "gym", "pymuscle", "mujoco-py (<1.50.2,>=1.50.1)" ], "requires_python": ">=3.6.0", "summary": "Muscle rigged models and environments for machine learning experiments.", "version": "0.0.2" }, "last_serial": 4808313, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "1035a446d7a1ebda369e0b1d3afb8113", "sha256": "fe54b7dbe8cc5b0795e1d204efb09e59e92719ded387bf6db00ce9b2ce9fb880" }, "downloads": -1, "filename": "muscledagents-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1035a446d7a1ebda369e0b1d3afb8113", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 11647, "upload_time": "2019-02-11T22:44:22", "url": "https://files.pythonhosted.org/packages/20/af/06ec09e21a5f79ab4d1eedc8eff35bb508723b536472e2a7f2e88db700ed/muscledagents-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbf7306a2952b5c2c5cf0f09e4d446b2", "sha256": "751a2c761e9116851e5e41e18a4ae4874714f7eafc53daa7b0794540bacc7882" }, "downloads": -1, "filename": "muscledagents-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bbf7306a2952b5c2c5cf0f09e4d446b2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 9585, "upload_time": "2019-02-11T22:44:24", "url": "https://files.pythonhosted.org/packages/e3/e5/9d86ab638449ed13f6d628c536095702a89a4dab6d9a30214561b75e06db/muscledagents-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1035a446d7a1ebda369e0b1d3afb8113", "sha256": "fe54b7dbe8cc5b0795e1d204efb09e59e92719ded387bf6db00ce9b2ce9fb880" }, "downloads": -1, "filename": "muscledagents-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1035a446d7a1ebda369e0b1d3afb8113", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 11647, "upload_time": "2019-02-11T22:44:22", "url": "https://files.pythonhosted.org/packages/20/af/06ec09e21a5f79ab4d1eedc8eff35bb508723b536472e2a7f2e88db700ed/muscledagents-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbf7306a2952b5c2c5cf0f09e4d446b2", "sha256": "751a2c761e9116851e5e41e18a4ae4874714f7eafc53daa7b0794540bacc7882" }, "downloads": -1, "filename": "muscledagents-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bbf7306a2952b5c2c5cf0f09e4d446b2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 9585, "upload_time": "2019-02-11T22:44:24", "url": "https://files.pythonhosted.org/packages/e3/e5/9d86ab638449ed13f6d628c536095702a89a4dab6d9a30214561b75e06db/muscledagents-0.0.2.tar.gz" } ] }