############################################################################## # Copyright (c) 2005-2015 Real-Time Innovations, Inc. All rights reserved. # Permission to modify and use for internal purposes granted. # This software is provided "as is", without warranty, express or implied. ############################################################################## """Samples's writer.""" from sys import path as sysPath from os import path as osPath from time import sleep filepath = osPath.dirname(osPath.realpath(__file__)) sysPath.append(filepath + "/../../../") import rticonnextdds_connector as rti connector = rti.Connector("MyParticipantLibrary::MyParticipant", filepath + "/EnumExample.xml") outputDDS = connector.getOutput("MyPub::MyTopicWriter") COLORS = {"RED":0, "BLUE":1, "YELLOW":2} for i in range(1, 500): outputDDS.instance.setNumber("id", i) outputDDS.instance.setNumber("myColor", COLORS["RED"]) #outputDDS.instance.setNumber("myColor", 0) outputDDS.write() sleep(2)