Skip to content

Commit e225f5a

Browse files
authored
Update Python Publisher and Subscriber example (#973)
Signed-off-by: Mario Dominguez <[email protected]>
1 parent 1cf4b30 commit e225f5a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

code/Examples/Python/HelloWorld/HelloWorldPublisher.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ def __init__(self):
5858
self.participant = factory.create_participant(0, self.participant_qos)
5959

6060
self.topic_data_type = HelloWorld.HelloWorldPubSubType()
61-
self.topic_data_type.setName("HelloWorld")
61+
self.topic_data_type.set_name("HelloWorld")
6262
self.type_support = fastdds.TypeSupport(self.topic_data_type)
6363
self.participant.register_type(self.type_support)
6464

6565
self.topic_qos = fastdds.TopicQos()
6666
self.participant.get_default_topic_qos(self.topic_qos)
67-
self.topic = self.participant.create_topic("HelloWorldTopic", self.topic_data_type.getName(), self.topic_qos)
67+
self.topic = self.participant.create_topic("HelloWorldTopic", self.topic_data_type.get_name(), self.topic_qos)
6868

6969
self.publisher_qos = fastdds.PublisherQos()
7070
self.participant.get_default_publisher_qos(self.publisher_qos)

code/Examples/Python/HelloWorld/HelloWorldSubscriber.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ def __init__(self):
5858
self.participant = factory.create_participant(0, self.participant_qos)
5959

6060
self.topic_data_type = HelloWorld.HelloWorldPubSubType()
61-
self.topic_data_type.setName("HelloWorld")
61+
self.topic_data_type.set_name("HelloWorld")
6262
self.type_support = fastdds.TypeSupport(self.topic_data_type)
6363
self.participant.register_type(self.type_support)
6464

6565
self.topic_qos = fastdds.TopicQos()
6666
self.participant.get_default_topic_qos(self.topic_qos)
67-
self.topic = self.participant.create_topic("HelloWorldTopic", self.topic_data_type.getName(), self.topic_qos)
67+
self.topic = self.participant.create_topic("HelloWorldTopic", self.topic_data_type.get_name(), self.topic_qos)
6868

6969
self.subscriber_qos = fastdds.SubscriberQos()
7070
self.participant.get_default_subscriber_qos(self.subscriber_qos)

0 commit comments

Comments
 (0)