Skip to content

Commit 4a9493a

Browse files
committed
imu: cleanup stale comments, revert unneccessary changes
1 parent d6d3669 commit 4a9493a

2 files changed

Lines changed: 11 additions & 22 deletions

File tree

internal_filesystem/lib/mpos/board/linux.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,10 @@ def adc_to_voltage(adc_value):
122122
# LightsManager will not be initialized (functions will return False)
123123

124124
# === SENSOR HARDWARE ===
125-
# Note: Desktop builds have no sensor hardware
126125
from mpos import SensorManager
127126

128-
# Initialize with no I2C bus - will detect MCU temp if available
129-
# (On Linux desktop, this will fail gracefully but set _initialized flag)
130127
SensorManager.init_iio()
131128

132-
# In app:
133-
if False and SensorManager.is_available():
134-
accel = SensorManager.get_default_sensor(SensorManager.TYPE_ACCELEROMETER)
135-
print(accel)
136-
ax, ay, az = SensorManager.read_sensor_once(accel) # Returns m/s²
137-
print(ax, ay, az)
138-
139129
# === CAMERA HARDWARE ===
140130

141131
def init_cam(width, height, colormode):

internal_filesystem/lib/mpos/sensor_manager.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Sensor type constants (matching Android SensorManager)
3131
TYPE_ACCELEROMETER = 1 # Units: m/s² (meters per second squared)
32-
TYPE_MAGNETIC_FIELD = 2 # Units: μT (micro Teslas)
32+
TYPE_MAGNETIC_FIELD = 2 # Units: μT (micro teslas)
3333
TYPE_GYROSCOPE = 4 # Units: deg/s (degrees per second)
3434
TYPE_TEMPERATURE = 13 # Units: °C (generic, returns first available - deprecated)
3535
TYPE_IMU_TEMPERATURE = 14 # Units: °C (IMU chip temperature)
@@ -124,7 +124,6 @@ def get(cls):
124124
cls._instance = cls()
125125
return cls._instance
126126

127-
128127
def init(self, i2c_bus, address=0x6B, mounted_position=FACING_SKY):
129128
"""Initialize SensorManager. MCU temperature initializes immediately, IMU initializes on first use.
130129
@@ -159,30 +158,30 @@ def init_iio(self):
159158
sensor_type=TYPE_ACCELEROMETER,
160159
vendor="Linux IIO",
161160
version=1,
162-
max_range="±8G (78.4 m/s²)",
163-
resolution="0.0024 m/s²",
164-
power_ma=0.2
161+
max_range="?",
162+
resolution="?",
163+
power_ma=10
165164
),
166165
Sensor(
167166
name="Gyroscope",
168167
sensor_type=TYPE_GYROSCOPE,
169168
vendor="Linux IIO",
170169
version=1,
171-
max_range="±256 deg/s",
172-
resolution="0.002 deg/s",
173-
power_ma=0.7
170+
max_range="?",
171+
resolution="?",
172+
power_ma=10
174173
),
175174
Sensor(
176175
name="Temperature",
177176
sensor_type=TYPE_IMU_TEMPERATURE,
178177
vendor="Linux IIO",
179178
version=1,
180-
max_range="-40°C to +85°C",
181-
resolution="0.004°C",
182-
power_ma=0
179+
max_range="?",
180+
resolution="?",
181+
power_ma=10
183182
)
184183
]
185-
184+
186185
self._load_calibration()
187186

188187
self._initialized = True

0 commit comments

Comments
 (0)