-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJoyPython2
More file actions
19 lines (16 loc) · 705 Bytes
/
Copy pathJoyPython2
File metadata and controls
19 lines (16 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from pyjop import *
SimEnv.connect()
#get a reference to the conveyor belt
conv = ConveyorBelt.find("_entityConveyorBelt0")
#get a reference to the range scanner
scanner = RangeFinder.find("_entityRangeFinder0")
while SimEnv.run_main():
# add your code within this loop. mind the indendation
# hints:
# use variable conv to control "_entityConveyorBelt0"
# use variable scanner to control "_entityRangeFinder0"
# read the RFID tag scanned by scanner
tag = scanner.get_rfid_tag()
# if the tag is "Box" set conv's target_speed backwards (e.g. -2.0)
# elif the tag is "Barrel", set it forwards (e.g. 2.0)
# else (tag is empty / no tag) set conv's target_speed to 0