Example #1
0
 def checkEncoders(self, request, context):
     try:
         self._robot.checkEncoders()
         return nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)
Example #2
0
 def goOffPose(self, request, context):
     try:
         self._robot.goOffPose()
         return nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)
Example #3
0
 def ejectHandToolLft(self, request, context):
     try:
         self._robot.handtool_l_eject()
         return nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)
Example #4
0
 def attachHandToolRgt(self, request, context):
     try:
         self._robot.handtool_r_attach()
         return nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)
Example #5
0
 def openHandToolLft(self, request, context):
     try:
         self._robot.gripper_l_open()
         return nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)
Example #6
0
 def closeHandToolRgt(self, request, context):
     try:
         self._robot.gripper_r_close()
         return nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)
Example #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 nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)
Example #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 nxt_msg.Status(value=nxt_msg.Status.DONE)
     except Exception as e:
         print(e, type(e))
         return nxt_msg.Status(value=nxt_msg.Status.ERROR)