mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 05:53:34 +08:00
sensor_combined cleanup: remove many unneeded fields
Decreases the message size from 780 to 280 bytes. In particular, all modules using sensor_combined must use the integral now. The sensor value can easily be reconstructed by dividing with dt. Voters now need to be moved into sensors module, because error count and priority is removed from the topic. Any module that requires additional data from a sensor can subscribe to the raw sensor topics. At two places, values are set to zero instead of subscribing to the raw sensors (with the assumption that no one reads them): - mavlink mavlink_highres_imu_t::abs_pressure - sdlog2: sensor temperatures
This commit is contained in:
@@ -1230,7 +1230,11 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi
|
||||
float eas2tas = 1.0f; // XXX calculate actual number based on current measurements
|
||||
|
||||
/* filter speed and altitude for controller */
|
||||
math::Vector<3> accel_body(_sensor_combined.accelerometer_m_s2);
|
||||
math::Vector<3> accel_body;
|
||||
float accel_dt = _sensor_combined.accelerometer_integral_dt[0] / 1.e6f;
|
||||
accel_body(0) = _sensor_combined.accelerometer_integral_m_s[0] / accel_dt;
|
||||
accel_body(1) = _sensor_combined.accelerometer_integral_m_s[1] / accel_dt;
|
||||
accel_body(2) = _sensor_combined.accelerometer_integral_m_s[2] / accel_dt;
|
||||
math::Vector<3> accel_earth = _R_nb * accel_body;
|
||||
|
||||
/* tell TECS to update its state, but let it know when it cannot actually control the plane */
|
||||
@@ -1703,7 +1707,7 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi
|
||||
}
|
||||
|
||||
/* Detect launch */
|
||||
launchDetector.update(_sensor_combined.accelerometer_m_s2[0]);
|
||||
launchDetector.update(accel_body(0));
|
||||
|
||||
/* update our copy of the launch detection state */
|
||||
launch_detection_state = launchDetector.getLaunchDetected();
|
||||
|
||||
Reference in New Issue
Block a user