Skip to content

Commit

Permalink
good changes for day 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanzemlin committed Jun 2, 2024
1 parent a4098b8 commit 1bd99ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion autonav_ws/src/autonav_nav/src/astar.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
CV_BRIDGE = cv_bridge.CvBridge()

competition_waypoints = [
[(42.6682623, -83.2193709), (42.6681206, -83.2193606), (42.6680766, -83.2193592), (42.6679277, -83.2193276), (42.668130236144883, -83.21889785301433)], # NORTH
[(42.6682623, -83.2193709), (42.6681206, -83.2193606), (42.6680766, -83.2193592), (42.6679277, -83.2193276), (42.6679216, -83.2189126), (42.668130236144883, -83.21889785301433)], # NORTH
[(42.668086, -83.218446)], #
[]
]
Expand Down Expand Up @@ -168,6 +168,7 @@ def create_path(self):

cv2.circle(cvimg, (self.best_pos[0], self.best_pos[1]), 1, (255, 0, 0), 1)
cvimg = cv2.resize(cvimg, (320, 320), interpolation=cv2.INTER_NEAREST)

# Draw a grid on the image that is the scale of the original image, so it should be a 80x80 grid scaled up 4x
for i in range(80):
cv2.line(cvimg, (0, i * 4), (320, i * 4), (85, 85, 85), 1)
Expand Down
8 changes: 4 additions & 4 deletions autonav_ws/src/autonav_serial/src/serial_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def canThreadWorker(self):
continue
if self.can is not None:
try:
msg = self.can.recv(timeout=1)
msg = self.can.recv(timeout=0.01)
if msg is not None:
self.onCanMessageReceived(msg)
except can.CanError:
Expand Down Expand Up @@ -166,14 +166,14 @@ def onCanMessageReceived(self, msg):

def canWorker(self):
try:
with open("/dev/autonav-can-835", "r") as f:
with open("/dev/ttyACM0", "r") as f:
pass

if self.can is not None:
return

self.can = can.ThreadSafeBus(
bustype="slcan", channel="/dev/autonav-can-835", bitrate=100000)
bustype="slcan", channel="/dev/ttyACM0", bitrate=100000)
self.set_device_state(DeviceStateEnum.OPERATING)
except:
if self.can is not None:
Expand All @@ -189,7 +189,7 @@ def onSafetyLightsReceived(self, lights: SafetyLights):
packed_data = SafetyLightsPacket()
packed_data.autonomous = lights.autonomous
packed_data.eco = False
packed_data.mode = 0
packed_data.mode = 0 if not lights.autonomous else 2
packed_data.brightness = lights.brightness
packed_data.red = lights.red
packed_data.green = lights.green
Expand Down
4 changes: 2 additions & 2 deletions autonav_ws/src/autonav_vision/src/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def apply_hsv(self, img):
upper = (self.config.upper_hue, self.config.upper_sat, self.config.upper_val)
mask1 = cv2.inRange(img, lower, upper)

lower = (70, 128, 80)
upper = (145, 255, 255)
lower = (110, 180, 110)
upper = (145, 255, 180)
mask2 = cv2.inRange(img, lower, upper)
epic_mask = cv2.add(mask1, mask2)

Expand Down

0 comments on commit 1bd99ff

Please sign in to comment.