battery.hpp
Go to the documentation of this file.
00001 
00009 /*****************************************************************************
00010 ** Ifdefs
00011 *****************************************************************************/
00012 
00013 #ifndef KOBUKI_BATTERY_HPP_
00014 #define KOBUKI_BATTERY_HPP_
00015 
00016 /*****************************************************************************
00017 ** Includes
00018 *****************************************************************************/
00019 
00020 #include <stdint.h>
00021 #include "../packets/core_sensors.hpp"
00022 
00023 /*****************************************************************************
00024 ** Namespaces
00025 *****************************************************************************/
00026 
00027 namespace kobuki {
00028 
00029 /*****************************************************************************
00030 ** Interfaces
00031 *****************************************************************************/
00032 
00039 class Battery {
00040 public:
00041   enum Source {
00042     None,
00043     Adapter,
00044     Dock
00045   };
00046   enum Level {
00047     Dangerous,
00048     Low,
00049     Healthy,
00050     Maximum
00051   };
00052   enum State {
00053     Discharging,
00054     Charged,
00055     Charging
00056   };
00057 
00058   Battery() {} 
00059   Battery (const uint8_t &new_voltage, const uint8_t &charger_flag);
00060   Level level() const;
00061   float percent() const;
00062 
00063   static double capacity, low, dangerous;
00064   double voltage;
00065   State charging_state;
00066   Source charging_source;
00067 };
00068 
00069 } // namespace kobuki
00070 
00071 #endif /* KOBUKI_BATTERY_HPP_ */


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Mon Oct 6 2014 01:31:09