示例#1
0
    def sendRobot(self, x, y, z, ox, oy, oz, ow, p, r, m):
        rospy.init_node('motar_interface')
        point_pub = rospy.Publisher("motar_mini/dprm", dprm, queue_size=10)
        dest = dprm()

        dest.destination.position.x = x
        dest.destination.position.y = y
        dest.destination.position.z = z
        dest.destination.orientation.x = ox
        dest.destination.orientation.y = oy
        dest.destination.orientation.z = oz
        dest.destination.orientation.w = ow
        dest.patient = p
        dest.room = r
        dest.medicine = m

        point_pub.publish(dest)
        text = "(" + str(x) + ", " + str(y) + ", " + str(z) + ")"

        self.P = np.append(self.P, p)
        self.D = np.append(self.D, text)
        self.DE = np.append(self.DE, text)
        self.R = np.append(self.R, r)
        self.M = np.append(self.M, m)
        self.S = np.append(self.S, "Not Reached")
        self.destinationpose.setText(str(self.DE))
示例#2
0
    def delbtnclicked(self):
        dest = dprm()
        dest.destination.position.x = 0
        dest.destination.position.y = 0
        dest.destination.position.z = 0
        dest.destination.orientation.x = 0
        dest.destination.orientation.y = 0
        dest.destination.orientation.z = 0
        dest.destination.orientation.w = -1
        dest.patient = 1
        dest.room = 6
        dest.medicine = "none"
        point_pub.publish(dest)

        self.DE = np.delete(self.DE, -1)
        self.D = np.delete(self.D, -1)
        self.P = np.delete(self.P, -1)
        self.R = np.delete(self.R, -1)
        self.M = np.delete(self.M, -1)
        self.S = np.delete(self.S, -1)

        self.destinationpose.setText(str(self.DE))
        if len(self.Text) > 0:
            r = len(self.Text)
            text = self.Text[r - 1] + " sending process has been aborted."
            self.list.addItem(text)
            self.Text = np.delete(self.Text, -1)
示例#3
0
    def combopressed(self, a):
        global cntnum
        x, y, z, t = self.selected()
        if a == 1:
            self.is_man_control(0)
            if x != 1:
                self.clicked("Delivering Medicine")
                text = ("for patient " + self.patient1.currentText() +
                        " in room " + self.room1.currentText() + " medicine " +
                        self.med1.currentText())
                self.Text = np.append(self.Text, text)
                self.list.addItem(text + " is being sent.")
                self.setPRM(int(self.patient1.currentText()),
                            int(self.room1.currentText()),
                            self.med1.currentText())
            if y != 2:
                self.clicked("Delivering Medicine")
                text = ("for patient " + self.patient2.currentText() +
                        " in room " + self.room2.currentText() + " medicine " +
                        self.med2.currentText())
                self.Text = np.append(self.Text, text)
                self.list.addItem(text + " is being sent.")
                self.setPRM(int(self.patient2.currentText()),
                            int(self.room2.currentText()),
                            self.med2.currentText())
            if z != 3:
                self.clicked("Delivering Medicine")
                text = ("for patient " + self.patient3.currentText() +
                        " in room " + self.room3.currentText() + " medicine " +
                        self.med3.currentText())
                self.Text = np.append(self.Text, text)
                self.list.addItem(text + " is being sent.")
                self.setPRM(int(self.patient3.currentText()),
                            int(self.room3.currentText()),
                            self.med3.currentText())
            if t != 4:
                self.clicked("Delivering Medicine")
                text = ("for patient " + self.patient4.currentText() +
                        " in room " + self.room4.currentText() + " medicine " +
                        self.med4.currentText())
                self.Text = np.append(self.Text, text)
                self.list.addItem(text + " is being sent.")
                self.setPRM(int(self.patient4.currentText()),
                            int(self.room4.currentText()),
                            self.med4.currentText())
        if a == 0:
            if len(self.Text) > 0:
                r = len(self.Text)
                for i in range(r):
                    text = self.Text[r - i -
                                     1] + " sending process has been aborted."
                    self.list.addItem(text)
                    self.Text = np.delete(self.Text, -1)
            dest = dprm()
            dest.patient = 1
            dest.room = 7
            dest.medicine = "none"
            point_pub.publish(dest)

            self.DE = np.delete(self.DE, np.s_[::1])
            self.D = np.delete(self.D, np.s_[cntnum:])
            self.P = np.delete(self.P, np.s_[cntnum:])
            self.R = np.delete(self.R, np.s_[cntnum:])
            self.M = np.delete(self.M, np.s_[cntnum:])
            self.S = np.delete(self.S, np.s_[cntnum:])

            self.destinationpose.setText(str(self.DE))