Commit bcb3b7dc authored by roangel's avatar roangel
Browse files

small detail battery check

parent dce0dfa1
......@@ -734,16 +734,14 @@ void CFBatteryCallback(const std_msgs::Float32& msg)
if((flying_state != STATE_MOTORS_OFF && (filtered_battery_voltage < m_battery_threshold_while_flying)) ||
(flying_state == STATE_MOTORS_OFF && (filtered_battery_voltage < m_battery_threshold_while_motors_off)))
{
if(getBatteryState() != BATTERY_STATE_LOW)
setBatteryStateTo(BATTERY_STATE_LOW);
// if(getBatteryState() != BATTERY_STATE_LOW)
setBatteryStateTo(BATTERY_STATE_LOW);
ROS_INFO("low level battery triggered");
}
else //maybe add hysteresis somewhere here?
{
if(getBatteryState() != BATTERY_STATE_NORMAL)
{
setBatteryStateTo(BATTERY_STATE_NORMAL);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment