Exemplo n.º 1
0
 def dome_track(self):
     """Dome\u3068\u671b\u9060\u93e1\u306esync"""
     #self.ant.dome_track()
     #return
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_tracking'
     self.pub13.publish(dome)
Exemplo n.º 2
0
 def dome_track_end(self):
     """Dome\u3068\u671b\u9060\u93e1\u306esync\u306e\u7d42\u4e86"""
     #self.ant.dome_track_end()
     #return
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_track_end'
     self.pub13.publish(dome)
Exemplo n.º 3
0
 def memb_close(self):
     #"""\u30e1\u30f3\u30d6\u30ec\u30f3\u306eopenclose"""
     #self.ant.memb_close()
     #return
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'memb_close'
     self.pub13.publish(dome)
Exemplo n.º 4
0
 def dome_close(self):
     #"""Dome\u306eclose"""
     #self.ant.dome_close()
     #return
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_close'
     self.pub13.publish(dome)
Exemplo n.º 5
0
 def memb_open(self):
     """\u30e1\u30f3\u30d6\u30ec\u30f3\u306eopen"""
     #self.ant.memb_open()
     #return
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'memb_open'
     self.pub13.publish(dome)
Exemplo n.º 6
0
 def dome_open(self):
     #"""Dome\u306eopen"""
     #self.ant.dome_open()
     #return
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_open'
     self.pub13.publish(dome)
Exemplo n.º 7
0
 def dome_stop(self):
     """Dome\u306eclose\u52d5\u4f5c\u3092\u505c\u6b62"""
     #self.dome_track_end()
     #self.ant.dome_stop()
     #return
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_stop'
     self.pub13.publish(dome)
Exemplo n.º 8
0
 def dome_move(self,dist):
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_move'
     self.pub13.publish(dome)
     dome = Dome_msg()
     dome.name = 'target_az'
     dome.value = str(dist)
     self.pub13.publish(dome)
Exemplo n.º 9
0
 def dome_track_end(self):
     """Dome stop antenna_az sync"""
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_track_end'
     dome.from_node = self.node_name
     dome.timestamp = time.time()        
     self.pub_dome.publish(dome)
     return
Exemplo n.º 10
0
 def dome_stop(self):
     """Dome stop"""
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_stop'
     dome.from_node = self.node_name
     dome.timestamp = time.time()
     self.pub_dome.publish(dome)
     return
Exemplo n.º 11
0
 def memb_close(self):
     """membrane close"""
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'memb_close'
     dome.from_node = self.node_name
     dome.timestamp = time.time()        
     self.pub_dome.publish(dome)
     return
Exemplo n.º 12
0
    def check_thread(self):
        """ checking alert """
        emergency = Bool()
        dome = Dome_msg()
        while not rospy.is_shutdown():
            print(self.state, self.wind_speed, self.rain, self.out_humi,
                  self.memb, self.dome_r, self.dome_l)

            if self.rain > 1.:
                self.state = "Warning : probably rainning...\n"
                rospy.logwarn(self.state)
            else:
                pass
            if self.out_humi > 80:
                self.state = "Warning : out_humi over 80 % \n"
                rospy.logwarn(self.state)
            else:
                pass

            if 10. < self.wind_speed < 15.:
                self.state = "Warning : wind_speed over 10.\n"
                rospy.logwarn(self.state)
            elif self.wind_speed > 15:
                self.state = "Emergency : wind_speed over 15.\n"
                rospy.logfatal(self.state)
                emergency.data = True
                self.pub_emergency.publish(emergency)
                if self.memb.lower() == 'open':
                    dome.name = 'command'
                    dome.value = 'memb_close'
                    self.pub_dome.publish(dome)
                if self.dome_r.lower() == 'open' or self.dome_l.lower(
                ) == 'open':
                    dome.name = 'command'
                    dome.value = 'dome_close'
                    self.pub_dome.publish(dome)
            else:
                pass
            time.sleep(0.1)
        return
Exemplo n.º 13
0
 def dome_move(self,dist):
     """ dome move
     
     Parameters
     ----------
     dist : distance [deg]
     """
     dome = Dome_msg()
     dome.name = 'command'
     dome.value = 'dome_move'
     dome.from_node = self.node_name
     dome.timestamp = time.time()
     self.pub_dome.publish(dome)
     dome_move = Dome_msg()
     dome_move.name = 'target_az'
     dome_move.value = str(dist)
     dome_move.from_node = self.node_name
     dome_move.timestamp = time.time()
     self.pub_dome_move.publish(dome_move)
     return