Skip to content
Snippets Groups Projects
Commit 98f1d949 authored by 488_MP-4's avatar 488_MP-4
Browse files

getparam working for cflib groundstation

parent de1b8027
No related branches found
No related tags found
5 merge requests!106Adding Pycrocart 2.1,!104adding cflib to this branch,!103Updating develop to current state of master branch,!98Pycrocart 2.1 will,!94Merge cflib adapter into main
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -202,12 +202,10 @@ class CrazyflieConnection:
data = bytearray()
data += command['data'][0:2]
data += command['data'][2:4]
if "." in actual:
actual = float(actual)
flBytes = struct.pack('f', actual)
else:
actual = int(actual)
flBytes = struct.pack('i', actual)
print(actual)
actual = float(actual)
print(actual)
flBytes = struct.pack('f', actual)
data += flBytes
print(data)
print(len(data))
......
......@@ -94,13 +94,14 @@ class GroundstationSocket():
def EncodePacket(self, messagedata):
print("encoding packet")
bytedata = bytearray()
bytedata += b'\xbe'
bytedata += b"\xbe"
bytedata.append((messagedata["msg_type"].value & 0xFF))
print(bytedata)
bytedata.append((messagedata["msg_type"].value >> 8) & 0xFF)
print(bytedata)
bytedata.append(messagedata["msg_id"])
bytedata.append(messagedata["msg_id"] & 0xFF)
print(bytedata)
bytedata.append((messagedata["msg_id"] >> 8) & 0xFF)
print(bytedata)
bytedata.append(messagedata["data_len"] & 0xFF)
print(bytedata)
......@@ -108,6 +109,7 @@ class GroundstationSocket():
print(bytedata)
bytedata += messagedata["data"]
print(bytedata)
print(len(bytedata))
bytedata.append(self.packetChecksum(bytedata, PacketHeader.HDR_SIZE.value + messagedata["data_len"] + ChecksumFormat.CSUM_SIZE.value))
print(bytedata)
return bytedata
......
Subproject commit 99c54dbefe04897cc7c146101a126f62c0e65f97
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