Skip to content
Snippets Groups Projects
Commit a80e237a authored by abeinder's avatar abeinder
Browse files

I broke the gamepad and fixed it

parent 5b14dfa4
No related branches found
No related tags found
3 merge requests!104adding cflib to this branch,!94Merge cflib adapter into main,!84Pycrocart
......@@ -61,7 +61,7 @@ if __name__ == '__main__':
app = QApplication(sys.argv)
cf1 = CrazyflieProtoConnection()
uri = 'radio://0/80/2M/E7E7E7E7E7'
uri = 'radio://0/20/2M/E7E7E7E7E7'
cf1.connect(uri)
cf1.scf.cf.commander = uCartCommander.Commander(cf1.scf.cf)
......
......@@ -173,13 +173,16 @@ class SetpointMenu(QWidget):
else:
self.setpoint_handler.setRateMode()
yaw = self.cap_max_value(yaw, 20, -20)
pitch = self.cap_max_value(pitch, 5, -5)
roll = self.cap_max_value(roll, 5, -5)
# If you are a flypi do this
thrust = thrust + 100
thrust = self.cap_max_value(thrust, 340, 240)
if self.gamepad_button.isChecked():
yaw = self.cap_max_value(yaw, 20, -20)
pitch = self.cap_max_value(pitch, 5, -5)
roll = self.cap_max_value(roll, 5, -5)
# If you are a flypi do this
thrust = thrust + 240
thrust = self.cap_max_value(thrust, 340, 240)
print("thrust")
print(thrust)
# otherwise don't..... but I'm not changing that rn
......
......@@ -2,12 +2,7 @@
"group1":
{
"update_frequency_ms": 50,
"vars": ["ctrlStdnt.msrdPitchRate", "ctrlStdnt.dsirdPitchRate", "stateEstimate.roll", "stateEstimate.yaw", "ctrlStdnt.desiredPitch"]
},
"group2":
{
"update_frequency_ms": 50,
"vars": ["ctrlStdnt.cmd_thrust", "ctrlStdnt.cmd_roll", "ctrlStdnt.cmd_pitch", "stateEstimate.pitch", "ctrlStdnt.cmd_yaw"]
"vars": ["stateEstimate.roll", "stateEstimate.yaw", "stateEstimate.pitch"]
},
"group3":
{
......
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