namespace RobotNet10.Shared.Sensor;
///
/// BatteryState message (sensor_msgs/BatteryState)
/// Describes the state of a battery
///
public struct BatteryState
{
///
/// Header with timestamp and frame ID
///
public Header Header { get; set; }
///
/// Voltage in Volts (Mandatory)
///
public double Voltage { get; set; }
///
/// Current in Amperes (If not available: NaN)
///
public double Current { get; set; }
///
/// Charge in Ah (If not available: NaN)
///
public double Charge { get; set; }
///
/// Capacity in Ah (last full capacity) (If not available: NaN)
///
public double Capacity { get; set; }
///
/// Design capacity in Ah (If not available: NaN)
///
public double DesignCapacity { get; set; }
///
/// Percentage (0-100) (If not available: NaN)
///
public double Percentage { get; set; }
///
/// Power supply status constants
///
public const byte PowerSupplyStatusUnknown = 0;
public const byte PowerSupplyStatusCharging = 1;
public const byte PowerSupplyStatusDischarging = 2;
public const byte PowerSupplyStatusNotCharging = 3;
public const byte PowerSupplyStatusFull = 4;
///
/// Power supply status (PowerSupplyStatus constants)
///
public byte PowerSupplyStatus { get; set; }
///
/// Power supply health constants
///
public const byte PowerSupplyHealthUnknown = 0;
public const byte PowerSupplyHealthGood = 1;
public const byte PowerSupplyHealthOverheat = 2;
public const byte PowerSupplyHealthDead = 3;
public const byte PowerSupplyHealthOvervoltage = 4;
public const byte PowerSupplyHealthUnspecifiedFailure = 5;
public const byte PowerSupplyHealthCold = 6;
///
/// Power supply health (PowerSupplyHealth constants)
///
public byte PowerSupplyHealth { get; set; }
///
/// Power supply technology (chemistry) constants
///
public const byte PowerSupplyTechnologyUnknown = 0;
public const byte PowerSupplyTechnologyNiMh = 1;
public const byte PowerSupplyTechnologyLion = 2;
public const byte PowerSupplyTechnologyLipo = 3;
public const byte PowerSupplyTechnologyLife = 4;
public const byte PowerSupplyTechnologyNiCd = 5;
public const byte PowerSupplyTechnologyLiMn = 6;
///
/// Power supply technology (PowerSupplyTechnology constants)
///
public byte PowerSupplyTechnology { get; set; }
///
/// True if the battery is present
///
public bool Present { get; set; }
///
/// An array of individual cell voltages. Each individual cell voltage should be > 0.0.
/// If not available: empty array
///
public double[] CellVoltage { get; set; }
///
/// An array of individual cell temperatures. Each individual cell temperature should be > 0.0.
/// If not available: empty array
///
public double[] CellTemperature { get; set; }
///
/// The location into which the battery is inserted. (slot number or plug)
///
public string Location { get; set; }
///
/// The serial number of the battery pack.
///
public string SerialNumber { get; set; }
///
/// Default constructor
///
public BatteryState()
{
Header = new Header();
Voltage = 0.0;
Current = double.NaN;
Charge = double.NaN;
Capacity = double.NaN;
DesignCapacity = double.NaN;
Percentage = double.NaN;
PowerSupplyStatus = PowerSupplyStatusUnknown;
PowerSupplyHealth = PowerSupplyHealthUnknown;
PowerSupplyTechnology = PowerSupplyTechnologyUnknown;
Present = false;
CellVoltage = [];
CellTemperature = [];
Location = string.Empty;
SerialNumber = string.Empty;
}
}