You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where if (normCrossProduct < MX(1e-8)) the following error occurs in this part:
error: invalid user-defined conversion from ‘casadi::MX’ to ‘bool’ [-fpermissive]
49 | if (normCrossProduct < MX(1e-8))
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/local/include/casadi/core/core.hpp:44,
from /usr/local/include/casadi/casadi.hpp:29,
from /home/harco/roboe_ws/src/casADi_motion_planner/include/nmpc_motion_planner/collisions.hpp:2,
from /home/harco/roboe_ws/src/casADi_motion_planner/src/nmpc_planner.cpp:6:
/usr/local/include/casadi/core/mx.hpp:257:14: note: candidate is: ‘casadi::MX::operator double() const’ (near match)
257 | explicit operator double() const;
| ^~~~~~~~
/usr/local/include/casadi/core/mx.hpp:257:14: note: return type ‘double’ of explicit conversion function cannot be converted to ‘bool’ with a qualification conversion
Can't I use casadi::MX type as logical conditions in a traditional if-else statement? If so, how should I solve my problem?
The text was updated successfully, but these errors were encountered:
hello. I want to apply different algorithms depending on the value of data of type casadi::MX.
My code is below.
where
if (normCrossProduct < MX(1e-8))
the following error occurs in this part:Can't I use casadi::MX type as logical conditions in a traditional if-else statement? If so, how should I solve my problem?
The text was updated successfully, but these errors were encountered: