fake_operational_state.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 import rospy
5 from std_msgs.msg import String
6 import random
7 
8 OPERATIONAL_STATES = [
9  "navigating",
10  "idle",
11  "disabled",
12  "offline",
13  "charging",
14  "waitingHumanEvent",
15  "waitingExternalEvent",
16  "waitingInternalEvent",
17  "manualOverride"
18 ]
19 
20 if __name__ == "__main__":
21  rospy.init_node("fake_operational_state")
22 
23  pub = rospy.Publisher("operational_state", String, queue_size=1)
24  publish_rate = rospy.get_param("~publish_rate", 1)
25 
26  loop_rate = rospy.Rate(publish_rate)
27  while not rospy.is_shutdown():
28  operational_state_msg = random.choice(OPERATIONAL_STATES)
29  pub.publish(operational_state_msg)
30  loop_rate.sleep()


amr_interop_bridge
Author(s):
autogenerated on Tue Mar 1 2022 23:45:33