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();
80 public: std::string
Name()
const;
97 const double _powerLoad);
104 double &_powerLoad)
const;
122 std::function<
double (
const BatteryPtr &)> _updateFunc);
135 private:
double UpdateDefault(
const BatteryPtr &_battery);
139 private: BatteryPrivate *dataPtr;
common
Definition FuelModelDatabase.hh:37
A battery abstraction.
Definition Battery.hh:51
void InitConsumers()
Initialize the list of consumers.
const PowerLoad_M & PowerLoads() const
Get list of power loads in watts.
virtual void Init()
Initialize.
std::string Name() const
Return the name of the battery.
virtual void ResetVoltage()
Reset the battery voltage to the initial value.
std::map< uint32_t, double > PowerLoad_M
Typedef the powerload map.
Definition Battery.hh:54
bool SetPowerLoad(const uint32_t _consumerId, const double _powerLoad)
Set consumer power load in watts.
void SetUpdateFunc(std::function< double(const BatteryPtr &)> _updateFunc)
Setup function to update voltage.
bool PowerLoad(const uint32_t _consumerId, double &_powerLoad) const
Get consumer power load in watts.
virtual ~Battery()
Destructor.
double Voltage() const
Get the real voltage in volts.
virtual void Load(sdf::ElementPtr _sdf)
Load the battery.
bool RemoveConsumer(const uint32_t _consumerId)
Remove a consumer.
void Update()
Update the battery.
virtual void UpdateParameters(const sdf::ElementPtr _sdf)
Update the parameters using new sdf values.
uint32_t AddConsumer()
Create a unique consumer.
std::shared_ptr< Battery > BatteryPtr
Definition CommonTypes.hh:125
Forward declarations for the common classes.
Definition Animation.hh:27