question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
orioldeloscommented, Mar 27, 2020

I have upgraded to micropython-ev3dev2 2.1.0 and the error is fixed.

1reaction
dwalton76commented, Feb 8, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found