Skip to content

Commit

Permalink
Working selfcheck in table!
Browse files Browse the repository at this point in the history
  • Loading branch information
artem30801 committed Mar 28, 2019
1 parent 6f7bf5a commit 47c2cd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Drone/FlightLib/FlightLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def check_angular_speeds():
def check_angles():
failures = []
telemetry = get_telemetry(frame_id='body')
angle_limit = math.radians(1)
angle_limit = math.radians(5)
if abs(telemetry.pitch) >= angle_limit:
failures.append("Pitch estimation: {:.3f} rad;{:.3f} degrees".format(telemetry.pitch,
math.degrees(telemetry.pitch)))
Expand Down
15 changes: 10 additions & 5 deletions Server/server_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,20 @@ def check_selected(self):
item = model.item(row_num, 0)
if item.isCheckable() and item.checkState() == Qt.Checked:
print("Copter {} checked".format(model.item(row_num, 0).text()))
batt_total = Client.get_by_id(item.text()).get_response("batt_voltage")
batt_cell = Client.get_by_id(item.text()).get_response("cell_voltage")
batt_total = float(Client.get_by_id(item.text()).get_response("batt_voltage"))
batt_cell = float(Client.get_by_id(item.text()).get_response("cell_voltage"))
selfcheck = Client.get_by_id(item.text()).get_response("selfcheck")

batt_percent = (batt_cell-3.2)/(4.2-3.2)

model.setData(model.index(0, 2), "{} V.".format(round(batt_total, 3)))
model.setData(model.index(0, 3), "{} %".format(round(batt_percent, 3)))
model.setData(model.index(0, 3), selfcheck)
model.setData(model.index(row_num, 2), "{} V.".format(round(batt_total, 3)))
model.setData(model.index(row_num, 3), "{} %".format(round(batt_percent, 3)))
if selfcheck != "OK":
print(selfcheck)
model.setData(model.index(row_num, 4), str(selfcheck))
else:
print("Everything ok")
model.setData(model.index(row_num, 4), str(selfcheck))

self.ui.start_button.setEnabled(True)
self.ui.takeoff_button.setEnabled(True)
Expand Down

0 comments on commit 47c2cd1

Please sign in to comment.