spatial-casadi
Spatial transformation library for CasADi Python.
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.2%) to scientific vocabulary
Keywords
Repository
Spatial transformation library for CasADi Python.
Basic Info
- Host: GitHub
- Owner: cmower
- License: lgpl-3.0
- Language: Python
- Default Branch: master
- Homepage: https://cmower.github.io/spatial-casadi/
- Size: 311 KB
Statistics
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
README.md
spatial-casadi
This package implements various data structures and helper methods for manipulating spatial transformations using CasADi variables in Python. The library interface is partially based on the Scipy spatial module.
- Code: https://github.com/cmower/spatial-casadi
- Documentation: https://cmower.github.io/spatial-casadi/
- PyPI: https://pypi.org/project/spatial-casadi
- Issues: https://github.com/cmower/spatial-casadi/issues
Examples
There are three main data structures: Rotation, Translation, and Transformation. The following showcases some of the main functionality of the library.
```
import spatialcasadi as sc import casadi as cs cs.np.random.seed(10) euler = cs.SX.sym("euler", 3) sc.Rotation.fromeuler('xyz', euler).asquat() SX(@1=2, @2=cos((x2/@1)), @3=cos((x1/@1)), @4=sin((x0/@1)), @5=(@3@4), @6=sin((x2/@1)), @7=cos((x0/@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))]) r = sc.Rotation.random() r.asquat() DM([0.615982, 0.330883, -0.71489, -0.0038783]) r.asrotvec() DM([-1.9304, -1.03694, 2.24037]) r.asmatrix() DM( [[-0.241103, 0.40209, -0.883285], [0.41318, -0.781003, -0.468312], [-0.878152, -0.477867, 0.0221665]]) r.aseuler('xyz') DM([-1.52444, 1.07199, 2.09902]) r.asmrp() DM([-0.613602, -0.329604, 0.712128]) sc.Rotation.fromeuler('x', 90, degrees=True).asmatrix() DM( [[1, 0, 0], [0, 2.22045e-16, -1], [0, 1, 2.22045e-16]]) r1 = sc.Rotation.random() r1.asquat() DM([0.625459, -0.724863, 0.267273, 0.109269]) r2 = sc.Rotation.random() r2.asquat() DM([0.00332548, -0.1353, 0.335557, 0.932247]) (r1 * r2).asquat() DM([0.376374, -0.899524, 0.203617, -0.0879736]) ```
Install
From PyPI
shell
$ pip install spatial-casadi
$ pip install spatial-casadi[test] # if you want to run the test scripts
From source
In a new terminal:
1. Clone repository:
- (ssh) $ git clone git@github.com:cmower/spatial-casadi.git, or
- (https) $ git clone https://github.com/cmower/spatial-casadi.git
2. Change directory: $ cd spatial-casadi
3. Ensure pip is up-to-date: $ python -m pip install --upgrade pip
3. Install from source:
- (main library) $ pip install .
- (when you want to also run the test scripts) $ pip install .[test]
Running the test scripts
- Install
spatial-casadifrom source and ensure you install thetestpackages (see previous section). - Change directory:
$ cd /path/to/spatial-casadi - Run tests:
pytest
Build documentation
The documentation is hosted here. However, if you want to build it yourself, then follow these steps.
In a new terminal:
1. Clone repository:
- (ssh) $ git clone git@github.com:cmower/spatial-casadi.git, or
- (https) $ git clone https://github.com/cmower/spatial-casadi.git
2. Change directory: $ cd spatial-casadi/doc
3. Install doxygen: $ sudo apt install doxygen
4. Build documentation: $ doxygen
5. View documentation:
- In a browser, open html/index.html
- Build pdf (requires LaTeX)
- $ cd latex
- $ make
- Open the file called refman.pdf
Citing
If you use spatial-casadi in your work, please consider citing the following.
bibtex
@software{Mower2023
title = "Spatial CasADi: A Compact Library for Manipulating Spatial Transformations",
author = "Christopher E. Mower",
year = "2023",
url = {https://github.com/cmower/spatial-casadi},
}
Contributing
If you have any issues with the library, or find inaccuracies in the documentation please raise an issue. I am happy to consider new features if you fork the library and submit a pull request.
Owner
- Name: Chris Mower
- Login: cmower
- Kind: user
- Location: London, UK
- Company: Huawei Technologies R&D
- Website: https://cmower.github.io/
- Repositories: 55
- Profile: https://github.com/cmower
Senior Research Scientist at Huawei Technologies R&D.
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use `spatial_casadi` in your work, please consider citing the following." authors: - family-names: "Mower" given-names: "Christopher E." title: "Spatial CasADi: A Compact Library for Manipulating Spatial Transformations" url: "https://github.com/cmower/spatial-casadi" date-released: 2023-03-13
GitHub Events
Total
- Watch event: 10
- Push event: 3
- Pull request event: 1
- Fork event: 1
- Create event: 1
Last Year
- Watch event: 10
- Push event: 3
- Pull request event: 1
- Fork event: 1
- Create event: 1
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Christopher E. Mower | c****r@k****k | 89 |
| Chris Mower | c****r | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 2
- Total pull requests: 2
- Average time to close issues: about 2 months
- Average time to close pull requests: less than a minute
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.5
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- edxmorgan (1)
- cmower (1)
Pull Request Authors
- edxmorgan (2)
- cmower (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v2.3.4 composite
- ad-m/github-push-action v0.6.0 composite
- casadi *