Added Power Brick related battery_status.msg fields

system_source - This battery status is for the brick that is
                   supplying VDD_5V_IN
   priority      - Zero based, This battery status is for the brick
                   that is connected to the Power controller's
                   N-1 priority input. V1..VN. 0 would normally be
                   Brick1, 1 for Brick2 etc

  Battery now assigns connected from the api in the
  updateBatteryStatus, as well as system_source and priority
This commit is contained in:
David Sidrane
2017-07-17 21:02:50 -10:00
parent 579b55f2cb
commit 8e8510f398
7 changed files with 23 additions and 8 deletions
+3 -1
View File
@@ -1798,7 +1798,9 @@ PX4IO::io_handle_battery(uint16_t vbatt, uint16_t ibatt)
float current_a = ibatt * (3.3f / 4096.0f) * _battery_amp_per_volt;
current_a += _battery_amp_bias;
_battery.updateBatteryStatus(timestamp, voltage_v, current_a, _last_throttle, _armed, &battery_status);
_battery.updateBatteryStatus(timestamp, voltage_v, current_a, true, true, 0,
_last_throttle,
_armed, &battery_status);
/* the announced battery status would conflict with the simulated battery status in HIL */
if (!(_pub_blocked)) {