Go to the documentation of this file.00001
00002 import roslib
00003 import rospy
00004 from std_msgs.msg import Float64
00005 from sr_robot_msgs.msg import JointMusclePositionControllerState
00006 import math
00007
00008
00009 status = None
00010
00011
00012 def state_cb(data):
00013 global status
00014 status = data
00015
00016 rospy.init_node('example_reading_sensors')
00017
00018
00019
00020 rospy.Subscriber('/sh_ffj3_muscle_position_controller/state',
00021 JointMusclePositionControllerState, state_cb)
00022
00023 print "Try moving ffj3"
00024 r = rospy.Rate(1)
00025 while not rospy.is_shutdown():
00026 if status:
00027 print "ffj3 position:%s radians pressure0:%s pressure1:%s" % (status.process_value,
00028 status.muscle_pressure_0,
00029 status.muscle_pressure_1)
00030 r.sleep()