Gazebo Sim

API Reference

8.7.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...
 

Additional Inherited Members

- Public Types inherited from System
using PriorityType = int32_t
 Signed integer type used for specifying priority of the execution order of PreUpdate and Update phases. More...
 
- Static Public Attributes inherited from System
constexpr static PriorityType kDefaultPriority = {0}
 Default priority value for execution order of the PreUpdate and Update phases. More...
 
constexpr static std::string_view kPriorityElementName
 Name of the XML element from which the priority value will be parsed. More...
 

Detailed Description

A plugin for simulating battery usage.

System 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 Gazebo 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()

~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: