vanadiumlabs / pypose

PyPose and NUKE
9 stars 10 forks source link

Terminal doesn't seem to interpret commands at all (Mac OS X) #6

Open fatuhoku opened 11 years ago

fatuhoku commented 11 years ago

I'm using PyPose on a Mac, and the terminal does not function correctly. It

Reproduction:

PyPose Terminal VA.0
>> help
>> mv 1 2
>> whatever
>> you
>> type
>> terminal
>> doesn't
>> care
>> 

(none of the things you type are interpreted as commands.)

I'm using Mac OSX Mountain Lion (10.8) with Homebrew-installed Python, and using wxPython 2.9.4.0 provided by the wxmac Homebrew package. I think it has to do with how lines are grabbed from wx. I'm not Pythonista but when I try to println out the commands it parsed from the TextCtrl, all I get are numbers. No wonder it can't recognise any commands. What's more curious is that no error is thrown.

mikeferguson commented 11 years ago

There is just not enough info here to even begin debugging any potential issue. Do you have permissions to open the port? Have you actually opened the port? Is it at the right baud?

fatuhoku commented 11 years ago

Okay, I've updated the issue description and title.

I have opened the port. The console lines displayed are:

PyPose starting... 
./PyPose.py:412: wxPyDeprecationWarning: Using deprecated class PySimpleApp. 
  app = wx.PySimpleApp()
Opening port: /dev/tty.usbserial-A900gcof
fatuhoku commented 11 years ago

I've added some debug lines to see what's going on with the parsing. The functionality of the original code is unchanged:

# in ArbotixTerminal.py
        ...
        if keycode == wx.WXK_RETURN:
            # process the command!
            lastPos = self.GetLastPosition()
            positions = self.PositionToXY(lastPos)
            line = positions[1]
            print "self.GetLastPosition(): " + repr(lastPos)
            print "self.PositionToXY(lastPos): " + repr(positions)
            print "position: " + repr(line)
            text = self.GetLineText(line)
            print "text: " + repr(text)

            l = text[3:].split(" ")
            print "line: " + repr(l)

            try:
                ...

The console lines now read:

PyPose starting... 
./PyPose.py:412: wxPyDeprecationWarning: Using deprecated class PySimpleApp. 
  app = wx.PySimpleApp()
Opening port: /dev/tty.usbserial-A900gcof
self.GetLastPosition(): 28
self.PositionToXY(lastPos): (8191, 4409303785)
position: 4409303785
text: u''
line: [u'']

I put this down to PositionToXY() not functioning correctly. I have tried again with wxPython2.9-osx-cocoa-py2.7.pkg and a similar problem occurs.

mikeferguson commented 10 years ago

Additional report: http://forums.trossenrobotics.com/showthread.php?7025-PyPose-Arbotix-M-and-Mac-Issue-PyPose-will-can-not-read-servos-1-2-etc