Commit 09d8d3ac authored by Erik Jansson's avatar Erik Jansson
Browse files

Add dummy sensor publisher and corresponding bridge config.

parent eb46d780
......@@ -3,6 +3,11 @@
<service name="/extctrl_service" file="srv/ExtCtrl.srv" />
</imports>
<exports>
<topic name="/analog_sensors" />
<topic name="/digital_sensors" />
</exports>
<static-connections>
<target addr="127.0.0.1:8888">
</target>
......
Header header
string[] uri
int16[] value
Header header
string[] uri
int8[] state
#!/usr/bin/env python
import roslib; roslib.load_manifest('ros_extctrl')
import rospy
from ros_extctrl.msg import AnalogSensor, DigitalSensor
analog_vals = [0, 1, 2, 3, 4, 5, 6, 7]
digital_vals = [8, 9, 10, 11, 12, 13, 14, 15]
def interact():
analog_pub = rospy.Publisher('analog_sensors', AnalogSensor)
digital_pub = rospy.Publisher('digital_sensors', DigitalSensor)
analog = AnalogSensor()
digital = DigitalSensor()
analog.value = analog_vals
digital.state = digital_vals
r = rospy.Rate(1)
while not rospy.is_shutdown():
analog_pub.publish(analog)
digital_pub.publish(digital)
print("published")
r.sleep()
if __name__ == '__main__':
rospy.init_node('extctrl_usage_example')
interact()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment