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

Step by Step Swarm Guide #352

Merged
merged 6 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cflib/bootloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def flash(self, filename: str, targets: List[Target], cf=None):
content = open(filename, 'br').read()
artifacts = [FlashArtifact(content, targets[0])]
else:
raise(Exception('Cannot flash a .bin to more than one target!'))
raise (Exception('Cannot flash a .bin to more than one target!'))

# Separate artifacts for flash and decks
flash_artifacts = [a for a in artifacts if a.target.platform == platform]
Expand Down
2 changes: 1 addition & 1 deletion cflib/cpx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def transport(self):
return self._transport

def run(self):
while(self._connected):
while (self._connected):
# Read one packet from the transport

# Packages might have been split up along the
Expand Down
10 changes: 5 additions & 5 deletions cflib/crtp/radiodriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def set_data_rate(self, dr):
self._datarate = dr

def send_packet(self, data: List[int]) -> crazyradio._radio_ack:
assert(self._opened)
assert (self._opened)
self._cmd_queue.put((self._instance_id,
_RadioCommands.SEND_PACKET,
(self._channel,
Expand All @@ -116,29 +116,29 @@ def send_packet(self, data: List[int]) -> crazyradio._radio_ack:
return ack

def set_arc(self, arc):
assert(self._opened)
assert (self._opened)
self._cmd_queue.put((self._instance_id,
_RadioCommands.SET_ARC,
arc))

def scan_selected(self, selected, packet):
assert(self._opened)
assert (self._opened)
self._cmd_queue.put((self._instance_id,
_RadioCommands.SCAN_SELECTED,
(self._datarate, self._address,
selected, packet)))
return self._rsp_queue.get()

def scan_channels(self, start: int, stop: int, packet: Iterable[int]):
assert(self._opened)
assert (self._opened)
self._cmd_queue.put((self._instance_id,
_RadioCommands.SCAN_CHANNELS,
(self._datarate, self._address,
start, stop, packet)))
return self._rsp_queue.get()

def close(self):
assert(self._opened)
assert (self._opened)
self._cmd_queue.put((self._instance_id, _RadioCommands.STOP, None))
self._opened = False

Expand Down
6 changes: 3 additions & 3 deletions cflib/localization/_ippe.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def mat_run(U, Q, hEstMethod='DLT'):
print('hEstMethod Error')

# Inputs shape checking
assert(U.shape[0] == 2 or U.shape[0] == 3)
assert(U.shape[1] == Q.shape[1])
assert(Q.shape[0] == 2)
assert (U.shape[0] == 2 or U.shape[0] == 3)
assert (U.shape[1] == Q.shape[1])
assert (Q.shape[0] == 2)

n = U.shape[1]
modelDims = U.shape[0]
Expand Down
Loading