mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 09:53:33 +08:00
RPM: clean up message
This commit is contained in:
@@ -196,12 +196,10 @@ void PCF8583::RunImpl()
|
||||
|
||||
// Calculate RPM and accuracy estimation
|
||||
float indicated_rpm = (((float)diffCount / _param_pcf8583_magnet.get()) / ((float)diffTime / 1e6f)) * 60.f;
|
||||
float estimated_accurancy = 1 / (float)_param_pcf8583_magnet.get() / ((float)diffTime / 1e6f) * 60.f;
|
||||
|
||||
// publish data to uorb
|
||||
rpm_s msg{};
|
||||
msg.indicated_frequency_rpm = indicated_rpm;
|
||||
msg.estimated_accurancy_rpm = estimated_accurancy;
|
||||
msg.rpm_estimate = indicated_rpm;
|
||||
msg.timestamp = hrt_absolute_time();
|
||||
_rpm_pub.publish(msg);
|
||||
|
||||
|
||||
@@ -66,8 +66,7 @@ int rpm_simulator_main(int argc, char *argv[])
|
||||
|
||||
// prpepare RPM data message
|
||||
rpm.timestamp = timestamp_us;
|
||||
rpm.indicated_frequency_rpm = frequency;
|
||||
rpm.estimated_accurancy_rpm = frequency / 100.0f;
|
||||
rpm.rpm_estimate = frequency;
|
||||
|
||||
// Publish data and let the user know what was published
|
||||
rpm_pub.publish(rpm);
|
||||
|
||||
Reference in New Issue
Block a user