Beispiel #1
0
    def handlelocationevent(self, rxnemid, eid, data):
        """
        Handle an EMANE location event.
        """
        events = LocationEvent()
        events.restore(data)
        for event in events:
            txnemid, attrs = event
            if "latitude" not in attrs or "longitude" not in attrs or "altitude" not in attrs:
                logger.warn("dropped invalid location event")
                continue

            # yaw,pitch,roll,azimuth,elevation,velocity are unhandled
            lat = attrs["latitude"]
            long = attrs["longitude"]
            alt = attrs["altitude"]
            self.handlelocationeventtoxyz(txnemid, lat, long, alt)
Beispiel #2
0
    def handlelocationevent(self, rxnemid, eid, data):
        """
        Handle an EMANE location event.
        """
        events = LocationEvent()
        events.restore(data)
        for event in events:
            txnemid, attrs = event
            if "latitude" not in attrs or "longitude" not in attrs or "altitude" not in attrs:
                logger.warn("dropped invalid location event")
                continue

            # yaw,pitch,roll,azimuth,elevation,velocity are unhandled
            lat = attrs["latitude"]
            lon = attrs["longitude"]
            alt = attrs["altitude"]
            logger.debug("emane location event: %s,%s,%s", lat, lon, alt)
            self.handlelocationeventtoxyz(txnemid, lat, lon, alt)
Beispiel #3
0
 def handlelocationevent(self, rxnemid: int, eid: int, data: str) -> None:
     """
     Handle an EMANE location event.
     """
     events = LocationEvent()
     events.restore(data)
     for event in events:
         txnemid, attrs = event
         if ("latitude" not in attrs or "longitude" not in attrs
                 or "altitude" not in attrs):
             logger.warning("dropped invalid location event")
             continue
         # yaw,pitch,roll,azimuth,elevation,velocity are unhandled
         lat = attrs["latitude"]
         lon = attrs["longitude"]
         alt = attrs["altitude"]
         logger.debug("emane location event: %s,%s,%s", lat, lon, alt)
         self.handlelocationeventtoxyz(txnemid, lat, lon, alt)