4 from jsk_footstep_controller.msg
import GroundContactState
5 from jsk_rviz_plugins.msg
import OverlayText
9 if msg.contact_state == GroundContactState.CONTACT_BOTH_GROUND:
10 text.text =
"Double Stance Phase" 12 text.fg_color.r = 25 / 255.0
15 elif msg.contact_state == GroundContactState.CONTACT_LLEG_GROUND
or msg.contact_state == GroundContactState.CONTACT_RLEG_GROUND:
16 text.text =
"Single Stance Phase" 21 elif msg.contact_state == GroundContactState.CONTACT_UNSTABLE:
22 text.text =
"Unstable" 27 elif msg.contact_state == GroundContactState.CONTACT_AIR:
37 pub = rospy.Publisher(
"stance_phase_text", OverlayText)
38 sub = rospy.Subscriber(
"/footcoords/contact_state", GroundContactState, callback)
42 if __name__ ==
"__main__":
43 rospy.init_node(
"stance_phase_text")