-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstate_node.py
More file actions
39 lines (33 loc) · 994 Bytes
/
state_node.py
File metadata and controls
39 lines (33 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
"""
This node is used to detect what state the bike is in regards to the start/end scripts.
If the bike is running start.sh, this node will be publishing a "1," if the bike is running
end.sh, then this node will be publishing a "0".
"""
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import Pose2D
import time
import random
import bikeState
import bikeSim
import mapModel
import numpy as np
from std_msgs.msg import Int32MultiArray
from std_msgs.msg import Float32MultiArray
from std_msgs.msg import MultiArrayLayout
from std_msgs.msg import MultiArrayDimension
from std_msgs.msg import Float32
from geometry_msgs.msg import Twist
import nav
import requestHandler
def talker():
pub = rospy.Publisher('is_bike_starting_or_stopping_pub', Int32, queue_size=10)
rospy.init_node('state', anonymous = True)
rate = rospy.Rate()
while not rospy.is_shutdown():
if __name__=='__main__':
try:
talker()
except rospy.ROSInterruptExcept:
pass