Skip to content

Commit

Permalink
added thread locking and try excpet. also removed a relay inside of t…
Browse files Browse the repository at this point in the history
…he localization launch file because that is now fixed with mapping
  • Loading branch information
mitchetm committed Jul 7, 2020
1 parent 089d82e commit 443336c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 122 deletions.
3 changes: 0 additions & 3 deletions cart_control/launch/autoware_localization.launch
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@

<!-- Landmark to Waypoint Converter -->
<node name="landmarks_to_waypoints" pkg="cart_planning" type="landmarks_to_waypoints.py"/>

<!-- Relay node, this is a temporary alternative to remapping the velodyne_points topic -->
<node name="relay" pkg="topic_tools" type="relay" args="/velodyne_points /points_raw"/>

<!-- Throttle position messages so nodes that need positional updates dont't call to often -->
<node name="throttle" pkg="topic_tools" type="throttle" args="messages /ndt_pose 60.0 /limited_pose"/>
Expand Down
113 changes: 0 additions & 113 deletions cart_endpoints/scripts/network_client.py

This file was deleted.

17 changes: 14 additions & 3 deletions cart_endpoints/scripts/network_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import socketio
import time
import threading
import rospy
import json
import vlc
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -240,16 +246,21 @@ 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)
location_speech_pub = rospy.Publisher('/location_speech', Bool, queue_size=10)
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)
Expand Down
Binary file modified cart_planning/scripts/cubic_spline_planner.pyc
Binary file not shown.
3 changes: 0 additions & 3 deletions cart_simulator/scripts/add_test_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 443336c

Please sign in to comment.