Skip to content

Commit

Permalink
#468 Do not use invalid base station positions
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Feb 15, 2021
1 parent 69a88e8 commit 2cbd70e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/cfclient/ui/dialogs/lighthouse_bs_geometry_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ def headerData(self, col, orientation, role=None):
return QVariant()

def _compile_entry(self, current_geo, estimated_geo, index):
result = '-'
if current_geo is not None:
result = 'N/A'
if current_geo is not None and current_geo.valid:
result = '%.2f' % current_geo.origin[index]
if estimated_geo is not None:
if estimated_geo is not None and estimated_geo.valid:
result += ' -> %.2f' % estimated_geo.origin[index]

return result
Expand Down
8 changes: 7 additions & 1 deletion src/cfclient/ui/tabs/lighthouse_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ class Plot3dLighthouse(scene.SceneCanvas):

TEXT_OFFSET = np.array((0.0, 0, 0.25))

NO_POSITION = np.array((0.0, 0.0, 0.0))
NO_ROTATION_MATRIX = np.eye(3, 3)

def __init__(self):
scene.SceneCanvas.__init__(self, keys=None)
self.unfreeze()
Expand Down Expand Up @@ -225,7 +228,10 @@ def update_base_station_geos(self, geos):
if (geo is not None) and (id not in self._base_stations):
self._base_stations[id] = MarkerPose(self._view.scene, self.BS_BRUSH_NOT_VISIBLE, text=f"{id}")

self._base_stations[id].set_pose(geo.origin, geo.rotation_matrix)
if geo.valid:
self._base_stations[id].set_pose(geo.origin, geo.rotation_matrix)
else:
self._base_stations[id].set_pose(self.NO_POSITION, self.NO_ROTATION_MATRIX)

def update_base_station_visibility(self, visibility):
for id, bs in self._base_stations.items():
Expand Down

0 comments on commit 2cbd70e

Please sign in to comment.