-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added arming fuctionality and emergency button #665
Changes from 1 commit
1133484
873670f
b606474
d18b514
12f5dfd
955d692
2c68685
3baa365
934ec30
d6ed000
8b2d359
7608050
c8201c6
a47a9f6
0470f79
656986d
1d4b3e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -505,13 +505,13 @@ | |
<property name="geometry"> | ||
<rect> | ||
<x>600</x> | ||
<y>158</y> | ||
<y>150</y> | ||
<width>292</width> | ||
<height>202</height> | ||
<height>221</height> | ||
</rect> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout_5"> | ||
<item row="5" column="1"> | ||
<item row="6" column="1"> | ||
<widget class="QPushButton" name="detectAlt2"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
|
@@ -521,7 +521,30 @@ | |
</property> | ||
</widget> | ||
</item> | ||
<item row="4" column="0"> | ||
<item row="2" column="1"> | ||
<widget class="QPushButton" name="detectKillswitch"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Detect</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="7" column="0"> | ||
<widget class="QCheckBox" name="muxswitch"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Mux switch</string> | ||
</property> | ||
<property name="checkable"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="5" column="0"> | ||
<widget class="QCheckBox" name="alt1"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
|
@@ -534,8 +557,8 @@ | |
</property> | ||
</widget> | ||
</item> | ||
<item row="3" column="1"> | ||
<widget class="QPushButton" name="detectExitapp"> | ||
<item row="1" column="1"> | ||
<widget class="QPushButton" name="_detect_assisted_control"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably unify to make this all snake cases, but that is just a beauty issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had the same idea but it generated a lot of side work as many of them are saved as button mapping |
||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
|
@@ -544,30 +567,33 @@ | |
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="1"> | ||
<widget class="QPushButton" name="detectKillswitch"> | ||
<item row="6" column="0"> | ||
<widget class="QCheckBox" name="alt2"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Detect</string> | ||
<string>Alt 2</string> | ||
</property> | ||
<property name="checkable"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="0"> | ||
<widget class="QCheckBox" name="killswitch"> | ||
<item row="1" column="0"> | ||
<widget class="QCheckBox" name="_assisted_control"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Killswitch</string> | ||
<string>Assisted control</string> | ||
</property> | ||
<property name="checkable"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="3" column="0"> | ||
<item row="4" column="0"> | ||
<widget class="QCheckBox" name="exitapp"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
|
@@ -580,21 +606,21 @@ | |
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QCheckBox" name="_assisted_control"> | ||
<item row="2" column="0"> | ||
<widget class="QCheckBox" name="killswitch"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Assisted control</string> | ||
<string>Disarm/kill</string> | ||
</property> | ||
<property name="checkable"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="1"> | ||
<widget class="QPushButton" name="_detect_assisted_control"> | ||
<item row="7" column="1"> | ||
<widget class="QPushButton" name="detectMuxswitch"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
|
@@ -603,21 +629,18 @@ | |
</property> | ||
</widget> | ||
</item> | ||
<item row="5" column="0"> | ||
<widget class="QCheckBox" name="alt2"> | ||
<item row="5" column="1"> | ||
<widget class="QPushButton" name="detectAlt1"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Alt 2</string> | ||
</property> | ||
<property name="checkable"> | ||
<bool>true</bool> | ||
<string>Detect</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="4" column="1"> | ||
<widget class="QPushButton" name="detectAlt1"> | ||
<widget class="QPushButton" name="detectExitapp"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
|
@@ -626,21 +649,21 @@ | |
</property> | ||
</widget> | ||
</item> | ||
<item row="6" column="0"> | ||
<widget class="QCheckBox" name="muxswitch"> | ||
<item row="3" column="0"> | ||
<widget class="QCheckBox" name="arm"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Mux switch</string> | ||
<string>Arm</string> | ||
</property> | ||
<property name="checkable"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="6" column="1"> | ||
<widget class="QPushButton" name="detectMuxswitch"> | ||
<item row="3" column="1"> | ||
<widget class="QPushButton" name="detectArm"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,6 +208,9 @@ def __init__(self, *args): | |
self.joystickReader.hover_input_updated.add_callback( | ||
self.cf.commander.send_hover_setpoint) | ||
|
||
#Emergency stop button | ||
self.esButton.clicked.connect(self._emergency_stop) | ||
|
||
# Connection callbacks and signal wrappers for UI protection | ||
self.cf.connected.add_callback(self.connectionDoneSignal.emit) | ||
self.connectionDoneSignal.connect(self._connected) | ||
|
@@ -562,6 +565,12 @@ def _show_input_device_config_dialog(self): | |
def _show_connect_dialog(self): | ||
self.logConfigDialogue.show() | ||
|
||
def _emergency_stop(self): | ||
#send disarming command | ||
if (self.uiState == UIState.CONNECTED): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found here, if there is a firmware on the crazyflie that does not have 'system.arm' on there, the button 'arm and disarm' is active still and the terminal says:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, yes the variable name us new but I guess this is avoidable for all new parameters that are used in e.g. the cfclient UI. Perhaps the warning is a good thing then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A bigger problem might be that the emergency button will not work... |
||
self.cf.param.set_value("system.arm", int(False)) | ||
|
||
|
||
def _update_battery(self, timestamp, data, logconf): | ||
self.batteryBar.setValue(int(data["pm.vbat"] * 1000)) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering... do we want to force people to choose a kill button? Like, they can not save the config file if there is no pitch yaw roll and thrust assigned... but we can also force people to choose a kill button. This needs to be for both the crazyflie or bolt based systems I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea but could there be joysticks without buttons? Then it would block those, which might be good...