Closed plancherb1 closed 2 years ago
Hi @plancherb1! You just need to cast your input model as follows and similarly to Eigen:
CodeGenRNEA<T> rnea_code_gen(model.cast<T>());
I've closed the issue as the issue seems to be solved. Feel free to reopen it if needed
Hi, I've been trying to use the code generation features and have found that for some reason I can only get them to support a
Scalar
of typedouble
. Is there any way to get them to accept aScalar
of typefloat
?For example setting the type parameter
T
in the below code snippet todouble
works fine, but setting it tofloat
results in a compilation error stating that there is:no matching constructor for initialization of 'CodeGenRNEA<float>
which is I think caused by this other error:note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'pinocchio::Model' (aka 'ModelTpl<double>') to 'const pinocchio::CodeGenRNEA<float>' for 1st argument struct CodeGenRNEA : public CodeGenBase<_Scalar>
.Thanks in advance, I assume I am missing something simple!