Skip to content

Commit 220eecb

Browse files
committed
Try to ignore the top and bottom rows of pixels in the pushbot light follower example.
1 parent a26f528 commit 220eecb

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

examples/external_devices_examples/pushbot_light_follower.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@
112112
# Last column of the right-side column group
113113
end_of_right = retina_resolution.value.pixels
114114

115+
# First row to consider in any group of pixels (i.e. ignore bright top lights)
116+
start_row = 30
117+
118+
# Last row to consider in any group of pixels (i.e. ignore bright bottom lights)
119+
end_row = retina_resolution.value.pixels - 30
120+
115121
# Connection weights for this connection list
116122
w_conn = 0.2
117123

@@ -123,9 +129,15 @@
123129

124130
# Determines which neuron IDs are on the left group
125131
id_to_left = (arr % retina_resolution.value.pixels) < end_of_left
132+
id_to_left = (
133+
(arr // retina_resolution.value.pixels >= start_row)
134+
& (arr // retina_resolution.value.pixels < end_row)) & id_to_left
126135

127136
# Determines which neuron IDs are on the right group
128137
id_to_right = (arr % retina_resolution.value.pixels) >= start_of_right
138+
id_to_right = (
139+
(arr // retina_resolution.value.pixels >= start_row)
140+
& (arr // retina_resolution.value.pixels < end_row)) & id_to_right
129141

130142
# Extracts the neuron IDs to be connected to the left neuron of driver_pop
131143
id_to_left = numpy.extract(id_to_left, arr)

0 commit comments

Comments
 (0)