erwincoumans / tiny-differentiable-simulator

Tiny Differentiable Simulator is a header-only C++ and CUDA physics library for reinforcement learning and robotics with zero dependencies.
Apache License 2.0
1.23k stars 130 forks source link

Code Generation Tool Question #205

Closed simon-lc closed 1 year ago

simon-lc commented 2 years ago

Hello Erwin,

This is an amazing package! I am just curious to know the code generation tool you used to generate dynamics models such as this one: https://github.com/erwincoumans/tiny-differentiable-simulator/blob/master/examples/environments/omp_model_ant_forward_zero.h

Thanks a lot for your help! Cheers, Simon

erwincoumans commented 1 year ago

Thanks Simon. We used cppad-codegen to generate the code. You can try to use the build_libs* scripts to enable cppad and cppad-codegen.

simon-lc commented 1 year ago

Thanks Erwin! This is super helpful!

Huzaifg commented 1 year ago

Hi! This is a great package!

I had a quick question related to this. Do you have any example scrips showing how you generated these models with CppAD and CppADCodeGen? Looking through differentiation.hpp, it seems like you provide functors in the template argument when you call compile. I was wondering if you have any examples showing how this is used on a model level.

Best Huzaifa