symforce-org / symforce

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

Reverse lookup of generated sym::Keys #37

Open aaron-skydio opened 2 years ago

aaron-skydio commented 2 years ago

Maybe constexpr function?

constexpr const char* KeyToSymbol(const sym::Key& key) {
  if (key == Var::VAR1) {
  } else {
    return "INVALID";
  }
}

Add function to sym::Values to take this and print with the symbol names