mirror of https://github.com/ArduPilot/ardupilot
AP_RangeFinder: add quality to Blue Robotics Ping1D driver
This commit is contained in:
parent
fd4da61067
commit
494b3076ac
|
@ -83,6 +83,15 @@ bool AP_RangeFinder_BLPing::get_reading(float &reading_m)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool AP_RangeFinder_BLPing::get_signal_quality_pct(int8_t &quality_pct) const
|
||||
{
|
||||
if (status() != RangeFinder::Status::Good) {
|
||||
return false;
|
||||
}
|
||||
quality_pct = protocol.get_confidence();
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t PingProtocol::get_confidence() const
|
||||
{
|
||||
return msg.payload[4];
|
||||
|
|
|
@ -133,6 +133,13 @@ public:
|
|||
*/
|
||||
void update(void) override;
|
||||
|
||||
/**
|
||||
* @brief Get the reading confidence
|
||||
* 100 is best quality, 0 is worst
|
||||
*
|
||||
*/
|
||||
bool get_signal_quality_pct(int8_t &quality_pct) const override WARN_IF_UNUSED;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Return the sensor type
|
||||
|
|
Loading…
Reference in New Issue