def getVisible(self, pos, sat): for iss in sat: iss.compute(self.place) bad = abs(np.random.normal(0, 3000, 1)) if float(repr(iss.alt)) > 15.0 * pi / 180.0 and float(repr(iss.alt)) < pi / 2.0 and not bad >= 9900: possat = lla2ECEF(iss.sublat, iss.sublong, iss.elevation, Geoid.EARTH_radius, _earth_E) self.sats.sat[self.sats.visible].position.x = possat.x self.sats.sat[self.sats.visible].position.y = possat.y self.sats.sat[self.sats.visible].position.z = possat.z self.sats.sat[self.sats.visible].range = vectornorm(possat, pos) self.sats.visible = self.sats.visible + 1 self.measurement.satellites = self.sats.visible
def getVisible(self, pos, sat): for iss in sat: iss.compute(self.place) bad = abs(np.random.normal(0, 3000, 1)) if float(repr(iss.alt)) > 15.0 * pi / 180.0 and float(repr( iss.alt)) < pi / 2.0 and not bad >= 9900: possat = lla2ECEF(iss.sublat, iss.sublong, iss.elevation, Geoid.EARTH_radius, _earth_E) self.sats.sat[self.sats.visible].position.x = possat.x self.sats.sat[self.sats.visible].position.y = possat.y self.sats.sat[self.sats.visible].position.z = possat.z self.sats.sat[self.sats.visible].range = vectornorm( possat, pos) self.sats.visible = self.sats.visible + 1 self.measurement.satellites = self.sats.visible
def iterate(self, states): self.measurement.fix = 0 self.place.lat = states.geoid.latitude self.place.long = states.geoid.longitude self.place.elevation = states.geoid.altitude self.place.date = datetime.datetime.now() pos = lla2ECEF(self.place.lat, self.place.long, self.place.elevation, Geoid.EARTH_radius, _earth_E) self.sats.visible = 0 self.getVisible(pos, self.sat_sbas) k = self.sats.visible self.getVisible(pos, self.sat_gpsop) self.setNoise() self.getPosition(k) self.getdop(self.position) self.calculateMeas()