mirror of
https://github.com/okalachev/flix.git
synced 2026-06-27 21:46:38 +00:00
Improve voltage measurement
Apply PWM_VOLT_PIN without reboot. Check if the voltage pin can be used with ADC when setting up. Set voltage to NAN, when it's unknown (including pyflix). pyflix@0.15. Don't send BATTERY_STATUS when voltage is unknown. Add dummy voltage to the simulator.
This commit is contained in:
@@ -37,7 +37,7 @@ print(flix.connected) # True if connected to the drone
|
||||
print(flix.mode) # current flight mode (str)
|
||||
print(flix.armed) # True if the drone is armed
|
||||
print(flix.landed) # True if the drone is landed
|
||||
print(flix.voltage) # battery voltage
|
||||
print(flix.voltage) # battery voltage (NaN - unknown, ~0 - USB powered)
|
||||
print(flix.attitude) # attitude quaternion [w, x, y, z]
|
||||
print(flix.attitude_euler) # attitude as Euler angles [roll, pitch, yaw]
|
||||
print(flix.rates) # angular rates [roll_rate, pitch_rate, yaw_rate]
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import os
|
||||
import time
|
||||
import math
|
||||
from queue import Queue, Empty
|
||||
from typing import Optional, Callable, List, Dict, Any, Union, Sequence
|
||||
import logging
|
||||
@@ -26,7 +27,7 @@ class Flix:
|
||||
mode: str = ''
|
||||
armed: bool = False
|
||||
landed: bool = False
|
||||
voltage: float = 0
|
||||
voltage: float = math.nan
|
||||
attitude: List[float]
|
||||
attitude_euler: List[float] # roll, pitch, yaw
|
||||
rates: List[float]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "pyflix"
|
||||
version = "0.14"
|
||||
version = "0.15"
|
||||
description = "Python API for Flix drone"
|
||||
authors = [{ name="Oleg Kalachev", email="okalachev@gmail.com" }]
|
||||
license = "MIT"
|
||||
|
||||
Reference in New Issue
Block a user