{"id":27996524,"url":"https://github.com/borglab/gtdynamics","last_synced_at":"2025-10-24T10:47:14.155Z","repository":{"id":37945826,"uuid":"289553140","full_name":"borglab/GTDynamics","owner":"borglab","description":"Full kinodynamics constraints for arbitrary robot configurations with factor graphs.","archived":false,"fork":false,"pushed_at":"2025-09-24T01:01:59.000Z","size":22825,"stargazers_count":48,"open_issues_count":25,"forks_count":12,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-09-24T02:32:07.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borglab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-22T19:26:13.000Z","updated_at":"2025-09-15T11:21:22.000Z","dependencies_parsed_at":"2024-10-23T02:34:36.302Z","dependency_job_id":"91407f75-bc43-48f2-ab3c-4e0d736deab5","html_url":"https://github.com/borglab/GTDynamics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/borglab/GTDynamics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borglab%2FGTDynamics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borglab%2FGTDynamics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borglab%2FGTDynamics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borglab%2FGTDynamics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borglab","download_url":"https://codeload.github.com/borglab/GTDynamics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borglab%2FGTDynamics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280783850,"owners_count":26390277,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-05-08T21:45:07.413Z","updated_at":"2025-10-24T10:47:14.149Z","avatar_url":"https://github.com/borglab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GTDynamics\n\n**\u003cspan style=“color:red”\u003eThis library is still under very active development, hence bleeding edge, and not \"supported\" in the way [GTSAM](https://gtsam.org) is. In particular, we are still actively re-factoring the way we deal with time and time intervals.\u003c/span\u003e**\n\n\n### *Full kinodynamics constraints for arbitrary robot configurations with factor graphs.*\n\n![Build Status](https://travis-ci.com/Alescontrela/GTDynamics.svg?token=V6isP7NT7qX4qsBuX1sY\u0026branch=master)\n\nGTDynamics is a library that allows the user to express the full kinodynamics constraints of an arbitrary robot configuration on a factor graph. These constraints can be used to solve the forward and inverse dynamics problems.\n\n## Dependencies\n\n* [GTSAM4](https://github.com/borglab/gtsam)\n* [gtwrap](https://github.com/borglab/wrap)\n* [sdformat15](https://github.com/osrf/sdformat)\n\n## Installing SDFormat\n\nGTDynamics uses the SDFormat parser to parse SDF/URDF files containing robot descriptions.\n\n### Homebrew\n\nUsing Homebrew is the easiest way to get SDFormat installed and it also makes switching versions straightforward.\n\n```sh\n$ # Install homebrew.\n$ /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n$ # Set up the tap and install sdformat15\n$ brew tap osrf/simulation\n$ brew install sdformat15\n```\n\n### Source\n\nAlternatively, you can install from source if you are on Linux or want more fine-tuned control.\n\nWe provide an Ubuntu-based process below. Please reference [this tutorial](http://gazebosim.org/tutorials?tut=install_dependencies_from_source) for complete details on installing from source.\n\n\n```sh\n# Install basic dependencies\nsudo apt-get install -y ruby-dev build-essential libboost-all-dev cmake pkg-config wget lsb-release\n\n# Setup the repo\nsh -c 'echo \"deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main\" \u003e /etc/apt/sources.list.d/gazebo-stable.list'\nwget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -\nsudo apt-get update\n\n# Install SDFormat dependencies\nsudo apt-get install -y libtinyxml2-dev liburdfdom-dev libgz-cmake2-dev libgz-tools-dev libgz-math6-dev\n\n# Set the version to install\nexport GTD_SDFormat_VERSION=\"15.0.0\"\n\n# Download specific version of SDFormat\nwget http://osrf-distributions.s3.amazonaws.com/sdformat/releases/sdformat-${GTD_SDFormat_VERSION}.tar.bz2\n\ntar -xvjf sdformat-${GTD_SDFormat_VERSION}.tar.bz2\n\ncd sdformat-${GTD_SDFormat_VERSION}\nmkdir build \u0026\u0026 cd build\n\ncmake -DCMAKE_INSTALL_PREFIX=../install ..\nmake -j4\nsudo make install\n```\n\n## Installing GTDynamics\n```sh\n$ git clone https://github.com/borglab/GTDynamics.git\n$ cd GTDynamics\n$ mkdir build; cd build\n# We can specify the install path with -DCMAKE_INSTALL_PREFIX\n# To compile with Python wrapper support, ensure that GTSAM was built with Python\n#   and use -DGTDYNAMICS_BUILD_PYTHON=ON\n$ cmake -DCMAKE_INSTALL_PREFIX=../install ..\n$ make\n$ sudo make install\n# Run make python-install for installation with Python\n```\n\n## Running Tests\n\n```sh\n$ make check\n```\n\n## Running Examples\n\nThe `examples` directory contains various full example projects demonstrating the use of GTDynamics for various robotic applications.\n\nWe recommend going through the examples to get a better understanding of how to use GTDynamics for your own use cases.\n\n*NOTE* The examples are made to run within the GTDynamics source folder and are not standalone projects.\n\n1. Build GTDynamics and navigate to the `build` folder:\n    ```sh\n    $ cd build\n    ```\n\n2. Run the example using:\n    ```sh\n    $ make example_XXX.run\n    ```\n    where `XXX` corresponds to the example name. Example names align with folder names in `examples`, but some of them have added suffixes.  For example, `make example_forward_dynamics.run` or `make example_spider_walking_forward`.\n\n3. Run the simulation using:\n    ```sh\n    $ make example_XXX.sim\n    ```\n    where `XXX` corresponds to the folder name in `examples`. For example, `make example_quadruped_mp.sim` or `make example_spider_walking.sim`. Make sure you have `pybullet` and `matplotlib` installed in your Python environment. \n\n## Including GTDynamics With CMake\n\nThe `examples/cmake_project_example` directory contains an example CMake-based project that demonstrates how to include GTDynamics in your application.\n\nUse this as a template when you want to set up your own project that uses GTDynamics (e.g. separate git repo, ROS, personal libraries, etc).\n\nTo build the project:\n\n1. Navigate to the example's subdirectory and create a build directory. e.g.\n    ```sh\n    cd GTDynamics/examples/cmake_project_example\n    mkdir build; cd build\n    ```\n\n2. Make the example.\n\n    If GTDynamics was installed to `~/JohnDoe/GTDynamics/install`, then run the cmake command with:\n\n    ```sh\n    cmake -DCMAKE_PREFIX_PATH=~/JohnDoe/GTDynamics/install ..\n    make\n    ```\n\n3. Run the example!\n    ```sh\n    ./example\n    ```\n\n## Python Wrapper (Recommended use case)\n\nGTDynamics now supports a Pybind11-based Python API.\n\nGTWrap comes bundled with GTSAM, which generates a corresponding GTSAM Python API. The same GTWrap package can be used to generate python bindings for GTDynamics (i.e. it is not necessary to manually install a separate GTWrap).\n\n**Note**: when using CMake, it is ideal for GTSAM and GTDynamics to have the same, *non* `/usr/local` prefix for installing packages. To update the CMake prefix from a system directory, use the flag `CMAKE_INSTALL_PREFIX=/path/to/install/dir` when running `cmake`.\n\nTo compile and install the GTDynamics python library:\n\n1. Ensure that GTSAM is built with generated python bindings. If not, go to the build directory and run `cmake` with the flag `GTSAM_BUILD_PYTHON=ON`. It is highly advised to specify a *non* `user/local` CMake prefix for installing packages. Afterwards, install the GTSAM python package.\n\n    ```sh\n    cmake -DGTSAM_BUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=/path/to/install/dir ..\n    make \u0026\u0026 make install \u0026\u0026 make python-install\n    ```\n\n2. In the GTDynamics build directory, run `cmake` with the flag `GTDYNAMICS_BUILD_PYTHON=ON`. It is highly advised for the GTDynamics CMake prefix to match the CMake prefix used for GTSAM. Again, use the `CMAKE_INSTALL_PREFIX=/path/to/install/dir` flag to specify the updated prefix.\n\n    ```sh\n    cmake -DGTDYNAMICS_BUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=/path/to/install/dir ..\n    ```\n\n3. Build as normal and install the python package.\n\n    ```sh\n    make \u0026\u0026 make python-install\n    ```\n\n4. To run the Python tests, you can simply run:\n\n    ```sh\n    make python-test\n    ```\n\n    You can also run individual test suites, e.g. with:\n\n    ```sh\n    make python-test.base\n    make python-test.cablerobot\n    ```\n\n## (Alternative) Python Wrapper installation\n\nIf preferred, GTWrap can be [downloaded and installed separately](https://github.com/borglab/wrap). Afterwards, follow the instructions above from step 2 for building and installing the GTDynamics python bindings.\n\n## Citing This Work\n\nPlease cite the following paper if you use this code as part of any published research:\n\n```\n@misc{2011.06194,\n    Author = {Mandy Xie, Alejandro Escontrela, and Frank Dellaert},\n    Title = {A Factor-Graph Approach for Optimization Problems with Dynamics Constraints},\n    Year = {2020},\n    Eprint = {arXiv:2011.06194},\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborglab%2Fgtdynamics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborglab%2Fgtdynamics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborglab%2Fgtdynamics/lists"}