{"id":17334260,"url":"https://github.com/cmower/spatial-casadi","last_synced_at":"2025-04-14T18:14:02.378Z","repository":{"id":142523066,"uuid":"613095315","full_name":"cmower/spatial-casadi","owner":"cmower","description":"Spatial transformation library for CasADi Python.","archived":false,"fork":false,"pushed_at":"2024-10-24T10:52:58.000Z","size":318,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T07:33:32.557Z","etag":null,"topics":["3d","casadi","euler-angles","homogeneous-transformations","math","python","quaternion","robot","rotation-matrix"],"latest_commit_sha":null,"homepage":"https://cmower.github.io/spatial-casadi/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-12T21:26:21.000Z","updated_at":"2025-03-25T14:00:07.000Z","dependencies_parsed_at":"2025-04-13T07:33:40.714Z","dependency_job_id":null,"html_url":"https://github.com/cmower/spatial-casadi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmower%2Fspatial-casadi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmower%2Fspatial-casadi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmower%2Fspatial-casadi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmower%2Fspatial-casadi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmower","download_url":"https://codeload.github.com/cmower/spatial-casadi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248680912,"owners_count":21144695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","casadi","euler-angles","homogeneous-transformations","math","python","quaternion","robot","rotation-matrix"],"created_at":"2024-10-15T15:05:34.234Z","updated_at":"2025-04-14T18:14:02.343Z","avatar_url":"https://github.com/cmower.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/cmower/spatial-casadi/master/doc/image/spatial-casadi.png\" width=\"60\" align=\"right\"\u003e\n\u003c/p\u003e\n\n# spatial-casadi\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nThis package implements various data structures and helper methods for manipulating spatial transformations using [CasADi](https://web.casadi.org/) variables in Python.\nThe library interface is partially based on the [Scipy spatial module](https://docs.scipy.org/doc/scipy/reference/spatial.html).\n\n\n- Code: [https://github.com/cmower/spatial-casadi](https://github.com/cmower/spatial-casadi)\n- Documentation: [https://cmower.github.io/spatial-casadi/](https://cmower.github.io/spatial-casadi/)\n- PyPI: [https://pypi.org/project/spatial-casadi](https://pypi.org/project/spatial-casadi/)\n- Issues: [https://github.com/cmower/spatial-casadi/issues](https://github.com/cmower/spatial-casadi/issues)\n\n# Examples\n\nThere are three main data structures: [Rotation](https://cmower.github.io/spatial-casadi/classspatial__casadi_1_1spatial_1_1Rotation.html), [Translation](https://cmower.github.io/spatial-casadi/classspatial__casadi_1_1spatial_1_1Translation.html), and [Transformation](https://cmower.github.io/spatial-casadi/classspatial__casadi_1_1spatial_1_1Transformation.html).\nThe following showcases some of the main functionality of the library.\n\n```\n\u003e\u003e\u003e import spatial_casadi as sc\n\u003e\u003e\u003e import casadi as cs\n\u003e\u003e\u003e cs.np.random.seed(10)\n\u003e\u003e\u003e euler = cs.SX.sym(\"euler\", 3)\n\u003e\u003e\u003e sc.Rotation.from_euler('xyz', euler).as_quat()\nSX(@1=2, @2=cos((x_2/@1)), @3=cos((x_1/@1)), @4=sin((x_0/@1)), @5=(@3*@4), @6=sin((x_2/@1)), @7=cos((x_0/@1)), @8=sin((x_1/@1)), @9=(@7*@8), @10=(@3*@7), @11=(@8*@4), [((@2*@5)-(@6*@9)), ((@2*@9)+(@6*@5)), ((@10*@6)-(@2*@11)), ((@2*@10)+(@6*@11))])\n\u003e\u003e\u003e r = sc.Rotation.random()\n\u003e\u003e\u003e r.as_quat()\nDM([0.615982, 0.330883, -0.71489, -0.0038783])\n\u003e\u003e\u003e r.as_rotvec()\nDM([-1.9304, -1.03694, 2.24037])\n\u003e\u003e\u003e r.as_matrix()\nDM(\n[[-0.241103, 0.40209, -0.883285],\n [0.41318, -0.781003, -0.468312],\n [-0.878152, -0.477867, 0.0221665]])\n\u003e\u003e\u003e r.as_euler('xyz')\nDM([-1.52444, 1.07199, 2.09902])\n\u003e\u003e\u003e r.as_mrp()\nDM([-0.613602, -0.329604, 0.712128])\n\u003e\u003e\u003e sc.Rotation.from_euler('x', 90, degrees=True).as_matrix()\nDM(\n[[1, 0, 0],\n [0, 2.22045e-16, -1],\n [0, 1, 2.22045e-16]])\n\u003e\u003e r1 = sc.Rotation.random()\n\u003e\u003e\u003e r1.as_quat()\nDM([0.625459, -0.724863, 0.267273, 0.109269])\n\u003e\u003e r2 = sc.Rotation.random()\n\u003e\u003e\u003e r2.as_quat()\nDM([0.00332548, -0.1353, 0.335557, 0.932247])\n\u003e\u003e\u003e (r1 * r2).as_quat()\nDM([0.376374, -0.899524, 0.203617, -0.0879736])\n```\n\n# Install\n\n## From PyPI\n\n```shell\n$ pip install spatial-casadi\n$ pip install spatial-casadi[test] # if you want to run the test scripts\n```\n\n## From source\n\nIn a new terminal:\n1. Clone repository:\n   - (ssh) `$ git clone git@github.com:cmower/spatial-casadi.git`, or\n   - (https) `$ git clone https://github.com/cmower/spatial-casadi.git`\n2. Change directory: `$ cd spatial-casadi`\n3. Ensure `pip` is up-to-date: `$ python -m pip install --upgrade pip`\n3. Install from source:\n   - (main library) `$ pip install .`\n   - (when you want to also run the test scripts) `$ pip install .[test]`\n\n# Running the test scripts\n\n1. Install `spatial-casadi` from source and ensure you install the `test` packages (see previous section).\n2. Change directory: `$ cd /path/to/spatial-casadi`\n3. Run tests: `pytest`\n\n# Build documentation\n\nThe documentation is hosted [here](https://cmower.github.io/spatial-casadi/).\nHowever, if you want to build it yourself, then follow these steps.\n\nIn a new terminal:\n1. Clone repository:\n   - (ssh) `$ git clone git@github.com:cmower/spatial-casadi.git`, or\n   - (https) `$ git clone https://github.com/cmower/spatial-casadi.git`\n2. Change directory: `$ cd spatial-casadi/doc`\n3. Install doxygen: `$ sudo apt install doxygen`\n4. Build documentation: `$ doxygen`\n5. View documentation:\n   - In a browser, open `html/index.html`\n   - Build pdf (requires LaTeX)\n\t - `$ cd latex`\n\t - `$ make`\n\t - Open the file called `refman.pdf`\n\n# Citing\n\nIf you use `spatial-casadi` in your work, please consider citing the following.\n\n```bibtex\n@software{Mower2023\n  title = \"Spatial CasADi: A Compact Library for Manipulating Spatial Transformations\",\n  author = \"Christopher E. Mower\",\n  year = \"2023\",\n  url = {https://github.com/cmower/spatial-casadi},\n}\n```\n\n# Contributing\n\nIf you have any issues with the library, or find inaccuracies in the documentation please [raise an issue](https://github.com/cmower/spatial-casadi/issues/new/choose).\nI am happy to consider new features if you [fork the library](https://github.com/cmower/spatial-casadi/fork) and submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmower%2Fspatial-casadi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmower%2Fspatial-casadi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmower%2Fspatial-casadi/lists"}