ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
There are a set of tutorials on the sr_tactile_sensors
wiki page that may help you. For example, there's one that shows how to subscribe to the /sr_tactile/touch/ff
topic. It's in C++ so I made a Python version of it (that's been combined with the subscriber tutorial:
#!/usr/bin/env python
import rospy
from std_msgs.msg import Float64
def callback(msg):
# log the message data to the terminal
# rospy.loginfo("The value is %d", msg.data)
def listener():
# start the node
rospy.init_node("listener")
# subscribe to the '/sr_tactile/touch/ff' topic
tactile_sub = rospy.Subscriber("/sr_tactile/touch/ff", Float64, callback)
# keep python from exiting until this node is stopped
rospy.spin()
if __name__ == '__main__':
listener()
2 | No.2 Revision |
There are a set of tutorials on the sr_tactile_sensors
wiki page that may help you. For example, there's one that shows how to subscribe to the /sr_tactile/touch/ff
topic. It's in C++ so I made a Python version of it (that's been combined with the subscriber tutorial:
#!/usr/bin/env python
import rospy
from std_msgs.msg import Float64
def callback(msg):
# log the message data to the terminal
# rospy.loginfo("The value is %d", msg.data)
def listener():
# start the node
rospy.init_node("listener")
# subscribe to the '/sr_tactile/touch/ff' topic
tactile_sub = rospy.Subscriber("/sr_tactile/touch/ff", Float64, callback)
# keep python from exiting until this node is stopped
rospy.spin()
if __name__ == '__main__':
listener()