Skip to content

Commit

Permalink
Merge pull request #665 from bitcraze/tobba/arming
Browse files Browse the repository at this point in the history
Added arming fuctionality and emergency button
  • Loading branch information
krichardsson committed May 31, 2023
2 parents ffb0572 + 1d4b3e1 commit c7f03d6
Show file tree
Hide file tree
Showing 30 changed files with 512 additions and 212 deletions.
Binary file modified docs/images/cf_client_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/cfclient_console_marked.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/cfclient_flightab.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/cfclient_lh_main.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/cfclient_logblocks_marked.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/cfclient_param.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/cfclient_ploter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/cfclient_position_estimate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/userguides/userguide_client/console_tab.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Console Tab
page_id: console_tab
sort_order: 2
---

The console tab will show printouts from the Crazyflie firmware as it\'s
running.

![cfclient console](/docs/images/cfclient_console_marked.png){:align-center
width="700"}
![cfclient console](/docs/images/cfclient_console_marked.png)

1. Console output from the Crazyflie
4 changes: 3 additions & 1 deletion docs/userguides/userguide_client/flightcontrol_tab.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: Flightcontrol Tab
page_id: flightcontrol_tab
sort_order: 1
---

The normal view used when flying is the one seen below.

![cfclient flighttab](/docs/images/cfclient_flightab.png){:align-center}
![cfclient flighttab](/docs/images/cfclient_flightab.png)

1. Flight mode selector (Normal and Advanced)
* *Normal:* Recommended for beginners
Expand Down Expand Up @@ -34,3 +35,4 @@ The normal view used when flying is the one seen below.
8. Motor output on the Crazyflie
9. Horizon indicator
10. Command based flight control, allow controlled flight if, and only if, a positioning deck such as the [Flow deck](https://store.bitcraze.io/collections/decks/products/flow-deck-v2), the [Loco deck](https://store.bitcraze.io/collections/decks/products/loco-positioning-deck) or the [Lighthouse deck](https://store.bitcraze.io/collections/decks/products/lighthouse-positioning-deck) is present.
11. Arming/disarming button. Pressing this will send a arming or disarming event to the Crazyflie which will arm or disarm the system if this is possible. This button can also say "Auto arming" which indicates the crazyflie is configured to arm the system automatically if system checks have passed. More info in [crazyflie firmware arming documentation](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/supervisor/arming/).
8 changes: 4 additions & 4 deletions docs/userguides/userguide_client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ For more info on LED indicators etc. have a look at the [Crazyflie 2.X](https://
1. The window title will show the connection status
2. Connect/disconnect, scan and the drop-down connection list as well
as Address and auto reconnect.



* *Scan:* Will scan for availible Crazyflies within the chosen address.
* *Connect:* Will connect to the selected URI in the connection list
* *Disconnect:* Will disconnect the current Crazyflie
* *Address:* The address to scan for. If you didn't change this [in the configuration]( #firmware-configuration), then leave the default of 0xE7E7E7E7E7
3. Battery and link quality (from 0% to 100%)
4. Tabs with specific functionality (see below for details)
5. The selected and used input interface
5. The content for the active tab
6. Toolboxes can be docked to the edges, making their content visible all the time.
7. The selected and used input interface
8. Emergency stop button. The motors will stop when clicked.

### Tabs and toolboxes

Expand Down
3 changes: 2 additions & 1 deletion docs/userguides/userguide_client/lighthouse_tab.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: Lighthouse Positioning Tab
page_id: lighthouse_tab
sort_order: 6
---

The Lighthouse Positioning tab shows information from the Lighthouse Positioning
system when present. It is also used to configure and manage the system.
For more information on how the Lighthouse system works, please see
[the firmware documentation](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/lighthouse/).

![cfclient positioning](/docs/images/cfclient_lh_main.png){:align-center width="700"}
![cfclient positioning](/docs/images/cfclient_lh_main.png)

The tab is divided into four sections:
1. 3D view of the Crazyfle and the base stations
Expand Down
4 changes: 2 additions & 2 deletions docs/userguides/userguide_client/loco_tab.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Loco Positioning Tab
page_id: loco_tab
sort_order: 7
---

The Loco Positioning tab shows information from the Loco Positioning
Expand All @@ -22,8 +23,7 @@ Displays the configured anchor positions and the estimated position of
the Crazyflie. Can be used to make sure the system is set up correctly
and that the estimated position is reasonable.

![cfclient positioning](/docs/images/cfclient_position_estimate.png){:align-center
width="700"}
![cfclient positioning](/docs/images/cfclient_position_estimate.png)

1. Plot showing anchors and Crazyflie
2. Sets the graph mode
Expand Down
4 changes: 2 additions & 2 deletions docs/userguides/userguide_client/logblocks_tab.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: Log Blocks Tab
page_id: logblocks_tab
sort_order: 5
---

The log blocks tab shows all log configurations that are saved and if
they are started. It\'s also possible to start/stop them as well as
write the logged data to file.

![cfclient log blocks](/docs/images/cfclient_logblocks_marked.png){:align-center
width="700"}
![cfclient log blocks](/docs/images/cfclient_logblocks_marked.png)

1. Fields
- *ID:* Block id in Crazyflie
Expand Down
3 changes: 2 additions & 1 deletion docs/userguides/userguide_client/parameters_tab.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: Parameter Tab
page_id: parameter_tab
sort_order: 4
---

The Crazyflie supports parameters, variables stored in the Crazyflie
that can be changed in real-time. The parameter tab can be used to view
and update parameters. For more information about parameters see
[logging and parameter frameworks](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/userguides/logparam/).

![cfclient parameter list](/docs/images/cfclient_param.png){:align-center width="700"}
![cfclient parameter list](/docs/images/cfclient_param.png)

1. Parameter information fields
* *Name:* The name of the parameter or group.
Expand Down
4 changes: 2 additions & 2 deletions docs/userguides/userguide_client/plotter_tab.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Plotter Tab
page_id: plotter_tab
sort_order: 3
---

The plotter tab can be used to visualize data logged from the Crazyflie.

![cfclient plotter](/docs/images/cfclient_ploter.png){:align-center
width="700"}
![cfclient plotter](/docs/images/cfclient_ploter.png)

1. Select logging configuration to plot. Read about how to create
configurations [here](/docs/userguides/userguide_client/#logging).
Expand Down
8 changes: 4 additions & 4 deletions docs/userguides/userguide_client/tuning_tab.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
title: Tuning Tab
page_id: tuning_tab
sort_order: 8
---

![cfclient plotter](/docs/images/tuning_tab.png){:align-center
width="700"}
![cfclient plotter](/docs/images/tuning_tab.png)

This tab is for tuning the PID controller on your Crazyflie platform.
This tab is for tuning the PID controller on your Crazyflie platform.

1. Select which part of the controller you want to tune (attitude (rate) or velocity/position)
2. Check the 'link roll and pitch' or 'link x and y' button if you have a symetrical platform, or else it is best to tune those seperately
3. Tune the PID gains of controller. This is best done within flight with the controller or flight commander
4. If you are not happy with your tuning, default to values there were in before
5. If you are happy, it would be best to persist the parameters so it is consistent after startup
6. If you want to remove the persistent parameter from the memory, you can also clear it.
6. If you want to remove the persistent parameter from the memory, you can also clear it.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def relative(lst, base=''):
],
},

install_requires=['cflib>=0.1.22',
install_requires=['cflib>=0.1.23',
'appdirs~=1.4.0',
'pyzmq~=25.0',
'pyqtgraph~=0.11',
Expand Down
2 changes: 1 addition & 1 deletion src/cfclient/ui/dialogs/about.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Copyright (c) 2011-2020, Bitcraze AB</string>
<string>Copyright (c) 2011-2023, Bitcraze AB</string>
</property>
</widget>
</item>
Expand Down
18 changes: 12 additions & 6 deletions src/cfclient/ui/dialogs/inputconfigdialogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ def __init__(self, joystickReader, *args):
"Press the button for Roll negative calibration"))
self.detectKillswitch.clicked.connect(
lambda: self._button_detect(
"killswitch", "Killswitch",
"Press the button for the killswitch (will disable motors)"))
"estop", "Disarm/Kill",
"Press the button to disarm/kill (will disable motors)"))
self.detectArm.clicked.connect(
lambda: self._button_detect(
"arm", "Arm system",
"Press the button to arm the system (will enable motor ouput)"))
self.detectAlt1.clicked.connect(
lambda: self._button_detect(
"alt1", "Alternative function 1",
Expand Down Expand Up @@ -142,9 +146,10 @@ def __init__(self, joystickReader, *args):
self.detectYaw, self.detectThrust,
self.detectPitchPos, self.detectPitchNeg,
self.detectRollPos, self.detectRollNeg,
self.detectKillswitch, self.detectExitapp,
self._detect_assisted_control, self.detectAlt1,
self.detectAlt2, self.detectMuxswitch]
self.detectKillswitch, self.detectArm,
self.detectExitapp, self._detect_assisted_control,
self.detectAlt1, self.detectAlt2,
self.detectMuxswitch]

self._button_to_detect = ""
self._axis_to_detect = ""
Expand Down Expand Up @@ -178,7 +183,8 @@ def _reset_mapping(self):
"pitchNeg": self.pitchNeg,
"rollPos": self.rollPos,
"rollNeg": self.rollNeg,
"killswitch": self.killswitch,
"estop": self.killswitch,
"arm": self.arm,
"alt1": self.alt1,
"alt2": self.alt2,
"exitapp": self.exitapp,
Expand Down
83 changes: 53 additions & 30 deletions src/cfclient/ui/dialogs/inputconfigdialogue.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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">
<property name="enabled">
<bool>false</bool>
</property>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit c7f03d6

Please sign in to comment.