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

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

Open
fatuhoku opened this issue May 17, 2013 · 4 comments
Open

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

fatuhoku opened this issue May 17, 2013 · 4 comments

Comments

@fatuhoku
Copy link
Contributor

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

Reproduction:

  • upload pypose sketch onto Arbotix
  • check out PyPose master from this repository
  • run Pypose under Mountain Lion
  • go to config and port; select the USB port for the ArbotiX controller (for me, this is /dev/tty.usbserial-A900gcf)
    • ArbotiX LED flashes a few times at this point
  • launch terminal
  • type anything at all; you will get absolutely no response from the terminal

Example

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
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

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

No branches or pull requests

2 participants