@@ -55,7 +55,7 @@ def generate_micro_ros_agent_xml_support(args):
5555 os .makedirs (args ['output_dir' ])
5656
5757 # Check if publixher exists
58- pub_file_path = "/root/install/ publisher.xml"
58+ pub_file_path = os . path . join ( args [ 'output_dir' ], ' publisher.xml' )
5959 pub_file = Path (pub_file_path )
6060 if not pub_file .is_file ():
6161 publ = open (pub_file_path , 'a' )
@@ -66,10 +66,11 @@ def generate_micro_ros_agent_xml_support(args):
6666 publ .close ()
6767 publ = open (pub_file_path ,'w' )
6868 publ .writelines ([item for item in lines [:- 1 ]])
69+ #publ = open(pub_file_path, "w")
70+ #publ.seek(publ.seek(-1,2) - len("</profiles>\n"))
71+
6972
7073
71- #publ = open(os.path.join(args['output_dir'], 'publisher.xml'), 'w+')
72- #publ = open('/root/install/publisher.xml', 'a')
7374 publ .write (" <publisher profile_name=\" default_xrce_publisher_profile\" >\n " )
7475 publ .write (" <topic>\n " )
7576 publ .write (" <kind>NO_KEY</kind>\n " )
@@ -89,8 +90,8 @@ def generate_micro_ros_agent_xml_support(args):
8990
9091
9192
92- # Check if subcriber exists
93- subs_file_path = "/root/install/ subscriber.xml"
93+ # Check if subcriber exists
94+ subs_file_path = os . path . join ( args [ 'output_dir' ], ' subscriber.xml' )
9495 subs_file = Path (subs_file_path )
9596 if not subs_file .is_file ():
9697 subs = open (subs_file_path , 'a' )
@@ -103,9 +104,6 @@ def generate_micro_ros_agent_xml_support(args):
103104 subs .writelines ([item for item in lines [:- 1 ]])
104105
105106
106- #subs = open(os.path.join(args['output_dir'], 'subscriber.xml'), 'w+')
107- #subs = open('/root/install/subscriber.xml', 'a')
108- #subs.write("<profiles>\n")
109107 subs .write (" <subscriber profile_name=\" default_xrce_subscriber_profile\" >\n " )
110108 subs .write (" <topic>\n " )
111109 subs .write (" <kind>NO_KEY</kind>\n " )
@@ -125,7 +123,7 @@ def generate_micro_ros_agent_xml_support(args):
125123
126124
127125 # Check if topic exists
128- topi_file_path = "/root/install/ topic.xml"
126+ topi_file_path = os . path . join ( args [ 'output_dir' ], ' topic.xml' )
129127 topi_file = Path (topi_file_path )
130128 if not topi_file .is_file ():
131129 topi = open (topi_file_path , 'a' )
@@ -137,10 +135,6 @@ def generate_micro_ros_agent_xml_support(args):
137135 topi = open (topi_file_path ,'w' )
138136 topi .writelines ([item for item in lines [:- 1 ]])
139137
140-
141- #topi = open(os.path.join(args['output_dir'], 'topic.xml'), 'w+')
142- #topi = open('/root/install/topic.xml', 'a')
143- #topi.write("<dds>\n")
144138 topi .write (" <topic>\n " )
145139 topi .write (" <name>%sPubSubTopic</name>\n " % (spec .msg_name ))
146140 topi .write (" <dataType>%s::%s::dds_::%s_</dataType>\n " % (spec .base_type .pkg_name , subfolder , spec .msg_name ))
0 commit comments