Config COPTER_ID to /hostname to make client use system hostname

Closes #7
This commit is contained in:
Artem30801
2019-03-20 12:31:16 +03:00
parent 028862c55e
commit 27403dd237
2 changed files with 3 additions and 1 deletions

View File

@@ -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:

View File

@@ -20,7 +20,7 @@ x0_common = 0
y0_common = 0
[PRIVATE]
id = copter2
id = /hostname
use_leds = True
x0 = 0
y0 = 0