예제 #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)
예제 #2
0
파일: emanemanager.py 프로젝트: gsomlo/core
    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)
예제 #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)