Add accel to vehicle_local_position_groundtruth

Related Issue: #18527 
According to [this doc](https://github.com/mavlink/c_library_v2/blob/92b1a43468e8737da2d4cc1e72304e6443dcfdd3/common/mavlink_msg_hil_state_quaternion.h#L102), the *acc value are mili-Gee, so multiply the value with `CONSTANT_ONE_G/1000.0f` would get the acceleration in `m/s`.
This commit is contained in:
wangwwno1
2021-10-28 15:11:09 +08:00
committed by JaeyoungLim
parent 505f963dd0
commit 6e2060ddb6
@@ -562,6 +562,9 @@ 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);
hil_lpos.ax = hil_state.xacc * CONSTANTS_ONE_G / 1000.0f;
hil_lpos.ay = hil_state.yacc * CONSTANTS_ONE_G / 1000.0f;
hil_lpos.az = hil_state.zacc * CONSTANTS_ONE_G / 1000.0f;
hil_lpos.heading = euler.psi();
hil_lpos.xy_global = true;
hil_lpos.z_global = true;