Battery

HRIM defines a battery as
A smart a container consisting of one or more cells, in which chemical energy is converted into electricity and used as a source of power

So, apart from the common requirements (ID, Status, Power, Specs and Simulation, detailed in HRIM component model section), all battery will contain a topic referring to the power consumption.

HRIM component model: Battery
URI XML MODEL ABSTRACTION CLASS
M/O
SHORT DESCRIPTION
/hrim_power_battery_<instance_id>/id generic/id.xml topic
(Pub)
M Component identification.
/hrim_power_battery_<instance_id>/status generic/status.xml topic
(Pub)
M How the module is working.
/hrim_power_battery_<instance_id>/power generic/power.xml topic
(Pub)
M Describes the power supply type and give the information about the module power consumption.
/hrim_power_battery_<instance_id>/specs_comm generic/specs_comm.xml topic
(Pub)
M Published the capabilities in term of communicaction that the component offers.
/hrim_power_battery_<instance_id>/state_comm generic/state_comm.xml topic
(Pub)
M Published the resources that the component is using at the moment.
/hrim_power_battery_<instance_id>/module_3d generic/module_3d.xml topic
(Pub)
M Ask for the 3D model of the HRIM component.
/hrim_power_battery_<instance_id>/module_urdf generic/module_urdf.xml topic
(Pub)
M Ask for the information of the HRIM component's 3D model.
/hrim_power_battery_<instance_id>/specs power/battery/topics/specs.xml topic
(Pub)
M Device features.
/hrim_power_battery_<instance_id>/level power/battery/topics/level.xml topic
(Pub)
M The report about the ramaining battery percentage.
/hrim_power_battery_<instance_id>/status_battery power/battery/topics/statusBattery.xml topic
(Pub)
O The status of the battery.
Parameters
PARAMETER NAME DATA TYPE UNIT CLASS
M/O
SHORT DESCRIPTION
battery_low int % O Capacity percentage at first warning.
battery_critical int % O Capacity percentage at critical level.

Note: the {BASE} wildcard references the base topics all modules contain, defined in the HRIM component model page.

The XML notation would look like:

<?xml version="1.0"?>
<module name="battery" type="power" description="defines the messages to interact with batteries">
  <mandatory>

    {BASE}

    <topic name="specs" type="publish" description="device features" fileName="SpecsBattery">
      <property name="header" type="header" fileName="Header">
        <property name="time" type="time" fileName="Time">
          <property name="sec" type="int32" unit="second">
            <value></value>
          </property>
          <property name="nanosec" type="uint32" unit="nanosecond">
            <value></value>
          </property>
        </property>
        <property name="frame_id" type="string" description="transform frame with which this data is associated">
          <value></value>
        </property>
      </property>
      <property name="battery_type" type="uint8" unit="enum" enum='{"BATTERY_NICD" : 1, "BATTERY_NIMH" : 2, "BATTERY_LIFEPO" : 3, "BATTERY_LIPO" : 4, "BATTERY_LIION" : 5}'>
        <value></value>
      </property>
      <property name="voltage" type="float32" unit="volt">
        <value></value>
      </property>
      <property name="current" type="float32" unit="ampere">
        <value></value>
      </property>
      <property name="capacity" type="int32" unit="milliampere per hour">
        <value></value>
      </property>
      <property name="working_temp" type="int32[]" unit="celsius" description="working temperature range">
        <value></value>
      </property>
      <property name="cells" type="uint8" description="number of cells">
        <value></value>
      </property>
      <property name="cell_voltage" type="float32" unit="volt" description="voltage per cell">
        <value></value>
      </property>
      <property name="charge_voltage" type="float32" unit="volt" description="charge cut-off voltage">
        <value></value>
      </property>
      <property name="charge_current" type="float32" unit="ampere" description="charge cut-off current">
        <value></value>
      </property>
      <property name="discharge_voltage" type="float32" unit="volt" description="discharge cut-off voltage">
        <value></value>
      </property>
      <property name="impedance" type="int32" unit="milliohm">
        <value></value>
      </property>
    </topic>

    <topic name="level" type="publish" description="report about the ramaining battery percentage" fileName="BatteryLevel">
      <property name="header" type="header" fileName="Header">
        <property name="time" type="time" fileName="Time">
          <property name="sec" type="int32" unit="second">
            <value></value>
          </property>
          <property name="nanosec" type="uint32" unit="nanosecond">
            <value></value>
          </property>
        </property>
        <property name="frame_id" type="string" description="transform frame with which this data is associated">
          <value></value>
        </property>
      </property>
      <property name="battery_level" type="float32" unit="percentage" description="remaining battery capacity">
        <value></value>
      </property>
    </topic>

  </mandatory>
  <optional>

    <topic name="status_battery" type="publish" description="status of the battery" fileName="BatteryStatus">
      <property name="header" type="header" fileName="Header">
        <property name="time" type="time" fileName="Time">
          <property name="sec" type="int32" unit="second">
            <value></value>
          </property>
          <property name="nanosec" type="uint32" unit="nanosecond">
            <value></value>
          </property>
        </property>
        <property name="frame_id" type="string" description="transform frame with which this data is associated">
          <value></value>
        </property>
      </property>
      <property name="battery_status" type="uint8" unit="enum" enum='{"CHARGE_COMPLETED" : 0 , "BATTERY_LOW" : 1 , "BATTERY_CRITICAL" : 2}' description="status of the battery">
        <value></value>
      </property>
      <property name="power_consumption" type="float32" description="can only be calculated if not charging">
        <value></value>
      </property>
      <property name="relative_remaining_capacity" type="float32" unit="percentage" description="percent of maximum capacity">
        <value></value>
      </property>
      <property name="remaining_capacity" type="float32" unit="ampere per hour">
        <value></value>
      </property>
      <property name="charging" type="boolean" description="flag if robot is connected to external power or NOT">
        <value></value>
      </property>
      <property name="time_remaining_charging" type="float32" unit="hour" description="estimated time to empty or fully charged">
        <value></value>
      </property>
    </topic>

    <param name="battery_low" type="int" unit="percentage" description="capacity percentage at first warning">
      <value></value>
    </param>

    <param name="battery_critical" type="int" unit="percentage" description="capacity percentage at critical level">
      <value></value>
    </param>

  </optional>
</module>