0

Using lego nxt with color sensor and ultrasonic sensor. Trying to create a soccer control loop which controls the lego nxt to behave like it is playing football in a rectangular wooden built football field with 4 side walls and two goals.I have the following three methods: 1. turn_to ball 2. move_to ball 3. kick_ball

and i am passing the coordinates in a loop:

screenw = 0
screenh = 0
while 1:
    client_socket.send("loc\n")
    data = client_socket.recv(8192)
    valueList = data.split()

    if (not(valueList[-1] == "eom" and valueList[0] == "start")):
        #print "continuing.."
            continue

        if(screenw != int(valueList[2])):
            screenw = int(valueList[2])
            screenh = int(valueList[3])

How do i create a soccer control loop that runs these three methods turn_to ball, move to ball and kick ball in a loop given that it will avoid collision with walls?

Edward
  • 93
  • 10
  • It looks like your method name `turn_to ball` has a space in it. Is that the actual name? – Kevin Oct 03 '12 at 12:36
  • Your question is an interesting one, but defies a simple answer. I highly recommend taking this [free online Udacity course on programming driverless cars](http://www.udacity.com/overview/Course/cs373). In particular, the lecture on [PID control](http://www.udacity.com/view#Course/cs373/CourseRev/apr2012/Unit/513063/Nugget/510049). – unutbu Oct 03 '12 at 12:40

0 Answers0