Ejemplo n.º 1
0
def sit():
    """ Lowers the chassis to the ground """

    global standing
    standing = False

    for node in nodes:
        xjus.setPositionProfile(node, 500, 10000, 10000)

    for node in nodes:
        move(node, -degToPos(STAND_ANGLE))

    wait()
Ejemplo n.º 2
0
def sit():
	""" Lowers the chassis to the ground """

	global standing
	standing = False

 	for node in nodes:
		xjus.setPositionProfile(node, 500, 10000, 10000)

	for node in nodes:
		move(node, -degToPos(STAND_ANGLE))

	wait()
Ejemplo n.º 3
0
def startTripod(turnAngle=0, back=False, duty_turn=0):
    """ Move to the starting position of the tripod gait and fill the
	    buffer with some initial points. """

    for node in nodes:
        xjus.profilePositionMode(node)
        xjus.setPositionProfile(node, 1500, 10000, 5000)

    print "Moving to start position..."
    for node in nodes:

        [p, v, dt] = getTripodPVT(node,
                                  TIME_OFFSET,
                                  turnAngle=turnAngle,
                                  back=back)

        print("Start position. node: %d, p: %d, v: %d" % (node, p, v))

        #if node in left:
        if back:
            move(node, -p, absolute=True)
        else:
            move(node, p, absolute=True)

    wait()

    for node in nodes:
        xjus.interpolationMode(node)

    # Start time is half of dt
    t = (DT / 1000.) / 2 + TIME_OFFSET

    # fill buffer
    for i in range(BUFFER_MAX_LIMIT / 2):

        [nA, pA, vA, tA] = addTripodPoint(t,
                                          turnAngle,
                                          back=back,
                                          duty_turn=duty_turn)
        addPvtArray(nA, pA, vA, tA)
        t += DT / 1000.

    for node in nodes:
        xjus.startIPM(node)

    xjusAnalysis.startAccel(TRIAL_ID, PLOT_ANALYSIS)
    xjusAnalysis.startAvgVelocity(TRIAL_ID)
    xjusAnalysis.startAvgCurrent(TRIAL_ID, PLOT_ANALYSIS)

    return t
Ejemplo n.º 4
0
def stand():
    """ Raises the chassis into a standing position """

    global standing
    standing = True

    for node in nodes:
        xjus.setPositionProfile(node, 500, 10000, 10000)

    for node in nodes:
        move(node, degToPos(STAND_ANGLE))

    wait()

    for node in nodes:
        xjus.zeroPosition(node)
Ejemplo n.º 5
0
def stand():
	""" Raises the chassis into a standing position """

	global standing
	standing = True

 	for node in nodes:
		xjus.setPositionProfile(node, 500, 10000, 10000)

	for node in nodes:
		move(node, degToPos(STAND_ANGLE))

	wait()
	
	for node in nodes:
		xjus.zeroPosition(node)
Ejemplo n.º 6
0
def startTripod(turnAngle=0, back=False, duty_turn=0):
	""" Move to the starting position of the tripod gait and fill the
	    buffer with some initial points. """

	for node in nodes:
		xjus.profilePositionMode(node)
		xjus.setPositionProfile(node, 1500, 10000, 5000)

	print "Moving to start position..."
	for node in nodes:

		[p, v, dt] = getTripodPVT(node, TIME_OFFSET, turnAngle=turnAngle, back=back)

		print("Start position. node: %d, p: %d, v: %d" % (node, p, v))

		#if node in left:
		if back:
			move(node, -p, absolute=True)
		else:
			move(node, p, absolute=True)

	wait()

	for node in nodes:
		xjus.interpolationMode(node)

	# Start time is half of dt
	t = (DT/1000.) / 2 + TIME_OFFSET

	# fill buffer
	for i in range(BUFFER_MAX_LIMIT/2):

		[nA, pA, vA, tA] = addTripodPoint(t, turnAngle, back=back, duty_turn=duty_turn)
		addPvtArray(nA, pA, vA, tA)
		t += DT/1000.

	for node in nodes:
		xjus.startIPM(node)

	xjusAnalysis.startAccel(TRIAL_ID, PLOT_ANALYSIS)
	xjusAnalysis.startAvgVelocity(TRIAL_ID)
	xjusAnalysis.startAvgCurrent(TRIAL_ID, PLOT_ANALYSIS)

	return t;
Ejemplo n.º 7
0
def moveToFullRotation(node):

    p = getPosition(node)
    targetForward = p + (REV - (p % REV))
    targetBack = p - (p % REV)

    forwardDist = targetForward - p
    backwardDist = p - targetBack

    #print("node: %s, p: %d, forward: %d, back: %d" % (name[node], p, forwardDist, backwardDist))

    xjus.setPositionProfile(node, 1500, 10000, 5000)

    if (backwardDist < REV / 15.):
        #print("moving backward to %d" % targetBack)
        move(node, targetBack, absolute=True)
    else:
        #print("moving forward to %d" % targetForward)
        move(node, targetForward, absolute=True)
Ejemplo n.º 8
0
def moveToFullRotation(node):

	p = getPosition(node)
	targetForward = p + (REV - (p % REV))
	targetBack    = p - (p % REV)

	forwardDist = targetForward - p
	backwardDist = p - targetBack

	#print("node: %s, p: %d, forward: %d, back: %d" % (name[node], p, forwardDist, backwardDist))

	xjus.setPositionProfile(node, 1500, 10000, 5000)

	if (backwardDist < REV/15.):
		#print("moving backward to %d" % targetBack)
		move(node, targetBack, absolute=True)
	else:
		#print("moving forward to %d" % targetForward)
		move(node, targetForward, absolute=True)