Skip to content

Commit

Permalink
Added battery test button in console. Closes bitcraze#471
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbeanton committed Feb 5, 2021
1 parent 3591143 commit 4cb429d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cfclient/ui/tabs/ConsoleTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def __init__(self, tabWidget, helper, *args):
self._propellerTestButton.clicked.connect(
lambda enabled:
self._helper.cf.param.set_value("health.startPropTest", '1'))
self._batteryTestButton.clicked.connect(
lambda enabled:
self._helper.cf.param.set_value("health.startBatTest", '1'))

def printText(self, text):
# Make sure we get printouts from the Crazyflie into the log (such as
Expand All @@ -94,8 +97,10 @@ def _connected(self, link_uri):
"""Callback when the Crazyflie has been connected"""
self._dumpSystemLoadButton.setEnabled(True)
self._propellerTestButton.setEnabled(True)
self._batteryTestButton.setEnabled(True)

def _disconnected(self, link_uri):
"""Callback for when the Crazyflie has been disconnected"""
self._dumpSystemLoadButton.setEnabled(False)
self._propellerTestButton.setEnabled(False)
self._batteryTestButton.setEnabled(False)
13 changes: 13 additions & 0 deletions src/cfclient/ui/tabs/consoleTab.ui
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_batteryTestButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Experimental feature:&lt;/span&gt;&lt;span style=&quot; font-weight:600;&quot;&gt; Test battery (power path)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This test will very shortly spin the motors at pull power and measure the voltage drop. This voltage drop should not be to high. If it is, the battery is probably bad, but it could also be the connector or other components in the power path that adds resistance.&lt;/p&gt;&lt;p&gt;The results are printed on the console and can be read from the health.batterySag and health.batteryPass log variables.&lt;/p&gt;&lt;p&gt;This feature is meant for the Crazyflie 2.X only and should probably not be used by e.g. Crazyflie Bolt or BigQuad. For them the test could even be dangerous.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Battery test</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
Expand Down

0 comments on commit 4cb429d

Please sign in to comment.