1: procedure ContactDetection
|
2:
|
3: repeat
|
4:
|
5: if
then
|
6: Possible Contact ← true
|
7:
|
8: else
|
9: Possible Contact ← false
|
10:
|
11: end if
|
12: if Possible Contact == true
then
|
13: if
then
|
14: if
then
|
15: Contact Triggered X+ ← true
|
16: else
|
17: Contact Triggered X- ← true
|
18: end if
|
19: end if
|
20: if
then
|
21: if
then
|
22: Contact Triggered Y+ ← true
|
23: else
|
24: Contact Triggered Y- ← true
|
25: end if
|
26: end if
|
27: end if
|
28: until Reset == true
|
29: return
true
|
30: end procedure
|