Update src/modules/simulator/simulator_mavlink.cpp

Co-authored-by: JaeyoungLim <jalim@ethz.ch>
This commit is contained in:
wangwwno1 2021-11-11 17:31:41 +08:00 committed by JaeyoungLim
parent 160fec5f25
commit b2c5919d29
1 changed files with 2 additions and 0 deletions

View File

@ -565,6 +565,8 @@ void Simulator::handle_message_hil_state_quaternion(const mavlink_message_t *msg
hil_lpos.vy = hil_state.vy / 100.0f;
hil_lpos.vz = hil_state.vz / 100.0f;
matrix::Eulerf euler = matrix::Quatf(hil_attitude.q);
matrix::Vector3f acc(hil_state.xacc / 1000.f, hil_state.yacc / 1000.f, hil_state.zacc / 1000.f);
acc = matrix::Quatf(hil_state.attitude_quaternion).conjugate(acc);
hil_lpos.ax = acc(0);
hil_lpos.ay = acc(1);
hil_lpos.az = acc(2);