diff --git a/Drone/client.py b/Drone/client.py index ed98723..16b6023 100644 --- a/Drone/client.py +++ b/Drone/client.py @@ -208,6 +208,8 @@ COPTER_ID = config.get('PRIVATE', 'id') if COPTER_ID == 'default': COPTER_ID = 'copter' + str(random.randrange(9999)).zfill(4) write_to_config('PRIVATE', 'id', COPTER_ID) +elif COPTER_ID == '/hostname': + COPTER_ID = socket.gethostname() rospy.init_node('Swarm_client', anonymous=True) if USE_LEDS: diff --git a/Drone/client_config.ini b/Drone/client_config.ini index 4134ffe..52b35be 100644 --- a/Drone/client_config.ini +++ b/Drone/client_config.ini @@ -20,7 +20,7 @@ x0_common = 0 y0_common = 0 [PRIVATE] -id = copter2 +id = /hostname use_leds = True x0 = 0 y0 = 0 \ No newline at end of file