Exemplo n.º 1
0
 def goOffPose(self, request, context):
     try:
         self.__robot.goOffPose()
         return nxtmsg.Status(value=nxtmsg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxtmsg.Status(value=nxtmsg.Status.ERROR)
Exemplo n.º 2
0
 def ejectHandToolLft(self, request, context):
     try:
         self.__robot.handtool_l_eject()
         return nxtmsg.Status(value=nxtmsg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxtmsg.Status(value=nxtmsg.Status.ERROR)
Exemplo n.º 3
0
 def checkEncoders(self, request, context):
     try:
         self.__robot.checkEncoders()
         return nxtmsg.Status(value=nxtmsg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxtmsg.Status(value=nxtmsg.Status.ERROR)
Exemplo n.º 4
0
 def attachHandToolRgt(self, request, context):
     try:
         self.__robot.handtool_r_attach()
         return nxtmsg.Status(value=nxtmsg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxtmsg.Status(value=nxtmsg.Status.ERROR)
Exemplo n.º 5
0
 def openHandToolLft(self, request, context):
     try:
         self.__robot.gripper_l_open()
         return nxtmsg.Status(value=nxtmsg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxtmsg.Status(value=nxtmsg.Status.ERROR)
Exemplo n.º 6
0
 def closeHandToolRgt(self, request, context):
     try:
         self.__robot.gripper_r_close()
         return nxtmsg.Status(value=nxtmsg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxtmsg.Status(value=nxtmsg.Status.ERROR)
Exemplo n.º 7
0
 def playPattern(self, request, context):
     try:
         if self.__oldyaml:
             angleslist, tmlist = yaml.load(request.data)
         else:
             angleslist, tmlist = yaml.load(request.data,
                                            Loader=yaml.UnsafeLoader)
         self.__robot.playPattern(angleslist, [], [], tmlist)
         return nxtmsg.Status(value=nxtmsg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxtmsg.Status(value=nxtmsg.Status.ERROR)
Exemplo n.º 8
0
    def setJointAngles(self, request, context):
        """

        :param request: request.data is in degree
        :param context:
        :return:

        author: weiwei
        date: 20190419
        """

        try:
            if self.__oldyaml:
                angles, tm = yaml.load(request.data)
            else:
                angles, tm = yaml.load(request.data, Loader=yaml.UnsafeLoader)
            if tm is None:
                tm = 10.0
            self.__robot.playPattern([self.__deg2rad(angles), [tm]])
            return nxtmsg.Status(value=nxtmsg.Status.DONE)
        except Exception as e:
            print(e, type(e))
            return nxtmsg.Status(value=nxtmsg.Status.ERROR)