jointStatePublisher.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 import roslib; roslib.load_manifest('iri_wam_test')
00003 import rospy
00004 from sensor_msgs.msg import JointState
00005 def jointStatePublisher():
00006     rospy.init_node('jointStatePublisher')
00007     name = rospy.get_name()+'/joint_states'
00008     print name
00009     pub = rospy.Publisher('joint_states', JointState)
00010     jointsmsg = JointState()
00011     while not rospy.is_shutdown():
00012         jointsmsg.header.stamp = rospy.Time.now()
00013         jointsmsg.header.frame_id = "wam0"
00014         for i in range(0, 7):
00015             jointsmsg.name.append("wamframe")
00016             jointsmsg.position.append(0.1)
00017         pub.publish(jointsmsg)
00018         rospy.sleep(1.0)
00019 if __name__ == '__main__':
00020     try:
00021         jointStatePublisher()
00022     except rospy.ROSInterruptException: pass
00023 
00024 


iri_wam_test
Author(s):
autogenerated on Fri Dec 6 2013 22:41:21