I am reading some code and I found the following expression:
Eigen::Matrix< simFloat, 3, 1> rpyTorque(kp_att*(_tkCommands.roll - rpy(0)) - kd_att*(rpyRate(0)),
kp_att*(_tkCommands.pitch - rpy(1)) - kd_att*(rpyRate(1)),
_kp_yaw*(_tkCommands.yaw - rpyRate(2)));
I want just to know if this allocates the variable rpyTorque or something else. My question comes from the thing that I would have done it in this way:
Eigen::Matrix< simFloat, 3, 1> rpyTorque =
(kp_att*(_tkCommands.roll - rpy(0)) - kd_att*(rpyRate(0)),
kp_att*(_tkCommands.pitch - rpy(1)) - kd_att*(rpyRate(1)),
p_yaw*(_tkCommands.yaw - rpyRate(2)));
Which is the difference between the 2 solutions? If there is any of course.
Thanks for your help.