[JdeRobot] [jderobot] Error serving Pose3D

Jose Antonio Fernandez cbyte18 at gmail.com
Wed Apr 15 13:24:08 CEST 2015


Hi all

I'm trying to serve a pose3D object on Ice.

At first I developed a simple Ice server with my own slice and work fine,
then I have modified the server to serve a pose3D object and now I have the
following error:

Traceback (most recent call last):
  File "/home/robotica/PycharmProjects/SimplePoseClient/PoseClient.py",
line 16, in <module>
    data = datos.getPose3DData()
  File "/usr/lib/python2.7/jderobot/pose3d_ice.py", line 123, in
getPose3DData
    return _M_jderobot.Pose3D._op_getPose3DData.invoke(self, ((), _ctx))
UnknownException: exception ::Ice::UnknownException
{
    unknown = exceptions.TypeError: getPose3DData() takes exactly 1
argument (2 given)
}

My server code is:

import sys, traceback, Ice, random
import jderobot

class Pose3DI(jderobot.Pose3D):
    def getPose3DData(self):

        data = jderobot.Pose3DData()
        data.x = random.randint(9,19)
        data.y = random.randint(9,19)
        data.z = random.randint(9,19)
        data.q0 = random.randint(0,9)
        data.q1= random.randint(0,9)
        data.q2= random.randint(0,9)
        data.q3= random.randint(0,9)

        return data

    def setPose3DData(self,pose):
        print pose

status = 0
ic = None
try:
    ic = Ice.initialize(sys.argv)
    adapter =
ic.createObjectAdapterWithEndpoints("SimpleRandomPoseAdapter", "default -p
10000")
    object = Pose3DI()
    print object.getPose3DData()
    adapter.add(object, ic.stringToIdentity("SimpleRandomPose"))
    adapter.activate()
    ic.waitForShutdown()
except:
    traceback.print_exc()
    status = 1

if ic:
    # Clean up
    try:
        ic.destroy()
    except:
        traceback.print_exc()
        status = 1

sys.exit(status)

And my client server code is:

import sys, traceback, Ice
import jderobot

status = 0
ic = None
try:
    ic = Ice.initialize(sys.argv)
    base = ic.stringToProxy("SimpleRandomPose:default -p 10000")
    datos = jderobot.Pose3DPrx.checkedCast(base)
    print datos
    if not datos:
        raise RuntimeError("Invalid proxy")

    data = datos.getPose3DData()
    print data
except:
    traceback.print_exc()
    status = 1

if ic:
    # Clean up
    try:
        ic.destroy()
    except:
        traceback.print_exc()
        status = 1

sys.exit(status)

Thanks for all
-- 
*Jose Antonio Fernandez Casillas*
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://gsyc.escet.urjc.es/pipermail/jde-developers/attachments/20150415/a341bd05/attachment.htm 


More information about the Jde-developers mailing list