facebookincubator / momentum

A library for human kinematic motion and numerical optimization solvers to apply human motion

Home Page:https://facebookincubator.github.io/momentum/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Momentum

CI Windows CI macOS CI Ubuntu Publish Website

Momentum provides foundational algorithms for human kinematic motion and numerical optimization solvers to apply human motion in various applications.

Forward and Inverse Kinematics with Interpretable Parameterization RGBD Body Tracking Solver Monocular RGB Body Tracking Solver

Getting Started

This page guides you through the process of building Momentum and running the examples.

Installing Momentum and PyMomentum

Momentum binary builds are available for Windows, macOS, and Linux via Pixi or the Conda package manager.

For Windows, please install Visual Studio 2022 or greater.

Pixi

# Momentum (C++)
pixi add momentum-cpp

# PyMomentum (Python)
pixi add pymomentum

# Both
pixi add momentum

Conda

conda install -c conda-forge momentum-cpp
conda install -c conda-forge pymomentum # Windows is not supported yet
conda install -c conda-forge momentum

Building Momentum from Source

Prerequisite

Complete the following steps only once:

  1. Install Pixi by following the instructions on https://prefix.dev/

  2. Clone the repository and navigate to the root directory:

    git clone https://github.com/facebookincubator/momentum
    cd momentum
    

    Ensure that all subsequent commands are executed in the project's root directory unless specified otherwise.

Build and Test

  • Build the project with the following command (note that the first run may take a few minutes as it installs all dependencies):

    pixi run build
    
  • Run the tests with:

    pixi run test
    

To view all available command lines, run pixi task list.

Hello World Example

To run the hello_world example:

pixi run hello_world

Alternatively, you can directly run the executable:

# Linux and macOS
./build/hello_world

# Windows
./build/Release/hello_world.exe

Running Other Examples

To run other examples:

pixi run glb_viewer --help

For more examples, please refer to the Examples page.

Clean Up

If you need to start over for any reason:

pixi run clean

Momentum uses the build/ directory for CMake builds, and .pixi/ for the Pixi virtual environment. You can clean up everything by either manually removing these directories or by running the command above.

FBX support (Windows only)

To load and save Autodesk's FBX file format, you need to install the FBX SDK 2019.2 from Autodesk's website or this direct link first. After installing the SDK, you can build with MOMENTUM_BUILD_IO_FBX=ON:

# Powershell
$env:MOMENTUM_BUILD_IO_FBX = "ON"; pixi run <target>

# cmd
set MOMENTUM_BUILD_IO_FBX=ON && pixi run <target>

For example, file conversion can be run as follows:

# Powershell
$env:MOMENTUM_BUILD_IO_FBX = "ON"; pixi run convert_model -d <input.glb> -o <out.fbx>

# cmd
set MOMENTUM_BUILD_IO_FBX=ON && pixi run convert_model -d <input.glb> -o <out.fbx>

📖 Documentation

The full documentation for Momentum can be found on our website and the C++ API documentation is available here.

Contributing

Check our contributing guide to learn about how to contribute to the project.

License

Momentum is licensed under the MIT License. A copy of the license can be found here.

About

A library for human kinematic motion and numerical optimization solvers to apply human motion

https://facebookincubator.github.io/momentum/

License:MIT License


Languages

Language:C++ 95.7%Language:CMake 1.8%Language:Python 1.2%Language:Starlark 0.7%Language:JavaScript 0.3%Language:C 0.2%Language:CSS 0.1%Language:Objective-C++ 0.1%Language:Shell 0.1%