Skip to content

Wrong version on ev3? #715

Closed
Closed

Description

@kpu979

Hi.. Newbie here again...

There are a bunch of objects that don't exist on the version I am running. For instance, I get the following error:
AttributeError: 'MoveTank' object has no attribute 'follow_gyro_angle'

All of the odometry objects also gives me the same errors.

How do I get the proper version on my EV3?

  • **ev3dev version: 4.14.96-ev3dev-2.3.2-ev3
  • ev3dev-lang-python version:
    |/ Name Version Architecture Description
    +++-====================================-=======================-=======================-==============================================================================
    ii micropython-ev3dev2 2.0.0beta3 all Python language bindings for ev3dev for MicroPython
    ii python3-ev3dev 1.2.0 all Python language bindings for ev3dev
    ii python3-ev3dev2 2.0.0
    beta3 all Python language bindings for ev3dev

Activity

  1. kpu979 commented on Jan 14, 2020

    @kpu979
    Author

    I finally got the correct version, thanks to another thread.

  2. WasabiFan commented on Jan 14, 2020

    @WasabiFan
    Member

    Sorry I didn't look into this sooner! Could you post what version you upgraded to?

  3. kpu979 commented on Jan 15, 2020

    @kpu979
    Author

    @WasabiFan -- I followed the instructions in issue 712, and downloaded the code in this git. Things seem to work ok, but there are still variances between the code in VS Code and the EV3.

  4. reopened this on Jan 15, 2020
  5. kpu979 commented on Jan 15, 2020

    @kpu979
    Author

    When I run this:
    def mtank():
    mtank = MoveTank(OUTPUT_C, OUTPUT_B)
    mtank.set_polarity('inversed')
    mtank.ramp_up_sp = 2000
    mtank.ramp_down_sp = 2000

    mtank.gyro = GyroSensor()
    Calibrate()
    
    mtank.follow_gyro_angle(
        kp=11.3, ki=0.05, kd=3.2,
        speed=SpeedPercent(30),
        target_angle=0,
        follow_for='follow_for_ms',
        ms=4500
    )
    

    I get this:
    File "/home/robot/vscode-hello-python-master/hello.py", line 168, in mtank
    mtank.follow_gyro_angle(
    AttributeError: 'MoveTank' object has no attribute 'follow_gyro_angle'

  6. kpu979 commented on Jan 16, 2020

    @kpu979
    Author

    I am finding this implementation very difficult to use. there are lots of functions that simply won't work. See above.
    tank.turn_to_angle_gyro: AttributeError: 'MoveTank' object has no attribute 'turn_to_angle_gyro'

    It appears neither MoveTank or movedifferential utilize polarity, ramp up or ramp down.

    Our wheels are on backwards to save space. It is important that on_to_coordinate works moving backwards and forwards. (If you want, I'll elaborate further on the results of going backwards...its not good.)

    I must be doing something wrong and Im at the limit of my knowledge and frustrations. Again, I am new to Python, but not programming (its what I do for a living). I am new to Python on an EV3, and relatively new to Linux administration ( but I do know unix coding). and yeah, im new to git as well.

    I am quite certain that once I understand the implementation and maintenance of ev3de2 on the EV3, I could be a valuable resource to this effort. Im hoping to get assistance with this and a deeper understanding of ev3dev2. As of now , I'm almost ready to pull the plug (or the sim card) and start with just EV3dev.

  7. dwalton76 commented on Jan 16, 2020

    @dwalton76
    Collaborator

    Are you running from VScode on your laptop or are you SSHing to the ev3 and running from there? Until you figure out what is going on I would remove VScode from the equation and just ssh to the ev3.

    When you ssh to the ev3 remember to do

    export PYTHONPATH=/home/robot/ev3dev-lang-python/
    

    that tells python to use the copy of ev3dev-lang-python that you clone from the repository here. If you do not do this then the AttributeError: 'MoveTank' object has no attribute 'follow_gyro_angle' error is expected as that is a really new method for MoveTank that isn't in a release yet.

  8. kpu979 commented on Jan 16, 2020

    @kpu979
    Author

    Do i need to do that export every time I turn on the ev3?

  9. dwalton76 commented on Jan 16, 2020

    @dwalton76
    Collaborator

    You can put that export line in your /home/robot/.bashrc file on your ev3 and then you won't need to enter it everytime.

  10. WasabiFan commented on Jan 16, 2020

    @WasabiFan
    Member

    It sounds like you are referencing the version of the documentation for our in-development unreleased code on GitHub rather than the version of the library you are using. Refer to the "stable" version instead. You can select it in the bottom-right of the documentation page, or directly here: https://python-ev3dev.readthedocs.io/en/stable/index.html.

  11. WasabiFan commented on Jan 16, 2020

    @WasabiFan
    Member

    Our wheels are on backwards to save space. It is important that on_to_coordinate works moving backwards and forwards. (If you want, I'll elaborate further on the results of going backwards...its not good.)

    Can you open a new issue for this and describe the problem in more detail there?

  12. kpu979 commented on Jan 16, 2020

    @kpu979
    Author

    Thank you both for the quick feedback. Im ok with using the test versions as they have the potential for using the gyro sensor. (Granted, I could code all of that as well ;) )

    Im also ok knowing that this is under testing conditions, and for what Im doing, I can help with the testing. For instance, I just downloaded the latest version if this code, implemented the export into the bashrc file, and the function now is recognized, but not working:
    mtank.turn_degrees(20,90)
    File "/home/robot/ev3dev-lang-python/ev3dev2/motor.py", line 2267, in turn_degrees
    speed_native_units = speed.to_native_units(self.left_motor)
    AttributeError: 'int' object has no attribute 'to_native_units'

  13. dwalton76 commented on Jan 16, 2020

    @dwalton76
    Collaborator

    Can you open an issue for this error, this is a bug. You can get around it by doing

    from ev3dev2.motor import SpeedPercent
    mtank.turn_degrees(SpeedPercent(20), 90)
    
  14. kpu979 commented on Jan 17, 2020

    @kpu979
    Author

    Thank you @dwalton76 , that worked, and I opened a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions