Skip to content

Commit

Permalink
Update c2_pub_sub.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Jun 4, 2024
1 parent bec04f0 commit a30cf00
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions skyscan-c2/c2_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,19 @@ def _elevation_check(self: Any, azimuth: float, elevation: float) -> bool:
Returns:
bool: True if the elevation is within the acceptable range
"""

# Check if Occlusion Mapping is enabled
# Occlusion is designed for structures that come up from the horizon and block the view of the camera.
# It doesn't work for overhanging things.
if self.occlusion_mapping_enabled:
for obj in self.occlusion_mapping:
if obj["azimuth"] > azimuth:

# Go through all of the Occlusion Mapping Points
for i, obj in enumerate(self.occlusion_mapping):
# Check if the Azimuth(Pan) is greater or if this is the last point. If it is the last point,
# then we can assume it applies to the end of the pan (360)
if (obj["azimuth"] > azimuth) or (i == len(self.occlusion_mapping) - 1):

# If the Occlusion Point elevation is greater than the current elevation, then it is occluded.
if obj["elevation"] > elevation:
return False
else:
Expand Down

0 comments on commit a30cf00

Please sign in to comment.