mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 08:13:35 +08:00
Remove duplicite data from RPM message and enable logging of RPM message
This commit is contained in:
@@ -127,15 +127,13 @@ void PCF8583::RunImpl()
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
float indicated_frequency = (float)diffCount / _param_pcf8583_magnet.get() / ((float)diffTime / 1000000);
|
||||
float estimated_accurancy = 1 / (float)_param_pcf8583_magnet.get() / ((float)diffTime / 1000000);
|
||||
float indicated_rpm = (float)diffCount / _param_pcf8583_magnet.get() / ((float)diffTime / 1000000) * 60.f;
|
||||
float estimated_accurancy = 1 / (float)_param_pcf8583_magnet.get() / ((float)diffTime / 1000000) * 60.f;
|
||||
|
||||
// publish
|
||||
rpm_s msg{};
|
||||
msg.indicated_frequency_hz = indicated_frequency;
|
||||
msg.indicated_frequency_rpm = indicated_frequency * 60.f;
|
||||
msg.estimated_accurancy_hz = estimated_accurancy;
|
||||
msg.estimated_accurancy_rpm = estimated_accurancy * 60.f;
|
||||
msg.indicated_frequency_rpm = indicated_rpm;
|
||||
msg.estimated_accurancy_rpm = estimated_accurancy;
|
||||
msg.timestamp = hrt_absolute_time();
|
||||
_rpm_pub.publish(msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user