Skip to content
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

Merged
merged 17 commits into from
May 31, 2023
Merged

Conversation

tobbeanton
Copy link
Member

@tobbeanton tobbeanton commented May 9, 2023

Arming functionality has been added both by pressing a buton in the flight tab but also a joystick button can be assigned to do it. The functionality itself is implemented using the system.arm parameter.

This PR requires bitcraze/crazyflie-firmware#1281
and bitcraze/crazyflie-lib-python#404

Arming functionality has been added both by pressing
a buton in the flight tab but also a joystick button
can be assigned to do it. The functionality itself
is implemented using the system.arm parameter.
@tobbeanton
Copy link
Member Author

The disarm button in the flight tab is not always disabled after a disconnect.

1 similar comment
@tobbeanton
Copy link
Member Author

The disarm button in the flight tab is not always disabled after a disconnect.

Copy link
Member

@knmcguire knmcguire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some comments already!

@@ -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):
Copy link
Member

Choose a reason for hiding this comment

The 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:

WARNING:cflib.crazyflie.toc:Unable to find variable [system.arm]
WARNING:cflib.crazyflie.param:Cannot set value for [system.arm], it's not in the TOC!

Copy link
Member Author

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bigger problem might be that the emergency button will not work...

<item row="3" column="1">
<widget class="QPushButton" name="detectExitapp">
<item row="1" column="1">
<widget class="QPushButton" name="_detect_assisted_control">
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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

@@ -178,7 +183,8 @@ def _reset_mapping(self):
"pitchNeg": self.pitchNeg,
"rollPos": self.rollPos,
"rollNeg": self.rollNeg,
"killswitch": self.killswitch,
"estop": self.killswitch,
Copy link
Member

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.

Copy link
Member Author

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...

Copy link
Member

@knmcguire knmcguire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some comments already!

self.actualM1.setValue(data[self.LOG_NAME_MOTOR_1])
self.actualM2.setValue(data[self.LOG_NAME_MOTOR_2])
self.actualM3.setValue(data[self.LOG_NAME_MOTOR_3])
self.actualM4.setValue(data[self.LOG_NAME_MOTOR_1])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C&P error

@krichardsson krichardsson marked this pull request as ready for review May 31, 2023 09:40
@krichardsson krichardsson merged commit c7f03d6 into master May 31, 2023
@krichardsson krichardsson deleted the tobba/arming branch May 31, 2023 11:00
@krichardsson krichardsson added this to the next release milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants