Skip to content

AttributeError: 'PoseVector' object has no attribute 'tolist' #117

Open

Description

@YHt666

The python version is 3.11. The problem is as follows:
C:\Users\YHT.conda\envs\ur5py311\python.exe E:/UR/myproj1/test.py
tried 11 times to find a packet in data, advertised packet size: -2, type: 3
Data length: 44
tried 11 times to find a packet in data, advertised packet size: -2, type: 3
Data length: 68
tried 11 times to find a packet in data, advertised packet size: -2, type: 3
Data length: 1092
tried 11 times to find a packet in data, advertised packet size: -2, type: 3
Data length: 1418
Traceback (most recent call last):
File "E:\UR\myproj1\test.py", line 10, in
pose = rob.getl() # x,y,z,rx,ry,rz
^^^^^^^^^^
File "C:\Users\YHT.conda\envs\ur5py311\Lib\site-packages\urx\robot.py", line 211, in getl
return t.pose_vector.tolist()
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PoseVector' object has no attribute 'tolist'

Activity

  1. TrinhNC commented on Sep 26, 2023

    @TrinhNC

    got the same error. have you solved it?

  2. MathijsNL commented on Sep 28, 2023

    @MathijsNL

    I also got this error.

    It seems related to the addition of the math3d library. The following function will also give an error:

    rob.getl()
    

    It seems in general there has been some degradation in working with tposes. I will try to dive into it somewhere this or next week.

  3. MathijsNL commented on Sep 28, 2023

    @MathijsNL

    In the meantime, downgrading to version 0.8.2 works fine if you change this line to False:

    MATH3D = False
    
  4. axi92 commented on Oct 24, 2023

    @axi92

    When you change this line https://github.com/SintefManufacturing/python-urx/blob/0.11.0/urx/robot.py#L211
    to:
    return t.pose_vector.get_array().tolist()
    it works again.

  5. jorge5a commented on Nov 3, 2023

    @jorge5a

    It didn't works with this change
    return t.pose_vector.get_array().tolist()

    I use the last version. Another idea?

  6. YHt666 commented on Nov 4, 2023

    @YHt666
    Author

    I have chosen another package called Universal_Robots_ROS_Driver. No problems so far. You can try it out. Good luck!

  7. FLandolt commented on Nov 20, 2023

    @FLandolt

    In the meantime, downgrading to version 0.8.2 works fine if you change this line to False:

    MATH3D = False
    

    HI this worked but have you found a better solution in the mean time ? :D

  8. n4z3r commented on Nov 21, 2023

    @n4z3r

    Please fix!! I got it too

  9. n4z3r commented on Nov 21, 2023

    @n4z3r

    In the meantime, downgrading to version 0.8.2 works fine if you change this line to False:

    MATH3D = False
    

    HI this worked but have you found a better solution in the mean time ? :D

    This does not allow movej to work. It lets movel to work though. We need all functionality please.

  10. se-hwan commented on Dec 12, 2023

    @se-hwan

    Also had this issue, but fixed it in urx version 0.11.0 with the following fix:

    In addition to the fix here: #117 (comment), which addresses using the getl() method, this should address using the movel() and translate() methods for the UR5 arms.

    Change this line:

    prog = self._format_move(command, tpose, acc, vel, prefix="p")

    to this: prog = self._format_move(command, tpose.array, acc, vel, prefix="p")

    Similarly, modify this line:

    self._wait_for_move(tpose[:6], threshold=threshold)

    to this: self._wait_for_move(tpose.array[:6], threshold=threshold)

    tpose seems to originally have been some iterable data structure, but is now a PoseVector class from the m3d package. Calling the array method on this class returns an iterable list, which is what the urx methods seem to expect.

    It's likely you'll get a constant stream of terminal output warning about deprecation with the dist_squared() function. I commented out this warning in line 280 of vector.py in the math3d package (wherever it is in your virtual environment, system folder, etc.) to suppress this.

    I tested that the movel() and translate() functions work, but it still causes an error with the translate_tool() function. Generally, I think a lot of code needs to be refactored to make everything work smoothly with the m3d libraries, but hope this helps.

  11. zp2546265641 commented on Jul 18, 2024

    @zp2546265641

    Also had this issue, but fixed it in urx version 0.11.0 with the following fix:

    In addition to the fix here: #117 (comment), which addresses using the getl() method, this should address using the movel() and translate() methods for the UR5 arms.

    Change this line:

    prog = self._format_move(command, tpose, acc, vel, prefix="p")

    to this: prog = self._format_move(command, tpose.array, acc, vel, prefix="p")
    Similarly, modify this line:

    self._wait_for_move(tpose[:6], threshold=threshold)

    to this: self._wait_for_move(tpose.array[:6], threshold=threshold)
    tpose seems to originally have been some iterable data structure, but is now a PoseVector class from the m3d package. Calling the array method on this class returns an iterable list, which is what the urx methods seem to expect.

    It's likely you'll get a constant stream of terminal output warning about deprecation with the dist_squared() function. I commented out this warning in line 280 of vector.py in the math3d package (wherever it is in your virtual environment, system folder, etc.) to suppress this.

    I tested that the movel() and translate() functions work, but it still causes an error with the translate_tool() function. Generally, I think a lot of code needs to be refactored to make everything work smoothly with the m3d libraries, but hope this helps.
    great work you do! happy!

  12. feixiao98 commented on Nov 4, 2025

    @feixiao98

    Also had this issue, but fixed it in urx version 0.11.0 with the following fix:

    In addition to the fix here: #117 (comment), which addresses using the getl() method, this should address using the movel() and translate() methods for the UR5 arms.

    Change this line:

    python-urx/urx/urrobot.py

    Line 313 in c5dba85

    prog = self._format_move(command, tpose, acc, vel, prefix="p")

    to this: prog = self._format_move(command, tpose.array, acc, vel, prefix="p")
    Similarly, modify this line:

    python-urx/urx/urrobot.py

    Line 316 in c5dba85

    self._wait_for_move(tpose[:6], threshold=threshold)

    to this: self._wait_for_move(tpose.array[:6], threshold=threshold)
    tpose seems to originally have been some iterable data structure, but is now a PoseVector class from the m3d package. Calling the array method on this class returns an iterable list, which is what the urx methods seem to expect.

    It's likely you'll get a constant stream of terminal output warning about deprecation with the dist_squared() function. I commented out this warning in line 280 of vector.py in the math3d package (wherever it is in your virtual environment, system folder, etc.) to suppress this.

    I tested that the movel() and translate() functions work, but it still causes an error with the translate_tool() function. Generally, I think a lot of code needs to be refactored to make everything work smoothly with the m3d libraries, but hope this helps.

    thank you
    pip uninstall math3d
    pip install math3d==3.0.0
    I try this and it works well

  13. samyk commented on Jan 21, 2026

    @samyk
    Contributor

    There are several more bugs like this, especially when using math3d v4. Looks like repo isn't maintained anymore so allPoseVector related bugs I ran into are fixed here: https://github.com/samyk/python-urx/

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