Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- class AbstractSensorAdaptor:
- NODENAME_SENSOR = 'turtle1'
- INTERVAL_PUBLISH_CONVSWARM = 0.2
- SUB_PUB_CROWDTOPIC_LOOPFREQUENCY = 100.0
- def __init__(self):
- nodeName = "SensorAdaptor"
- rospy.init_node(nodeName, anonymous=True)
- return None
- def callBack(self, swarm):
- print '' # Avoiding interpreter error
- def listener(self):
- rospy.Subscriber(AbstractSensorAdaptor.TOPIC_SUBSC, Swm, self.callBack, None, 1000)
- rospy.spin()
- def convertSensorData(self, crowd):
- return None
- def publish(self, msg):
- pub = rospy.Publisher(AbstractSensorAdaptor.topicName_convertedMsg, ConvertedSwm)
- while not rospy.is_shutdown():
- pub.publish(msg)
- rospy.sleep(self.INTERVAL_PUBLISH_CONVSWARM)
- return None
- if __name__ == '__main__':
- a = AbstractSensorAdaptor()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement