Refactored to work with new battery_status module

This commit is contained in:
Timothy Scott
2019-11-07 15:59:12 +01:00
committed by Julian Oes
parent d7bb5d46bb
commit 993fa5bd37
35 changed files with 1101 additions and 1837 deletions
@@ -101,7 +101,7 @@ private:
orb_advert_t _battery_topic;
orb_advert_t _esc_topic;
Battery1 _battery;
Battery _battery;
bool _armed;
float _last_throttle;
@@ -203,6 +203,10 @@ int DfBebopBusWrapper::_publish(struct bebop_state_data &data)
const hrt_abstime timestamp = hrt_absolute_time();
// TODO Check if this is the right way for the Bebop
// We don't have current measurements
_battery.updateBatteryStatus(timestamp, data.battery_voltage_v, 0.0, true, true, 0, _last_throttle, _armed, false);
esc_status_s esc_status = {};
uint16_t esc_speed_setpoint_rpm[4] = {};
@@ -218,9 +222,7 @@ int DfBebopBusWrapper::_publish(struct bebop_state_data &data)
// TODO: when is this ever blocked?
if (!(m_pub_blocked)) {
// TODO Check if this is the right way for the Bebop
// We don't have current measurements
_battery.updateBatteryStatus(timestamp, data.battery_voltage_v, 0.0, true, true, 0, _last_throttle, _armed, true);
_battery.publish();
if (_esc_topic == nullptr) {
_esc_topic = orb_advertise(ORB_ID(esc_status), &esc_status);
@@ -69,7 +69,7 @@ public:
private:
int _publish(const struct ltc2946_sensor_data &data);
Battery1 _battery{};
Battery _battery{};
int _actuator_ctrl_0_sub{-1};
int _vcontrol_mode_sub{-1};