class_potc_subscriber.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 
6  PHM POTC Subscriber Class
7 
8 """
9 
10 import rospy
11 from std_msgs.msg import String
12 
13 
15  """
16  POTC Subscriber Class
17 
18  Subscriber:
19  Topic name = /task_time
20  Message type = String
21 
22  Topic name = /task_position
23  Message type = String
24 
25  Topic name = /robot_task_list
26  Message type = String
27  """
28  def __init__(self):
29  self.task_time = 1.0
30  self.task_position = list()
31  self.robot_task_list = list()
32 
33  self.task_time_control = False
34  self.task_position_control = False
36 
37 
38  def main_func(self):
39  """
40  POTC Subscriber Class Main Function
41  """
42  rospy.Subscriber('/task_time', String, self.task_time_clbk)
43  rospy.Subscriber('/task_position', String, self.task_position_clbk)
44  rospy.Subscriber('/robot_task_list', String, self.robot_task_list_clbk)
45 
46 
47  def task_time_clbk(self, msg):
48  """
49  Callback function of /task_time
50  """
51  self.task_time = list(eval(msg.data))
52  self.task_time_control = True
53 
54 
55  def task_position_clbk(self, msg):
56  """
57  Callback function of /task_position
58  """
59  self.task_position = list(eval(msg.data))
60  self.task_position_control = True
61 
62 
63  def robot_task_list_clbk(self, msg):
64  """
65  Callback function of /robot_task_list
66  """
67  self.robot_task_list = list(eval(msg.data))
68  self.robot_task_list_control = True


phm_robot_task_completion
Author(s):
autogenerated on Thu Aug 13 2020 16:41:49