Skip to content

Commit

Permalink
mavpicviewer: use definitions for colours
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Oct 8, 2024
1 parent f3577ef commit cfa0c72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MAVProxy/tools/mavpicviewer/mavpicviewer_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def update_image(self):
# add POI rectangles to image
if self.filenumber in self.poi_dict.keys():
poi = self.poi_dict.get(self.filenumber)
cv2.rectangle(image, (poi.pos1.X, poi.pos1.Y), (poi.pos2.X, poi.pos2.Y), (255, 0, 0), 2)
cv2.rectangle(image, (poi.pos1.X, poi.pos1.Y), (poi.pos2.X, poi.pos2.Y), mpv.RGB_RED, 2)

# load exif data
self.lat, self.lon, self.alt_amsl, self.terr_alt, \
Expand Down Expand Up @@ -392,15 +392,15 @@ def update_map(self):

projection1 = self.cam1_projection.get_projection(self.lat, self.lon, self.alt_amsl, self.roll, self.pitch, self.yaw)
if projection1 is not None and self.sm is not None:
self.sm.add_object(mp_slipmap.SlipPolygon('projection1', projection1, layer=1, linewidth=2, colour=(0, 255, 0)))
self.sm.add_object(mp_slipmap.SlipPolygon('projection1', projection1, layer=1, linewidth=2, colour=mpv.RGB_GREEN))
else:
print(prefix_str + "failed to add projection to map")

# add a rectangle specified by two locations to the map
def add_rectangle_to_map(self, name, lat1, lon1, lat2, lon2):
if self.sm is not None:
rect = [(lat1, lon1), (lat1, lon2), (lat2, lon2), (lat2, lon1), (lat1, lon1)]
self.sm.add_object(mp_slipmap.SlipPolygon(name, rect, layer=1, linewidth=2, colour=(255, 0, 0)))
self.sm.add_object(mp_slipmap.SlipPolygon(name, rect, layer=1, linewidth=2, colour=mpv.RGB_RED))

# remove a rectangle from the map
def remove_rectangle_from_map(self, name):
Expand Down

0 comments on commit cfa0c72

Please sign in to comment.