17 #ifndef _GAZEBO_BATTERY_HH_
18 #define _GAZEBO_BATTERY_HH_
50 public std::enable_shared_from_this<Battery>
64 public:
virtual void Load(sdf::ElementPtr _sdf);
67 public:
virtual void Init();
71 public:
virtual void UpdateParameters(
const sdf::ElementPtr _sdf);
75 public: std::string Name()
const;
79 public: uint32_t AddConsumer();
85 public:
bool RemoveConsumer(
const uint32_t _consumerId);
91 public:
bool SetPowerLoad(
const uint32_t _consumerId,
92 const double _powerLoad);
98 public:
bool PowerLoad(
const uint32_t _consumerId,
99 double &_powerLoad)
const;
107 public:
double Voltage()
const;
116 public:
void SetUpdateFunc(
117 std::function<
double (
const BatteryPtr &)> _updateFunc);
122 public:
void Update();
125 protected:
void InitConsumers();
130 private:
double UpdateDefault(
const BatteryPtr &_battery);
#define GZ_COMMON_VISIBLE
Definition: system.hh:84
std::shared_ptr< Battery > BatteryPtr
Definition: CommonTypes.hh:144
std::map< uint32_t, double > PowerLoad_M
Typedef the powerload map.
Definition: Battery.hh:54
A battery abstraction.
Definition: Battery.hh:49
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Definition: BatteryPrivate.hh:32