Exemplo n.º 1
0
 def Receive(self):
     """
     Try receiving the data up to a maximum size. If it fails
     empty the data
     """
     try:
         data = self.conn.recv(4)
     except:
         data = []            
         
     if (len(data) == 4):
     
         rx_dat = [ord(i) for i in data]
         shutdwn_cmd = m32(rx_dat)
         if (0x8756BAEB == shutdwn_cmd):
             self.remote_pub.publish(self._remote_shutdown_msg)
             rospy.sleep(1.0)
             self._shutdown_cb(True)
Exemplo n.º 2
0
 def Receive(self):
     """
     Try receiving the data up to a maximum size. If it fails
     empty the data
     """
     try:
         data = self.conn.recv(4)
     except:
         data = []            
         
     if (len(data) == 4):
     
         rx_dat = [ord(i) for i in data]
         shutdwn_cmd = m32(rx_dat)
         if (0x8756BAEB == shutdwn_cmd):
             self.remote_pub.publish(self._remote_shutdown_msg)
             rospy.sleep(1.0)
             self._shutdown_cb(True)
Exemplo n.º 3
0
 def Receive(self):
     """
     Try receiving the data up to a maximum size. If it fails
     empty the data
     """
     try:
         data = self.conn.recv(4)
     except:
         data = []
         
     if (len(data) == 4):
     
         rx_dat = [ord(i) for i in data]
         shutdwn_cmd = m32(rx_dat)
         if (0x8756BAEB == shutdwn_cmd):
             rospy.logerr("Platform signaled shutdown, need to shutdown the onboard PC")
             self.Close()
             os.system("shutdown now -h")
             sys.exit(0)
Exemplo n.º 4
0
    def Receive(self):
        """
        Try receiving the data up to a maximum size. If it fails
        empty the data
        """
        try:
            data = self.conn.recv(4)
        except:
            data = []

        if (len(data) == 4):

            rx_dat = [ord(i) for i in data]
            shutdwn_cmd = m32(rx_dat)
            if (0x8756BAEB == shutdwn_cmd):
                rospy.logerr(
                    "Platform signaled shutdown, need to shutdown the onboard PC"
                )
                self.Close()
                os.system("sudo shutdown now -h")
                sys.exit(0)