Exemple #1
0
def connect_all():
    global axis0, axis1, axis2, axes
    for ii in range(len(odrvs)):
        if usb_serials[ii] == None:
            continue
        print("finding odrive: " + usb_serials[ii] + "...")
        #        odrvs[ii]= odrive.find_any(serial_number=usb_serials[ii], timeout=30,logger=Logger(verbose=True))
        #         odrvs[ii] = odrive_interface.ODriveInterfaceAPI(logger=Logger(verbose=True))
        odrvs[ii] = odrive_interface.ODriveInterfaceAPI()

        #        odrvs[ii].connect(serial_number=usb_serials[ii], timeout=30)
        #        odrvs[ii].connect(serial_number=usb_serials[ii], timeout=30)
        #        odrvs[ii]= odrive.find_any(timeout=10)

        print("found odrive! " + str(ii))

    odrvs[0].connect(serial_number="2087378B3548", timeout=30)
    axis0 = odrvs[0].driver.axis0
    # axis1 = odrvs[1].axis0
    # axis2 = odrvs[1].axis1
    # axes[0] = axis0
    # axes[1] = axis1
    # axes[2] = axis2
    axes = [axis0]
#!/usr/bin/env python

import rospy

from std_msgs.msg import Float32MultiArray, Int8, Bool

from odrive_ros import odrive_interface
bot = odrive_interface.ODriveInterfaceAPI()

import kinematicsSolverEdited as kin
from time import sleep
import Queue

deltaKin = kin.deltaSolver()

pi = 3.1415
balRad = 1.25  # inches
pizRad = 4.0  # inches
tab = 70  # inches

in2mm = 25.4
mm2in = 1 / in2mm
in2m = in2mm / 1000

#Operating heights
#zhome = -680 #mm
#ztable = -795 #mm
#zdrop = -750 #mm

# Testing parameters:
zhome = -750
Exemple #3
0
from odrive_ros import odrive_interface
import time

od = odrive_interface.ODriveInterfaceAPI(1)
od.connect()
od.calibrate()
od.engage()

od.drive(0, 1000)

time.sleep(5)

od.drive(0, 0)
od.release()

print("finished")