Misleading #define statements in action_node and rotation_node
Some #define statements include math operators but have no parentheses, so with a define like below we can have some issues. For example:
#define rotation_speed_max M_PI/6
. Pre-processor will replace rotation_speed_max
with M_PI/6
, so if you use that variable in some computation, it may not do what you initially think:
#define rotation_speed_max M_PI/6
...
float rotation_speed = some_value;
float myvar = rotation_speed / rotation_speed_max;
after pre-processor:
float myvar = rotation_speed / M_PI/6;
So it computes it following usual operator priority, so it computes (rotation_speed / M_PI) / 6 , probably NOT what we were expecting when writing that define.
Suggestion: change all such defines by adding parentheses around them, and make them ALL CAPS to remember they're defines:
#define ROTATION_SPEED_MAX (M_PI/6)