Skip to content
Merged
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
4 changes: 3 additions & 1 deletion dronekit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import types
import threading
import math
import struct
import copy
import collections
from pymavlink.dialects.v10 import ardupilotmega
Expand Down Expand Up @@ -2433,7 +2434,8 @@ def set(self, name, value, retries=3, wait_ready=False):
# instead just wait until the value itself was changed

name = name.upper()
value = float(value)
# convert to single precision floating point number (the type used by low level mavlink messages)
value = float(struct.unpack('f', struct.pack('f', value))[0])
success = False
remaining = retries
while True:
Expand Down