{"id":17933649,"url":"https://github.com/keyan/ur_kinematics","last_synced_at":"2025-04-03T11:23:52.283Z","repository":{"id":87742758,"uuid":"228107870","full_name":"keyan/ur_kinematics","owner":"keyan","description":"universal robot kinematics control python-c++ bindings","archived":false,"fork":false,"pushed_at":"2019-12-15T06:54:30.000Z","size":129,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T00:42:36.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-15T00:23:54.000Z","updated_at":"2024-11-22T04:12:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"d57d9db0-6d97-411a-843a-121d3c49d123","html_url":"https://github.com/keyan/ur_kinematics","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/keyan%2Fur_kinematics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyan%2Fur_kinematics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyan%2Fur_kinematics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyan%2Fur_kinematics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyan","download_url":"https://codeload.github.com/keyan/ur_kinematics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246990424,"owners_count":20865468,"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":[],"created_at":"2024-10-28T21:41:03.077Z","updated_at":"2025-04-03T11:23:52.265Z","avatar_url":"https://github.com/keyan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage\n\nSee available make commands:\n```\nmake\n```\n\nBindings are written in Cython in `py_ur_kin.pyx`, then can be imported and used with:\n```\nimport py_ur_kin\n\npy_ur_kin.ur_forward(...)\npy_ur_kin.ur_inverse(...)\n```\n\n## Dependencies\n\nPython dependencies (ideally in a fresh virtualenv):\n```\npip install -r requirements.txt\n```\n\nActually building the bindings was tricky due to OpenMP support. Ultimately I was able to build on MacOSX-10 with `ggc-9` and the below OpenMP runtime. But I suspect reproducing on another machine may be difficult:\n```\nbrew install gcc-9\nbrew install libomp\n```\n\n## Design decisions\n\n1. Used Cython (vs. pybind or boost) because Cython's documentation looked easier to parse and was more friendly to Python programmers. Additionally the OpenMP parallization support appeared simple to use, although OpenMP was ultimately a bit of a pain.\n1. To support all UR models I instantiated a new struct for the model parameters and fetched the correct one on each function call then used that to create function local params. This is a little messy and I would have preferred passing around the struct, but I didn't want to modify more of the kinematic calculation code than I had too.\n1. Parallelization with Cython/OpenMP didn't produce great results. A GIL-enabled Python loop shows similar performance for forward kinematics calculations, while there is a more noticeable speedup for inverse calculations. Trying to increase the batch size enough to see an obvious benefit during forward calculations only led to machine memory exhaustion. The benchmark test occasionally fails because there is not a consistent speedup with increased threads used.\n\nWithout parallelization:\n```\ntest_kin.py Starting forward benchmark...\nThread count: 1, Speedup from last run: ~100.0%, Time: 0.3836228847503662\nThread count: 2, Speedup from last run: ~19.62%, Time: 0.3083679676055908\nThread count: 3, Speedup from last run: ~11.89%, Time: 0.271716833114624\nThread count: 4, Speedup from last run: ~13.36%, Time: 0.23540711402893066\nStarting inverse benchmark...\nThread count: 1, Speedup from last run: ~100.0%, Time: 2.4680662155151367\nThread count: 2, Speedup from last run: ~0.11%, Time: 2.4654102325439453\nThread count: 3, Speedup from last run: ~0.78%, Time: 2.4461629390716553\nThread count: 4, Speedup from last run: ~0.07%, Time: 2.4443681240081787\n```\n\nWith parallelization:\n```\ntest_kin.py Starting forward benchmark...\nThread count: 1, Speedup from last run: ~100.0%, Time: 0.3841521739959717\nThread count: 2, Speedup from last run: ~21.33%, Time: 0.3022170066833496\nThread count: 3, Speedup from last run: ~9.31%, Time: 0.2740669250488281\nThread count: 4, Speedup from last run: ~10.33%, Time: 0.24576401710510254\nStarting inverse benchmark...\nThread count: 1, Speedup from last run: ~100.0%, Time: 2.645191192626953\nThread count: 2, Speedup from last run: ~43.0%, Time: 1.507807970046997\nThread count: 3, Speedup from last run: ~16.96%, Time: 1.252027988433838\nThread count: 4, Speedup from last run: ~16.61%, Time: 1.0440778732299805\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyan%2Fur_kinematics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyan%2Fur_kinematics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyan%2Fur_kinematics/lists"}