symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.41k stars 145 forks source link

Matrix exponential #327

Open bresch opened 1 year ago

bresch commented 1 year ago

Is your feature request related to a problem? Please describe. Hi, I would need to discretize a symbolic matrix using a matrix exponential. In the past I used the exp function of sympy and expm of Matlab to achieve that but I didn't find the SymForce equivalent.

If I try to use exp in Symforce, I'm getting TypeError: Cannot convert symengine.lib.symengine_wrapper.MutableDenseMatrix to symengine.lib.symengine_wrapper.Basic

I've made a python example here: https://colab.research.google.com/drive/1x1BN-DUQb8F9rMvE0oCUSt8zosEnxUZj?usp=sharing

Describe the solution you'd like An exp function for square matrices

Describe alternatives you've considered Converting the SymForce symbolic matrix to Sympy and use the sympy implementation.