SMACC2
Public Member Functions | Public Attributes | List of all members
basic_publisher.TemperatureSensorNode Class Reference
Inheritance diagram for basic_publisher.TemperatureSensorNode:
Inheritance graph
Collaboration diagram for basic_publisher.TemperatureSensorNode:
Collaboration graph

Public Member Functions

def __init__ (self)
 
def publish_temperature (self)
 

Public Attributes

 temperature_publisher_
 
 temperature_timer_
 

Detailed Description

Definition at line 23 of file basic_publisher.py.

Constructor & Destructor Documentation

◆ __init__()

def basic_publisher.TemperatureSensorNode.__init__ (   self)

Definition at line 24 of file basic_publisher.py.

24 def __init__(self):
25 super().__init__("temperature_sensor")
26 self.temperature_publisher_ = self.create_publisher(Int16, "temperature", 10)
27 self.temperature_timer_ = self.create_timer(0.05, self.publish_temperature)
28

References basic_publisher.TemperatureSensorNode.__init__().

Referenced by basic_publisher.TemperatureSensorNode.__init__().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ publish_temperature()

def basic_publisher.TemperatureSensorNode.publish_temperature (   self)

Definition at line 29 of file basic_publisher.py.

29 def publish_temperature(self):
30 temperature = random.randint(20, 30)
31 msg = Int16()
32 msg.data = temperature
33 self.temperature_publisher_.publish(msg)
34
35

References basic_publisher.TemperatureSensorNode.temperature_publisher_.

Member Data Documentation

◆ temperature_publisher_

basic_publisher.TemperatureSensorNode.temperature_publisher_

◆ temperature_timer_

basic_publisher.TemperatureSensorNode.temperature_timer_

Definition at line 27 of file basic_publisher.py.


The documentation for this class was generated from the following file: