uzh-rpg / flightmare

An Open Flexible Quadrotor Simulator
https://uzh-rpg.github.io/flightmare/
Other
965 stars 340 forks source link

Question on Dynamics equation #135

Open huiyulhy opened 3 years ago

huiyulhy commented 3 years ago

Hi, there is a section of code in quadrotor,cpp in the following lines to calculate the quadrotor acceleration. How does the multiplication of state.q() * force work since state.q() returns Vector<4> and force has dimensions Vector<3>?

Is there any text/references to compute the final product for that particular line?

// Compute linear acceleration and body torque const Vector<3> force(0.0, 0.0, force_torques[0]); state_.a = state_.q() * force * 1.0 / dynamics_.getMass() + gz_ - state_.v * state_.v.norm() * dynamics_.drag_coeff_;

slimeth commented 3 years ago

https://stackoverflow.com/a/50512245 Eigen does some magic in the background @huiyulhy