Skip to content
Snippets Groups Projects
Commit dbc5e106 authored by Angel's avatar Angel
Browse files

debug battery number

parent fea77d03
No related branches found
No related tags found
No related merge requests found
......@@ -298,12 +298,14 @@ void MainWindow::updateBatteryVoltage(float battery_voltage)
QString qstr = "Raw voltage: ";
qstr.append(QString::number(battery_voltage, 'f', 2));
ROS_INFO_STREAM("battery voltage " << battery_voltage);
ui->raw_voltage->clear();
ui->raw_voltage->setText(qstr);
}
void MainWindow::CFBatteryCallback(const std_msgs::Float32& msg)
{
ROS_INFO("callback CFBattery received in GUI");
updateBatteryVoltage(msg.data);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2017-10-09T15:14:52. -->
<!-- Written by QtCreator 3.5.1, 2017-10-18T15:20:06. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
......
6,PPS_CF04,0/24/2M/E7E7E7E704,0,-1.18,-0.65,-0.2,0.93,1.04,2
5,PPS_CF05,0/32/2M/E7E7E7E705,0,-1.10209,-0.137356,-0.2,0.453276,1.22247,2
......@@ -761,7 +761,7 @@ void CFBatteryCallback(const std_msgs::Float32& msg)
// need to do the filtering first
float filtered_battery_voltage = movingAverageBatteryFilter(m_battery_voltage); //need to perform filtering here
ROS_INFO_STREAM("filtered data: " << filtered_battery_voltage);
// ROS_INFO_STREAM("filtered data: " << filtered_battery_voltage);
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)))
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment