2 from threading
import Lock
3 from clearpath_control_msgs.msg
import ControlMode
4 from clearpath_control_msgs.msg
import ControlSelectionState
8 CURRENT_STATE_TOPIC_NAME =
"/control_selection/control_state"
10 CURRENT_MODE_TOPIC_NAME =
"/control_selection/current_mode"
14 """Create ROS subscribers for control status topics and save the results."""
17 """Subscribes for updates to the various control topics"""
22 CURRENT_STATE_TOPIC_NAME,
23 ControlSelectionState,
28 CURRENT_MODE_TOPIC_NAME,
35 self.
_timer = rospy.Timer(period=rospy.Duration(0.2), callback=self.
_msgChecker, oneshot=
False)
38 """Updates the control state.
42 msg : clearpath_control_msgs.msg.ControlSelectionState
43 The updated control state
51 """Updates the current mode.
55 msg : clearpath_control_msgs.msg.ControlMode
56 The updated control mode
64 """Get value of the autonomy enabled state.
69 True if autonomy is enabled, else False
76 """Get value of the autonomy paused state.
81 True if autonomy is paused, else False
88 """Get the current control mode.
93 The current control mode (NEUTRAL, MANUAL, or AUTONOMY)
100 """Check to see if messages have not been received within a certain amount of time"""
102 now = rospy.get_time()
109 """Logs all localization information."""
112 rospy.loginfo(
" Control:")
113 rospy.loginfo(
" State: Enabled: %s, Paused: %s " % (