-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesson3Activity4.py
More file actions
24 lines (20 loc) · 924 Bytes
/
Copy pathlesson3Activity4.py
File metadata and controls
24 lines (20 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from lib.Controller import UDP_Controller
import time
controller = UDP_Controller()
controller.addVariable("sensor", "str", "")
controller.addVariable("left_speed", "float", 0)
controller.addVariable("right_speed", "float", 0)
controller.start()
# All Code Should be written inside these lines
#######################################################################################
# finish this function
# first check to make sure that the parameter speed is greater than 0. If it is less than 0 return
# then set both 'left_speed' and 'right_speed' to be equal to speed.
def forward(speed):
return
# once you have finished writing the function, run this python script and then start the Simumatik
# if the function is working you should see the rover begin to move
#######################################################################################
if __name__ == '__main__':
while True:
forward(3)