fixed issue with emane location events and publishing node data

This commit is contained in:
Blake J. Harnden 2018-08-07 10:51:33 -07:00
parent 75ea42b2e8
commit 08b27ad0d7
2 changed files with 7 additions and 6 deletions

View file

@ -195,9 +195,9 @@ class PyCoreObj(object):
Build a data object for this node.
:param message_type: purpose for the data object we are creating
:param float lat: latitude
:param float lon: longitude
:param float alt: altitude
:param str lat: latitude
:param str lon: longitude
:param str alt: altitude
:return: node data object
:rtype: core.data.NodeData
"""

View file

@ -808,9 +808,10 @@ class EmaneManager(ModelManager):
# yaw,pitch,roll,azimuth,elevation,velocity are unhandled
lat = attrs["latitude"]
long = attrs["longitude"]
lon = attrs["longitude"]
alt = attrs["altitude"]
self.handlelocationeventtoxyz(txnemid, lat, long, alt)
logger.debug("emane location event: %s,%s,%s", lat, lon, alt)
self.handlelocationeventtoxyz(txnemid, lat, lon, alt)
def handlelocationeventtoxyz(self, nemid, lat, lon, alt):
"""
@ -848,7 +849,7 @@ class EmaneManager(ModelManager):
# don"t use node.setposition(x,y,z) which generates an event
node.position.set(x, y, z)
node_data = node.data(message_type=0, lat=lat, lon=lon, alt=alt)
node_data = node.data(message_type=0, lat=str(lat), lon=str(lon), alt=str(alt))
self.session.broadcast_node(node_data)
return True