Skip to content

Commit

Permalink
Merge pull request #153 from daanzu/master
Browse files Browse the repository at this point in the history
make sure PCMD params are ints (floats fail silently)
  • Loading branch information
amymcgovern committed Mar 13, 2019
2 parents 293f4d8 + f381834 commit 3aac46e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyparrot/networking/bleConnection.py
Expand Up @@ -419,7 +419,7 @@ def send_pcmd_command(self, command_tuple, roll, pitch, yaw, vertical_movement,
packet = struct.pack("<BBBBHBbbbbI", self.data_types['DATA_NO_ACK'],
self.characteristic_send_counter['SEND_NO_ACK'],
command_tuple[0], command_tuple[1], command_tuple[2],
1, roll, pitch, yaw, vertical_movement, 0)
1, int(roll), int(pitch), int(yaw), int(vertical_movement), 0)

self._safe_ble_write(characteristic=self.send_characteristics['SEND_NO_ACK'], packet=packet)
# self.send_characteristics['SEND_NO_ACK'].write(packet)
Expand Down
2 changes: 1 addition & 1 deletion pyparrot/networking/wifiConnection.py
Expand Up @@ -574,7 +574,7 @@ def send_single_pcmd_command(self, command_tuple, roll, pitch, yaw, vertical_mov
self.sequence_counter['SEND_NO_ACK'],
20,
command_tuple[0], command_tuple[1], command_tuple[2],
1, roll, pitch, yaw, vertical_movement, 0)
1, int(roll), int(pitch), int(yaw), int(vertical_movement), 0)

self.safe_send(packet)

Expand Down

0 comments on commit 3aac46e

Please sign in to comment.