AssertionError: odometry_start() must be called to track robot coordinates
See original GitHub issue-
ev3dev version: PASTE THE OUTPUT OF
uname -r
HERE 4.14.96-ev3dev-2.3.2-ev3 -
ev3dev-lang-python version: INSERT ALL VERSIONS GIVEN BY
dpkg-query -l {python3,micropython}-ev3dev*
HERE
||/ Name Version Architecture Description ii micropython-ev 2.0.0 all Python language bindings for ev3d ii python3-ev3dev 1.2.0 all Python language bindings for ev3d ii python3-ev3dev 2.0.0 all Python language bindings for ev3d
I was testing the ev3dev2 libraries and playing with the MoveDifferential odometry. I have the following code:
#!/usr/bin/env micropython
from ev3dev2.motor import LargeMotor, Motor, OUTPUT_C, OUTPUT_D, SpeedPercent, MoveTank, MoveDifferential, SpeedRPM
from ev3dev2.wheel import EV3Tire
from ev3dev2.sensor import INPUT_1
from ev3dev2.sensor.lego import TouchSensor
import logging
logging.basicConfig( level=logging.DEBUG,
format='%(message)s')
steering_drive = MoveDifferential(OUTPUT_D, OUTPUT_C, EV3Tire, 150,None, Motor)
steering_drive.odometry_start()
steering_drive.on_to_coordinates(SpeedRPM(40), 50, 50)
steering_drive.on_to_coordinates(SpeedRPM(40), 50, 70)
steering_drive.on_to_coordinates(SpeedRPM(40), 0, 0)
But when I run it I get the error:
Starting: brickrun --directory="/home/robot/sonar" "/home/robot/sonar/test.py"
Started.
----------
Traceback (most recent call last):
File "/home/robot/sonar/test.py", line 24, in <module>
File "ev3dev2/motor.py", line 2531, in on_to_coordinates
AssertionError: odometry_start() must be called to track robot coordinates
----------
Exited with error code 1.
Which is strange since I am calling the odometry_start method. Is this a bug or am I doing something wrong?
Thanks
ADITIONAL NOTE: I am using micropython and I am not sure to be using the lates version of the ev3dev2 modules. But Can not find how to ensure I have the latest released version installed in my Ev3. Any feedback on how to do it? I tried following the instructions on one of the issues and executed:
sudo apt-get update
sudo apt-get install --only-upgrade python3-ev3dev2 micropython-ev3dev2
But told me I already had the latest version installed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
I have upgraded to micropython-ev3dev2 2.1.0 and the error is fixed.
It is a bug specific to micropython 😦 I have a fix for it as part of https://github.com/ev3dev/ev3dev-lang-python/pull/718/files