5 from std_msgs.msg
import String, Float32, Int32
17 result = random.randint(20, 159)
22 result = round(random.uniform(min_number, max_number), 3)
27 number = round(random.uniform(0, 1), 3)
29 failure_rate = str(str(number) +
"e-" + str(e_count))
54 msg_capacitor_temperature = Float32()
55 msg_random_1 = String()
56 msg_random_2 = String()
57 msg_random_3 = String()
58 msg_random_4 = String()
59 msg_random_5 = String()
61 msg_temperature_sensor_1 = Float32()
62 msg_temperature_sensor_2 = Float32()
63 msg_temperature_sensor_3 = Float32()
64 msg_temperature_sensor_4 = Float32()
65 msg_temperature_sensor_5 = Float32()
66 msg_temperature_sensor_6 = Float32()
67 msg_temperature_sensor_7 = Float32()
68 msg_temperature_sensor_8 = Float32()
69 msg_temperature_sensor_9 = Float32()
72 while not rospy.is_shutdown():
74 msg_time.data = int(counter)
75 self.publisher_time.publish(msg_time)
78 self.publisher_capacitor_temperature.publish(msg_capacitor_temperature)
86 self.publisher_random_1.publish(msg_random_1)
87 self.publisher_random_2.publish(msg_random_2)
88 self.publisher_random_3.publish(msg_random_3)
89 self.publisher_random_4.publish(msg_random_4)
90 self.publisher_random_5.publish(msg_random_5)
103 self.publisher_temperature_sensor_1.publish(msg_temperature_sensor_1)
104 self.publisher_temperature_sensor_2.publish(msg_temperature_sensor_2)
105 self.publisher_temperature_sensor_3.publish(msg_temperature_sensor_3)
106 self.publisher_temperature_sensor_4.publish(msg_temperature_sensor_4)
107 self.publisher_temperature_sensor_5.publish(msg_temperature_sensor_5)
108 self.publisher_temperature_sensor_6.publish(msg_temperature_sensor_6)
109 self.publisher_temperature_sensor_7.publish(msg_temperature_sensor_7)
110 self.publisher_temperature_sensor_8.publish(msg_temperature_sensor_8)
111 self.publisher_temperature_sensor_9.publish(msg_temperature_sensor_9)
116 if __name__ ==
'__main__':
117 rospy.init_node(
'sensor_deneme_publisher')
publisher_capacitor_temperature
publisher_temperature_sensor_3
def create_temperature_number(self)
def random_float(self, min_number, max_number)
publisher_temperature_sensor_2
publisher_temperature_sensor_5
publisher_temperature_sensor_4
def create_failure_rate(self, e_count)
publisher_temperature_sensor_9
publisher_temperature_sensor_7
publisher_temperature_sensor_6
publisher_temperature_sensor_8
publisher_temperature_sensor_1