Ignition Gazebo

API Reference

6.6.0
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 UpdateInfo &_info, 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/ignitionrobotics/ign-gazebo/issues/225.
  • <power_draining_topic> A topic that is used to start battery discharge. Any message on the specified topic will cause the batter 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.

Constructor & Destructor Documentation

◆ LinearBatteryPlugin()

Constructor.

◆ ~LinearBatteryPlugin()

~LinearBatteryPlugin ( )
override

Destructor.

Member Function Documentation

◆ Configure()

void Configure ( const Entity _entity,
const std::shared_ptr< const sdf::Element > &  _sdf,
EntityComponentManager _ecm,
EventManager _eventMgr 
)
finalvirtual

Configure the system.

Parameters
[in]_entityThe entity this plugin is attached to.
[in]_sdfThe SDF Element associated with this system plugin.
[in]_ecmThe EntityComponentManager of the given simulation instance.
[in]_eventMgrThe EventManager of the given simulation instance.

Implements ISystemConfigure.

◆ PostUpdate()

void PostUpdate ( const UpdateInfo _info,
const EntityComponentManager _ecm 
)
overridevirtual

Documentation inherited.

Implements ISystemPostUpdate.

◆ PreUpdate()

void PreUpdate ( const UpdateInfo _info,
EntityComponentManager _ecm 
)
overridevirtual

Documentation inherited.

Implements ISystemPreUpdate.

◆ Update()

void Update ( const UpdateInfo _info,
EntityComponentManager _ecm 
)
finalvirtual

Documentation inherited.

Implements ISystemUpdate.


The documentation for this class was generated from the following file: