diff --git a/cart_control/launch/autoware_localization.launch b/cart_control/launch/autoware_localization.launch
index 95cb9e31..9aa4d7a1 100644
--- a/cart_control/launch/autoware_localization.launch
+++ b/cart_control/launch/autoware_localization.launch
@@ -81,9 +81,6 @@
-
-
-
diff --git a/cart_endpoints/scripts/network_client.py b/cart_endpoints/scripts/network_client.py
deleted file mode 100644
index 05a83377..00000000
--- a/cart_endpoints/scripts/network_client.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env python
-
-import socketio
-import rospy
-import time
-from navigation_msgs.msg import EmergencyStop, LatLongPoint
-from std_msgs.msg import String, Bool
-
-
-"""
-This file contains the code needed to communicate
-with the actually server. It is called by the ros node
-network node.
-"""
-
-id = '1bcadd2fea88'
-
-sio = socketio.Client()
-
-is_connected = False
-
-
-
-########################
-### Recieving Events ###
-########################
-@sio.event(namespace='/cart')
-def connect():
- rospy.loginfo('connection established')
- send('connect', id)
- is_connected = True
-
-
-@sio.event(namespace='/cart')
-def disconnect():
- #camera.cleanUp()
- is_connected = False
- rospy.loginfo('disconnected from server')
-
-def send(msg, data):
- sio.emit(msg, data, namespace='/cart')
-
-@sio.on('cart_request', namespace='/cart')
-def on_cart_req(data):
- lat_long = json.loads(data)
- rospy.loginfo("Latitude/Long received: " + str(data))
- msg = LatLongPoint()
- msg.latitude = lat_long["latitude"]
- msg.longitude = lat_long["longitude"]
- gps_request_pub.publish(msg)
-
-
-@sio.on('destination', namespace='/cart')
-def on_dest(msg):
- location_speech_pub.publish(False)
- safety_constant_pub.publish(True)
-
- rospy.loginfo("RECIEVED GOAL: " + str(msg))
- location_string = str(msg)
- # Delete White Spaces
- location_string = location_string.replace(" ", "")
- # Lowercase Entire String
- location_string = location_string.lower()
- #Process the string into a waypoint
- calculated_waypoint = locationFinder(location_string)
- #Send requested waypoint to planner
- req_pub.publish(calculated_waypoint)
-
-@sio.on('pull_over',namespace='/cart')
-def on_pull_over():
- rospy.loginfo("Recieved Pull Over")
- stop_msg = EmergencyStop()
- stop_msg.emergency_stop = True
- stop_msg.sender_id = 1
- stop_pub.publish(stop_msg)
-
-@sio.on('resume_driving',namespace='/cart')
-def onResume():
- rospy.loginfo("Received a resume signal")
- stop_msg = EmergencyStop()
- stop_msg.emergency_stop = False
- stop_msg.sender_id = 1
- stop_pub.publish(stop_msg)
-
-@sio.on('stop',namespace='/cart')
-def onStop(data):
- rospy.loginfo("Received a stop signal")
- stop_msg = EmergencyStop()
- stop_msg.emergency_stop = True
- stop_msg.sender_id = 1
- stop_pub.publish(stop_msg)
-
-@sio.on('transit_await',namespace='/cart')
-def onTransitAwait():
- rospy.loginfo("TransitAwait")
- time.sleep(4)
- location_speech_pub.publish(True)
-
-if __name__ == "__main__":
- req_pub = rospy.Publisher('/destination_request', String, queue_size=10)
- gps_request_pub = rospy.Publisher('/gps_request', LatLongPoint, queue_size=10)
- location_speech_pub = rospy.Publisher('/location_speech', Bool, queue_size=10)
- stop_pub = rospy.Publisher('/emergency_stop', EmergencyStop, queue_size=10)
-
- rospy.loginfo("Attempting connection with socketio server")
- sio.connect('http://35.238.125.238:8020', namespaces=['/cart'])#172.30.167.135
-
- rate = rospy.Rate(10)
-
- while not rospy.is_shutdown():
- rate.sleep()
-
-
\ No newline at end of file
diff --git a/cart_endpoints/scripts/network_node.py b/cart_endpoints/scripts/network_node.py
index fec07993..0651810a 100755
--- a/cart_endpoints/scripts/network_node.py
+++ b/cart_endpoints/scripts/network_node.py
@@ -2,6 +2,7 @@
import socketio
import time
+import threading
import rospy
import json
import vlc
@@ -46,7 +47,12 @@ def disconnect():
rospy.loginfo('disconnected from server')
def send(msg, data):
- sio.emit(msg, data, namespace='/cart')
+ server_lock.acquire()
+ try:
+ sio.emit(msg, data, namespace='/cart')
+ except:
+ rospy.loginfo('Was unable to send data to the server')
+ server_lock.release()
@sio.on('cart_request', namespace='/cart')
def on_cart_req(data):
@@ -240,9 +246,13 @@ def front_image_callback(img_msg):
if __name__ == "__main__":
rospy.init_node('network_node')
+ server_lock = threading.Lock()
- rospy.loginfo("Attempting connection with socketio server")
- sio.connect('http://35.238.125.238:8020', namespaces=['/cart'])#172.30.167.135
+ try:
+ rospy.loginfo("Attempting connection with socketio server")
+ sio.connect('http://35.238.125.238:8020', namespaces=['/cart'])#172.30.167.135
+ except:
+ rospy.loginfo('Was unable to connect to the server')
stop_pub = rospy.Publisher('/emergency_stop', EmergencyStop, queue_size=10)
req_pub = rospy.Publisher('/destination_request', String, queue_size=10)
@@ -250,6 +260,7 @@ def front_image_callback(img_msg):
gps_request_pub = rospy.Publisher('/gps_request', LatLongPoint, queue_size=10)
safety_constant_pub = rospy.Publisher('/safety_constant', Bool, queue_size=10)
safety_exit_pub = rospy.Publisher('/safety_exit', Bool, queue_size=10)
+
rospy.Subscriber('/zed/image_raw', Image, passenger_image_callback)
rospy.Subscriber('/front_facing/image_raw', Image, front_image_callback)
diff --git a/cart_planning/scripts/cubic_spline_planner.pyc b/cart_planning/scripts/cubic_spline_planner.pyc
index b8ca60dd..95f96db1 100644
Binary files a/cart_planning/scripts/cubic_spline_planner.pyc and b/cart_planning/scripts/cubic_spline_planner.pyc differ
diff --git a/cart_simulator/scripts/add_test_points.py b/cart_simulator/scripts/add_test_points.py
index 83d2efa6..8d4f7c23 100755
--- a/cart_simulator/scripts/add_test_points.py
+++ b/cart_simulator/scripts/add_test_points.py
@@ -29,9 +29,6 @@ def __init__(self):
#for i in range(100):
self.waypoint_pub.publish(msg)
- #rospy.sleep(.1)
- #print msg
- print "done"
rospy.spin()