mirror of
https://github.com/OSURoboticsClub/Rover_2017_2018.git
synced 2025-11-09 02:31:14 +00:00
Cone to point to heading, I think?
This commit is contained in:
@@ -401,18 +401,26 @@ class OverlayImage(object):
|
|||||||
|
|
||||||
return int(x), int(y)
|
return int(x), int(y)
|
||||||
|
|
||||||
def update_new_location(self, latitude, longitude):
|
def update_new_location(self, latitude, longitude, compass):
|
||||||
self._draw_rover(latitude, longitude, 10)
|
self._draw_rover(latitude, longitude, 10, compass)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
return self.display_image
|
return self.display_image
|
||||||
|
|
||||||
def _draw_rover(self, lat, lon, size):
|
def _draw_rover(self, lat, lon, size, scaler):
|
||||||
x, y = self._get_cartesian(lat, lon)
|
x, y = self._get_cartesian(lat, lon)
|
||||||
draw = PIL.ImageDraw.Draw(self.big_image)
|
draw = PIL.ImageDraw.Draw(self.big_image)
|
||||||
draw.ellipsis((x-size, y-size, x+size, y+size), (255, 255, 255, 0))
|
draw.ellipsis((x-size, y-size, x+size, y+size), (255, 255, 255, 0))
|
||||||
draw.line(x-size, y-size, x+size, y+size, (255, 255, 255, 0), 25)
|
draw.line(
|
||||||
draw.line(x+size, y+size, x+2*size, y+2*size, (255, 255, 255, 0), 25)
|
math.cos(x-2*size * scaler),
|
||||||
|
math.sin(y * scaler),
|
||||||
|
math.cos(x * scaler),
|
||||||
|
math.sin(y+2*size * scaler), (255, 255, 255, 0), 25)
|
||||||
|
draw.line(
|
||||||
|
math.cos(x+2*size * scaler),
|
||||||
|
math.sin(y * scaler),
|
||||||
|
math.cos(x * scaler),
|
||||||
|
math.sin(y+2*size * scaler), (255, 255, 255, 0), 25)
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
self.display_image.paste(self.big_image, (-self.left_x, -self.upper_y))
|
self.display_image.paste(self.big_image, (-self.left_x, -self.upper_y))
|
||||||
|
|||||||
Reference in New Issue
Block a user