LinearBatteryPlugin Class Reference
A plugin for simulating battery usage. More...
#include <LinearBatteryPlugin.hh>
Public Member Functions | |
LinearBatteryPlugin () | |
Constructor. More... | |
~LinearBatteryPlugin () override | |
Destructor. More... | |
void | Configure (const Entity &_entity, const std::shared_ptr< const sdf::Element > &_sdf, EntityComponentManager &_ecm, EventManager &_eventMgr) final |
Configure the system. More... | |
void | PostUpdate (const UpdateInfo &_info, const EntityComponentManager &_ecm) override |
Documentation inherited. More... | |
void | PreUpdate (const gz::sim::UpdateInfo &_info, gz::sim::EntityComponentManager &_ecm) override |
Documentation inherited. More... | |
void | Update (const UpdateInfo &_info, EntityComponentManager &_ecm) final |
Documentation inherited. More... | |
Public Member Functions inherited from System | |
System ()=default | |
Constructor. More... | |
virtual | ~System ()=default |
Destructor. More... | |
Detailed Description
A plugin for simulating battery usage.
This system processes the following sdf parameters:
<battery_name>
name of the battery (required)<voltage>
Initial voltage of the battery (required)<open_circuit_voltage_constant_coef>
Voltage at full charge<open_circuit_voltage_linear_coef>
Amount of voltage decrease when no charge<initial_charge>
Initial charge of the battery (Ah)<capacity>
Total charge that the battery can hold (Ah)<resistance>
Internal resistance (Ohm)<smooth_current_tau>
coefficient for smoothing current [0, 1].<power_load>
power load on battery (required) (Watts)<enable_recharge>
If true, the battery can be recharged<recharge_by_topic>
If true, the start/stop signals for recharging the battery will also be available via topics. The regular Ignition services will still be available.<charging_time>
Hours taken to fully charge the battery. (Required if<enable_recharge>
is set to true)<fix_issue_225>
True to change the battery behavior to fix some issues described in https://github.com/gazebosim/gz-sim/issues/225.<start_drainign>
Whether to start draining the battery right away. False by default.<power_draining_topic>
A topic that is used to start battery discharge. Any message on the specified topic will cause the battery to start draining. This element can be specified multiple times if multiple topics should be monitored. Note that this mechanism will start the battery draining, and once started will keep drainig.<stop_power_draining_topic>
A topic that is used to stop battery discharge. Any message on the specified topic will cause the battery to stop draining.
Constructor & Destructor Documentation
◆ LinearBatteryPlugin()
Constructor.
◆ ~LinearBatteryPlugin()
|
override |
Destructor.
Member Function Documentation
◆ Configure()
|
finalvirtual |
Configure the system.
- Parameters
-
[in] _entity The entity this plugin is attached to. [in] _sdf The SDF Element associated with this system plugin. [in] _ecm The EntityComponentManager of the given simulation instance. [in] _eventMgr The EventManager of the given simulation instance.
Implements ISystemConfigure.
◆ PostUpdate()
|
overridevirtual |
Documentation inherited.
Implements ISystemPostUpdate.
◆ PreUpdate()
|
overridevirtual |
Documentation inherited.
Implements ISystemPreUpdate.
◆ Update()
|
finalvirtual |
Documentation inherited.
Implements ISystemUpdate.
The documentation for this class was generated from the following file: