APM:Libraries
AP_BattMonitor_UAVCAN.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <AP_UAVCAN/AP_UAVCAN.h>
4 #include "AP_BattMonitor.h"
6 
7 #define AP_BATTMONITOR_UAVCAN_TIMEOUT_MICROS 5000000 // sensor becomes unhealthy if no successful readings for 5 seconds
8 
10 {
11 public:
12 
15  };
16 
19 
21  void read() override;
22 
23  void init() override;
24 
25  bool has_current() const override {
26  return true;
27  }
28 
29  void handle_bi_msg(float voltage, float current, float temperature) override;
30 
31 protected:
33 };
AP_BattMonitor_UAVCAN(AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, BattMonitor_UAVCAN_Type type, AP_BattMonitor_Params &params)
Constructor.
bool has_current() const override
returns true if battery monitor instance provides current info
BattMonitor_UAVCAN_Type _type
float temperature
Definition: Airspeed.cpp:32
void init() override
float voltage
void read() override
Read the battery voltage and current. Should be called at 10hz.
void handle_bi_msg(float voltage, float current, float temperature) override