00001 // 00002 // Created by tom on 09/05/16. 00003 // 00004 00005 #ifndef ROBOTICAN_HARDWARE_INTERFACE_BATTERY_H 00006 #define ROBOTICAN_HARDWARE_INTERFACE_BATTERY_H 00007 00008 #include <ric_board/Battery.h> 00009 #include <robotican_hardware_interface/Device.h> 00010 #include <robotican_hardware_interface/ros_utils.h> 00011 #include <robotican_hardware_interface/RiCBoardManager.h> 00012 00013 namespace robotican_hardware { 00014 class Battery : public Device { 00015 private: 00016 float _voltageDividerRatio; 00017 float _max; 00018 float _min; 00019 float _currentRead; 00020 byte _batteryPin; 00021 ros::Publisher _pub; 00022 00023 00024 00025 public: 00026 Battery(byte id, float voltageDividerRatio, float max, float min, byte batteryPin, 00027 TransportLayer *transportLayer); 00028 00029 virtual void deviceAck(const DeviceAck *ack); 00030 00031 virtual void update(const DeviceMessage *deviceMessage); 00032 00033 virtual void write(); 00034 00035 virtual void buildDevice(); 00036 }; 00037 } 00038 00039 00040 #endif //ROBOTICAN_HARDWARE_INTERFACE_BATTERY_H