5 rospy.init_node(
"pr2_rviz_visualization")
8 from std_msgs.msg
import Float32
9 from pr2_msgs.msg
import BatteryServer
12 battery_pub0 = rospy.Publisher(
"/visualization/battery/value0", Float32)
13 battery_pub1 = rospy.Publisher(
"/visualization/battery/value1", Float32)
14 battery_pub2 = rospy.Publisher(
"/visualization/battery/value2", Float32)
15 battery_pub3 = rospy.Publisher(
"/visualization/battery/value3", Float32)
16 battery_pubs = [battery_pub0,
22 battery_pubs[msg.id].publish(Float32(msg.averageCharge))
24 s = rospy.Subscriber(
"/battery/server", BatteryServer, batteryCB)