Skip to content
Snippets Groups Projects
Commit 1b32f53a authored by Squires, Eric's avatar Squires, Eric
Browse files

PATH_PLANNING: check param server for id prior to using input

parent 37d810c0
No related branches found
No related tags found
1 merge request!1Smart Shooter
......@@ -17,7 +17,7 @@ import rospy
# ACS imports
import ap_msgs.msg as apmsg
import ap_lib.bitmapped_bytes as bytes
import socket
class LossyDataExchange(object):
''' Abstract class used in support of reliable information exchange
......@@ -55,13 +55,14 @@ class LossyDataExchange(object):
@param msg_publisher: ROS publisher to the swarm_data_msg topic
@param lock: reentrant lock that will be used to enforce thread safety
'''
if own_id is None:
try:
if rospy.has_param("aircraft_id"):
self._own_id = int(rospy.get_param("aircraft_id"))
else:
except socket.error:
if own_id is not None:
self._own_id = own_id
else:
rospy.logerr("cannot retrieve aircraft_id from parameter server")
else:
self._own_id = own_id
self._short_list_parser = bytes.UShortListParser()
self._short_list_parser.source_id = self._own_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment