Skip to content

Commit

Permalink
speed fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robagar committed May 23, 2021
1 parent 6891eb2 commit e88e7ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ async def main():
await drone.connect()
await drone.takeoff()

for i in range(3):
await drone.speed = 10 * i
for i in range(1, 3):
await drone.set_speed(10 * i)
speed = await drone.speed
print(f'speed: {speed}')

Expand All @@ -22,4 +22,4 @@ async def main():
# Python 3.7+
#asyncio.run(main())
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.run_until_complete(main())
4 changes: 2 additions & 2 deletions tello_asyncio/tello.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ async def speed(self):
'''
The drone speed in cm/s, requested directly from the drone.
'''
return await self.send('speed?', response_parser=lambda m: int(m))
return await self.send('speed?', response_parser=lambda m: float(m))

async def set_speed(speed):
async def set_speed(self, speed):
'''
Set the forward speed.
Expand Down

0 comments on commit e88e7ad

Please sign in to comment.