def prismG2_onclick(self):
     global V2
     pr = []
     tf_listener = tf.TransformListener()
     #Make the service call to enable the robot
     rospy.wait_for_service('prismTransform')
     try:
         # rospy.loginfo('\nPrism:transformations from leica_home are')
         prismTransform = rospy.ServiceProxy('prismTransform',
                                             gettf)  # s = client object
         req = gettfRequest()
         resp = prismTransform(req)
         #if(self)
         self.Current_P.ang = resp.ang
         self.Current_P.ang = resp.pos
         global count
         if (count == 2):
             P2.ang = resp.ang
             P2.pos = resp.pos
             for i in P2.pos:
                 pr.append(i)
             pr.append(1)
             V2.append(pr)
             self.minCal1(P2.pos, P2.ang)
             print("Prism no.:", count)
             print("*********** Leica->Top Gate Prism***********")
             print(P2.pos)
             print(P2.ang)
             print("***********************************************")
             print('\n')
         if (count <= 6):
             count = count + 1
         self.prismG2.setEnabled(False)
     except rospy.ServiceException, e:
         print "Service call failed: %s" % e
예제 #2
0
    def prismR3_onclick(self):

        #Make the service call to enable the robot
        rospy.wait_for_service('prismTransform')
        try:
            # rospy.loginfo('\nPrism:transformations from leica_home are')
            prismTransform = rospy.ServiceProxy('prismTransform',
                                                gettf)  # s = client object
            req = gettfRequest()
            resp = prismTransform(req)
            #if(self)
            self.Current_P.ang = resp.ang
            self.Current_P.ang = resp.pos
            global count
            if (count == 6):
                P6.ang = resp.ang
                P6.pos = resp.pos
                print("Prism no.:", count)
                print("***********Prism Position***********")
                print(P6.pos)
                print("***********************************************")
                self.call_listener(P6.pos, P6.ang)
                print('\n')

            if (count <= 6):
                count = count + 1
            self.prismR3.setEnabled(False)
            if (count > 6):
                print("Prism Count limit reached")
                count = 0
                self.World_Robot_Origin()
        except rospy.ServiceException, e:
            print "Service call failed: %s" % e
    def prismR3_onclick(self):
        global V4
        pr = []
        tf_listener = tf.TransformListener()
        #Make the service call to enable the robot
        rospy.wait_for_service('prismTransform')
        try:
            # rospy.loginfo('\nPrism:transformations from leica_home are')
            prismTransform = rospy.ServiceProxy('prismTransform',
                                                gettf)  # s = client object
            req = gettfRequest()
            resp = prismTransform(req)
            #if(self)
            self.Current_P.ang = resp.ang
            self.Current_P.ang = resp.pos
            global count
            if (count == 6):
                P6.ang = resp.ang
                P6.pos = resp.pos

                print("Prism no.:", count)
                print("***********Leica->Right Bottom Prism***********")
                print(P6.pos)
                print(P6.ang)

                for i in P6.pos:
                    pr.append(i)
                pr.append(1)

                V4.append(pr)
                self.minCal2(
                    P6.pos, P6.ang
                )  # Calulates the solution to the rotation error between the TF Base_link->Robot_prism and TF of Leica->Robot_Prism

            if (count <= 6):
                count = count + 1
            self.prismR3.setEnabled(False)
            if (count > 6):
                print("Prism Count limit reached")
                count = 0
                self.World_Robot_Origin()
        except rospy.ServiceException, e:
            print "Service call failed: %s" % e
    def prismG3_onclick(self):
        global V2
        pr = []
        tf_listener = tf.TransformListener()
        #Make the service call to enable the robot
        rospy.wait_for_service('prismTransform')
        try:
            # rospy.loginfo('\nPrism:transformations from leica_home are')
            prismTransform = rospy.ServiceProxy('prismTransform',
                                                gettf)  # s = client object
            req = gettfRequest()
            resp = prismTransform(req)
            #if(self)
            self.Current_P.ang = resp.ang
            self.Current_P.ang = resp.pos
            global count
            if (count == 3):
                P3.ang = resp.ang
                P3.pos = resp.pos
                print("Prism no.:", count)
                print("*********** Leica->Right Bottom Gate***********")
                print(P3.pos)
                print(P3.ang)
                print("***********************************************")

                for i in P3.pos:
                    pr.append(i)
                pr.append(1)
                V2.append(pr)
                self.minCal1(
                    P3.pos, P3.ang
                )  # Calulates the solution to the rotation error between the TF World->Gate_prism and TF of Leica->Gate_Prism

            if (count <= 6):
                count = count + 1
            self.prismG3.setEnabled(False)
        except rospy.ServiceException, e:
            print "Service call failed: %s" % e
    def prismR1_onclick(self):
        global V4
        pr = []
        tf_listener = tf.TransformListener()
        #Make the service call to enable the robot
        rospy.wait_for_service('prismTransform')
        try:
            # rospy.loginfo('\nPrism:transformations from leica_home are')
            prismTransform = rospy.ServiceProxy('prismTransform',
                                                gettf)  # s = client object
            req = gettfRequest()
            resp = prismTransform(req)
            #if(self)
            self.Current_P.ang = resp.ang
            self.Current_P.ang = resp.pos
            global count
            if (count == 4):
                P4.ang = resp.ang  # Storage in anothe variable incase of flexibility with data if needed
                P4.pos = resp.pos
                for i in P4.pos:
                    pr.append(i)
                pr.append(1)
                V4.append(pr)
                self.minCal2(P4.pos, P4.ang)
                print("Prism no.:", count)
                print("***********Leica->Left Robot Prism***********")
                print(P4.pos)
                print(P4.ang)
                print("***********************************************")

                print('\n')
            if (count <= 6):
                count = count + 1
            self.prismR1.setEnabled(False)

        except rospy.ServiceException, e:
            print "Service call failed: %s" % e