strange heading measurement #1811
Replies: 3 comments 10 replies
-
What do you mean that the heading is wrong? In which way is it different between the methods? |
Beta Was this translation helpful? Give feedback.
-
I think I solved my problem, it doesn't depend on Thank you for this Pybricks software which opens up multiple perspectives to LEGO models. |
Beta Was this translation helpful? Give feedback.
-
Laurens, Do not know if this helps, but I did some measurements with various hubs / versions. The result:
The program printed for a few seconds, but as the results are always the same, I removed the extra print output. Test program and snippet for build 3540from pybricks.tools import wait, StopWatch
from pybricks.hubs import PrimeHub
from pybricks import version
# Initialize the hub.
print(f'define PrimeHub ')
hub = PrimeHub()
print(version)
wait(1000)
print(f'{hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}')
wait(1000)
print(f'{hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}')
wait(1000)
print(f'{hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}')
wait(1000)
print(f'{hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}')
wait(1000)
print(f'{hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}')
wait(1000)
print(f'{hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}') # Snippet to wait for the imu to get ready (it does NOT)
while not hub.imu.ready():
wait(1000)
print(f'{watch.time() % 1000} sec {hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}')
print(f'{watch.time() % 1000} sec {hub.imu.settings()} ready:{hub.imu.ready()} stationary:{hub.imu.stationary()}') Bert |
Beta Was this translation helpful? Give feedback.
-
I am using Audi e-tron Lego 42160 with technic hub and imu.heading() function with the following program
which makes the car do circles:
Why?
I was using "car.drive_power" for slow speeds, because "car.drive_speed" works badly with low speeds (hiccups)
I encountered this problem when programming the odometry (which works relatively well).
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions