Giter Site home page Giter Site logo

Comments (5)

jgillis avatar jgillis commented on July 20, 2024

This looks weird.
Failing to reproduce since my Eigen installation is not happy with using casadi::SX as template argument for Quaternion.

Can you report back what these print:

casadi::uout() << sum << std::endl;
casadi::uout() << grad << std::endl;
casadi::uout() << quat_casadi << std::endl;

from casadi.

modu-robotics avatar modu-robotics commented on July 20, 2024

Sorry for the confusion.
I realized that I was using some private implementation defined in other third party library (https://github.com/stack-of-tasks/pinocchio/blob/pinocchio3-preview/src/autodiff/casadi/math/quaternion.hpp).
Since this issue is not reproducible, I will close the issue.

Just for my education purpose, if I see no viable conversion from 'casadi::Matrix<casadi::SXElem>' to 'bool' if (t > Scalar(0)) kind of issue, do I have two options - (1) reimplement the expression with SX or (2) use custom Callback? Or is there any other workaround?

from casadi.

jgillis avatar jgillis commented on July 20, 2024

I'm still interested in seeing those outputs; it's still a bug of some sort. Flow control like this is not supported. You could specialize to use if_else with SX instead.

from casadi.

modu-robotics avatar modu-robotics commented on July 20, 2024

Thanks!
Here is the output

sum
@1=1, @2=2, @3=(@2*quat_1), @4=(@3*quat_1), @5=(@2*quat_2), @6=(@5*quat_2), @7=(@1-(@4+@6)), @8=(@2*quat_0), @9=(@8*quat_0), @10=(@1-(@9+@6)), @11=(@1-(@9+@4)), @12=(@7+(@10+@11)), @13=(0<@12), @14=(@5*quat_1), @15=(@8*quat_3), @16=(@14+@15), @17=(@14-@15), @18=0.5, @19=sqrt((@12+@1)), @20=(@18/@19), @21=(@7<@10), @22=((@21&&(@10<@11))||(@7<@11)), @23=(@5*quat_0), @24=(@3*quat_3), @25=(@23+@24), @26=(@23-@24), @27=sqrt((((@11-@7)-@10)+@1)), @28=(@18/@27), @29=(@3*quat_0), @30=(@5*quat_3), @31=(@29-@30), @32=(@29+@30), @33=sqrt((((@10-@11)-@7)+@1)), @34=(@18/@33), @35=sqrt((((@7-@10)-@11)+@1)), @36=(@18/@35), (((((@13?((@16-@17)*@20):0)+((!@13)?((@22?((@25+@26)*@28):0)+((!@22)?((@21?((@31+@32)*@34):0)+((!@21)?(@18*@35):0)):0)):0))+((@13?((@25-@26)*@20):0)+((!@13)?((@22?((@17+@16)*@28):0)+((!@22)?((@21?(@18*@33):0)+((!@21)?((@32+@31)*@36):0)):0)):0)))+((@13?((@32-@31)*@20):0)+((!@13)?((@22?(@18*@27):0)+((!@22)?((@21?((@16+@17)*@34):0)+((!@21)?((@26+@25)*@36):0)):0)):0)))+((@13?(@18*@19):0)+((!@13)?((@22?((@32-@31)*@28):0)+((!@22)?((@21?((@25-@26)*@34):0)+((!@21)?((@16-@17)*@36):0)):0)):0)))
grad
@1=2, @2=(@1*quat_1), @3=1, @4=(@2*quat_1), @5=(@1*quat_2), @6=(@5*quat_2), @7=(@3-(@4+@6)), @8=(@1*quat_0), @9=(@8*quat_0), @10=(@3-(@9+@6)), @11=(@7<@10), @12=(@3-(@9+@4)), @13=((@11&&(@10<@12))||(@7<@12)), @14=(@7+(@10+@12)), @15=(0<@14), @16=(!@15), @17=0.5, @18=sqrt((((@12-@7)-@10)+@3)), @19=(@17/@18), @20=sqrt((@14+@3)), @21=(@17/@20), @22=(!@11), @23=(!@13), @24=(!@15), @25=sqrt((((@7-@10)-@12)+@3)), @26=(@17/@25), @27=(!@13), @28=(!@15), @29=sqrt((((@10-@12)-@7)+@3)), @30=(@17/@29), @31=((((@13?(@16?@19:0):0)+(@15?@21:0))+(@22?(@23?(@24?@26:0):0):0))+(@11?(@27?(@28?@30:0):0):0)), @32=((((@13?(@16?(-@19):0):0)+(@15?(-@21):0))+(@22?(@23?(@24?@26:0):0):0))+(@11?(@27?(@28?@30:0):0):0)), @33=(@31+@32), @34=(!@13), @35=(!@11), @36=(!@13), @37=(!@15), @38=((((@11?(@34?(@16?(-@30):0):0):0)+(@35?(@36?(@37?@26:0):0):0))+(@15?(-@21):0))+(@13?(@28?@19:0):0)), @39=((((@11?(@34?(@16?@30:0):0):0)+(@35?(@36?(@37?@26:0):0):0))+(@15?@21:0))+(@13?(@28?@19:0):0)), @40=(@38+@39), @41=(@5*quat_0), @42=(@2*quat_3), @43=(@41+@42), @44=(@41-@42), @45=(@5*quat_1), @46=(@8*quat_3), @47=(@45+@46), @48=(@45-@46), @49=(@2*quat_0), @50=(@5*quat_3), @51=(@49-@50), @52=(@49+@50), @53=(((@23?(@24?@17:0):0)-((@30/@29)*(((@34?(@16?(@43-@44):0):0)+(@36?(@37?(@47+@48):0):0))+(@27?(@28?(@51+@52):0):0))))/(@29+@29)), @54=(!@11), @55=((((!@11)?(@27?(@28?@17:0):0):0)-((@26/@25)*(((@54?(@34?(@16?(@47-@48):0):0):0)+(@35?(@36?(@37?(@44+@43):0):0):0))+(@22?(@23?(@24?(@52+@51):0):0):0))))/(@25+@25)), @56=(((@37?@17:0)-((@19/@18)*(((@16?(@52-@51):0)+(@24?(@48+@47):0))+(@28?(@43+@44):0))))/(@18+@18)), @57=((@17-((@21/@20)*(((@52-@51)+(@43-@44))+(@47-@48))))/(@20+@20)), @58=((((@11?(-@53):0)-@55)+(@13?@56:0))+(@15?@57:0)), @59=((((@11?@53:0)-@55)+(@13?(-@56):0))+(@15?@57:0)), @60=(@58+@59), @61=((((@54?(@34?(@16?@26:0):0):0)+(@11?(@36?(@37?@30:0):0):0))+(@13?(@24?@19:0):0))+(@15?@21:0)), @62=((((@54?(@34?(@16?(-@26):0):0):0)+(@11?(@36?(@37?@30:0):0):0))+(@13?(@24?@19:0):0))+(@15?(-@21):0)), @63=(@61-@62), @64=(@62+@61), @65=(((@55+(@11?(-@53):0))+(@13?(-@56):0))+(@15?@57:0)), @66=(@58+@65), @67=(@39-@38), @68=(@31-@32), @69=(@59+@65), [((((@2*@33)+(@5*@40))-(@8*@60))+(@1*((quat_3*@63)-(quat_0*@60)))), (((@5*@64)-(@2*@66))+(@1*(((quat_0*@33)+(quat_3*@67))-(quat_1*@66)))), ((@1*((((quat_3*@68)+(quat_0*@40))+(quat_1*@64))-(quat_2*@69)))-(@5*@69)), (((@5*@68)+(@2*@67))+(@8*@63))]
quat_casadi
[quat_0, quat_1, quat_2, quat_3]

from casadi.

jgillis avatar jgillis commented on July 20, 2024

I see, it must be #1878

from casadi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.