Ejemplo n.º 1
0
def diff_control(gas, steering):
    # if car is not moving
    if -0.03 <= gas <= 0.03:
        steering_power = steering * 100
        moveLeft(-steering_power)
        moveRight(steering_power)
        # if car is moving
    else:
        if abs(steering) <= 0.2:
            moveLeft(gas * 100)
            moveRight(gas * 100)
        elif steering > 0:
            moveLeft((1 - steering) * gas * 100)
            moveRight(gas * 100)
        else:
            moveLeft(gas * 100)
            moveRight(gas * (1 + steering) * 100)
Ejemplo n.º 2
0
def rightMotor(msg):	
	moveRight(msg.axes[3]*100)
Ejemplo n.º 3
0
from control_motor import moveLeft
from control_motor import moveRight


i=0
while (i != 100):
	left,right=raw_input("command: ").split()
	left, right = [int(left), int(right)]
	moveLeft(left)
	moveRight(right)
	i=i+1
	

Ejemplo n.º 4
0
def rightMotor(msg):	
	moveRight(msg.axes[1]*100)
Ejemplo n.º 5
0
def rightMotor(msg):	
	moveRight(msg.velocity[0]*100)