mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 00:58:37 -04:00
AP_RangeFinder: added get_primary() API
This commit is contained in:
parent
afe2c31ae7
commit
703ef0ca0e
@ -113,6 +113,10 @@ public:
|
||||
|
||||
#define _RangeFinder_STATE(instance) state[instance]
|
||||
|
||||
uint8_t get_primary(void) const {
|
||||
return primary_instance;
|
||||
}
|
||||
|
||||
uint16_t distance_cm(uint8_t instance) const {
|
||||
return (instance<num_instances? _RangeFinder_STATE(instance).distance_cm : 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user