Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build and visualization for Python 3.8 #1

Open
wants to merge 2 commits into
base: python3
Choose a base branch
from

Conversation

cmigliorini
Copy link

@cmigliorini cmigliorini commented Jul 14, 2020

I was able to run this with Python 3.8 on a Catalina macOs, and to get Visualization working.

Still, apparently other stuff is broken, but I don't really know what I'm doing robot-wise.

To get there, I had to freeze wxPython to 4.0.7 as access to 2.8.12 is really not practical, and 4.1 breaks more things. As a consequence there is a good chance it'll never run under Python2 again, I did not even try.

If you think this must still be compatible with Python2, I can give it a go, but I'd rather fix more Python3-related issues.

@cmigliorini cmigliorini force-pushed the python3 branch 2 times, most recently from 504b0c0 to 09d3273 Compare July 14, 2020 13:44
@cmigliorini
Copy link
Author

IGM - Pieper method is broken

Traceback (most recent call last):
  File "/Users/migperso/dev/symoro/symoroui/layout.py", line 1036, in OnIgmPieper
    model_symo = pieper.igm_pieper(self.robo, lst_T, n)
  File "/Users/migperso/dev/symoro/pysymoro/pieper.py", line 288, in igm_pieper
    _pieper_solve(robo, symo)
  File "/Users/migperso/dev/symoro/pysymoro/pieper.py", line 60, in _pieper_solve
    XXXRRR(robo,symo,com_key,X_joints,pieper_joints)
  File "/Users/migperso/dev/symoro/pysymoro/pieper.py", line 341, in XXXRRR
    solve_position(robo, symo, com_key, X_joints, fc, fs, fr, f0, g)
  File "/Users/migperso/dev/symoro/pysymoro/invdata.py", line 975, in solve_position
    dj_eq_0(robo, symo, X_joints, tc, ts, tr, t0, G, offset)
  File "/Users/migperso/dev/symoro/pysymoro/invdata.py", line 124, in dj_eq_0
    a = 2*(tc[x]*t1[x] + tc[y]*t1[y] + tc[z]*t1[z])
TypeError: 'Symbol' object is not subscriptable

@cmigliorini
Copy link
Author

Could not get the zoom function to work properly, when holding both mouse buttons I get

wx._core.wxAssertionError: C++ assertion "!wxMouseCapture::IsInCaptureStack(this)" failed at /Users/robind/projects/bb2/dist-osx-py38/build/ext/wxWidgets/src/common/wincmn.cpp(3271) in CaptureMouse(): Recapturing the mouse in the same window?

@cmigliorini
Copy link
Author

cmigliorini commented Jul 14, 2020

Regarding residual issue you had on IGM - Paul frame 7 :

Traceback (most recent call last):
  File "/Users/migperso/dev/symoro/symoroui/layout.py", line 1023, in OnIgmPaul
    model_symo = invgeom.igm_paul(self.robo, lst_T, n)
  File "/Users/migperso/dev/symoro/pysymoro/invgeom.py", line 178, in igm_paul
    _paul_solve(robo, symo, T_ref, 0, n)
  File "/Users/migperso/dev/symoro/pysymoro/invgeom.py", line 38, in _paul_solve
    chain = robo.loop_chain(m, n)
  File "/Users/migperso/dev/symoro/pysymoro/robot.py", line 590, in loop_chain
    k = self.common_root(i, j)
  File "/Users/migperso/dev/symoro/pysymoro/robot.py", line 613, in common_root
    u = self.chain(i)
  File "/Users/migperso/dev/symoro/pysymoro/robot.py", line 586, in chain
    j = self.ant[j]
IndexError: list index out of range

I should point out that Robot constructor initializes ant with

        # Index of antecedent joint: list of int.
        self.ant = list(range(-1, self.NF - 1))

Which creates a (7)-long array [-1, 0, 1, 2, 3, 4, 5]. Hence later calling self.ant[j] with j==7 obviously can't work. I don't know your code base enough to know whether it's a simple 0-based vs 1-based indexing issue, or if it has a deeper cause.

@cmigliorini
Copy link
Author

Which creates a (7)-long array [-1, 0, 1, 2, 3, 4, 5]. Hence later calling self.ant[j] with j==7 obviously can't work. I don't know your code base enough to know whether it's a simple 0-based vs 1-based indexing issue, or if it has a deeper cause.

It could also be that self.NF should really be 7, not 6 ?

@cmigliorini
Copy link
Author

It could also be that self.NF should really be 7, not 6 ?

matter of fact, rx90 does define only 6 frames.

def rx90():
    """Generate Robot instance of RX90"""
    robo = Robot('RX90', 6, 6, 6, False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant