<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi all <br>
</p>
<p>I'm on serve navdata interface in Ice but i found a "little"
problem. The problem is when I connect the client. When I receive
the first object in traces i can see my server stops so i not
receive objects anymore. I find another strange thing when this
happens i don't receive ANY ICE objects anymore.<br>
</p>
<p>I can't find the reason and I need a fresh look.</p>
<p>I'm testing the server with the uav_viewer_py and my server code
is in my git <a
href="https://github.com/RoboticsURJC-students/2014-pfc-JoseAntonio-Fernandez/blob/master/APMServer/">https://github.com/RoboticsURJC-students/2014-pfc-JoseAntonio-Fernandez/blob/master/APMServer/</a></p>
<p>The code involved in is:</p>
<p><b>Server</b> <a
href="https://github.com/RoboticsURJC-students/2014-pfc-JoseAntonio-Fernandez/blob/master/APMServer/Server.py:">https://github.com/RoboticsURJC-students/2014-pfc-JoseAntonio-Fernandez/blob/master/APMServer/Server.py:</a></p>
<p><i><font size="-1"> def openNavdataChannel(self, navdata):<br>
'''<br>
Open a Ice Server to serve all the navigation data<br>
:return:<br>
'''<br>
status = 0<br>
ic = None<br>
navdata2Tx = navdata<br>
<br>
try:<br>
ic = Ice.initialize(sys.argv)<br>
adapter =
ic.createObjectAdapterWithEndpoints("NavdataAdapter", "default
-p 8805")<br>
object = navdata2Tx<br>
adapter.add(object,
ic.stringToIdentity("ardrone_navdata"))<br>
adapter.activate()<br>
ic.waitForShutdown()<br>
except:<br>
traceback.print_exc()<br>
status = 1<br>
<br>
if ic:<br>
# Clean up<br>
try:<br>
ic.destroy()<br>
except:<br>
traceback.print_exc()<br>
status = 1<br>
<br>
sys.exit(status)</font></i></p>
<p><b>Interface </b><a
href="https://github.com/RoboticsURJC-students/2014-pfc-JoseAntonio-Fernandez/blob/master/APMServer/interfaces/NavdataI.py">https://github.com/RoboticsURJC-students/2014-pfc-JoseAntonio-Fernandez/blob/master/APMServer/interfaces/NavdataI.py</a><br>
</p>
<p><i><font size="-1">import jderobot, threading<br>
<br>
lock = threading.Lock()<br>
<br>
class NavdataI(jderobot.Navdata):<br>
<br>
def __init__(self):<br>
self.data = jderobot.NavdataData()<br>
<br>
def getNavdata(self, current=None):<br>
lock.acquire()<br>
return self.data<br>
lock.release()<br>
<br>
def setNavdata(self, data):<br>
lock.acquire()<br>
self.data=data<br>
lock.release()</font></i></p>
<p>Thanks for all<br>
</p>
</body>
</html>