Results 1 to 2 of 2

Thread: Problem interfacing to PyPose on Arbotix controller from vanilla Python over FTDI

  1. Question Problem interfacing to PyPose on Arbotix controller from vanilla Python over FTDI

    Hi,
    I'm the new proud owner of a PhantomX turret.
    I'm able to run PyPose.py and store/play poses, sequences, etc.
    But I'd like to interface directly from a python 2.7 script like below, which should simply relax one of my two Dynamixels.

    #!/usr/bin/env python
    import time, sys, serial

    from ax12 import *
    from driver import Driver
    from ax12 import P_MOVING, P_GOAL_SPEED_L


    print("Turret example starting... ")


    try:
    driver = Driver(port="/dev/tty.usbserial-AI05H2WC", baud=38400, interpolation=True, direct=False)
    print 'Opened port {} at {} baud'.format( port, baud)
    except:
    print('Could Not Open Port ' + port, 0)
    sys.exit()

    print("relaxing servos...")

    driver.setReg(1,24,[0])


    It almost works, but the serial response always times out in Driver.getPacket at
    d = self.ser.read()
    Turret example starting...
    *Driver __init__(port=/dev/tty.usbserial-AI05H2WC,baud=38400,interpolation=True,direct=Fals e
    Opened port /dev/tty.usbserial-AI05H2WC at 38400 baud
    *Driver.setReg(index=1,regstart=24,values=[0]
    *Driver.execute
    prefix: FF FF index(1) length(4) ins(3) param_val(24) param_val(0) checksum(223)
    *Driver.getPacket
    Fail Read



    (I've added the debug messages in teal, but "Fail Read" is printed by Driver.getPacket())
    I've tried lengthening the ser.timeout, and I'm debug printing exactly the same hex ser.write(.) from Driver.execute.

    First - am I trying to do something stupid? Obviously pypose.ino was made to be used with PyPose.py. I don't want to go to ROS, but maybe there's some other Arbotix controller code meant to interface to a linux host running python over FTDI?

    Second - assuming this should work, I'm sort of at my wit's end. I think I've stared at it too long. Is there some way to split this problem?

    Thanks for any advice!

  2. Re: Problem interfacing to PyPose on Arbotix controller from vanilla Python over FTDI

    I figured it out. The Arbotix controller, (just like any Arduino?) reboots when establishing a serial connection.
    It works like a champ after I put a 7 second delay after instantiating the Driver object:
    ...
    driver = Driver(port="/dev/tty.usbserial-AI05H2WC", baud=38400, interpolation=True, direct=False)
    time.sleep(7)
    ...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Arbotix-M to PC - FTDI/USB Serial communication issue
    By praveenram in forum Software and Programming
    Replies: 0
    Last Post: 10-28-2016, 07:49 PM
  2. Question(s) Which Python and wxPython versions for Windows for PyPose?
    By siempre.aprendiendo in forum Software and Programming
    Replies: 1
    Last Post: 08-11-2014, 05:34 PM
  3. Replies: 6
    Last Post: 07-25-2014, 04:15 AM
  4. Arbotix upload Problem (miffed bootloader?) and pypose.
    By billtown in forum Software and Programming
    Replies: 1
    Last Post: 08-05-2011, 12:35 AM
  5. Question(s) Arbotix FTDI command problem
    By sarendt in forum Software and Programming
    Replies: 2
    Last Post: 03-14-2011, 01:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •