Skip to content

Commit becb074

Browse files
author
Javier Moreno
committed
Refs #3366. Errors fix
1 parent c54a384 commit becb074

4 files changed

Lines changed: 17 additions & 67 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ install(
6868
)
6969

7070
install(
71-
DIRECTORY cmake resource
71+
DIRECTORY cmake
7272
DESTINATION share/${PROJECT_NAME}
7373
)

‎bin/AAA‎

Lines changed: 0 additions & 51 deletions
This file was deleted.

‎cmake/micrortps_agent_xml_generator.cmake‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endforeach()
2525

2626

2727
# Set output dir
28-
set(_output_path "${CMAKE_CURRENT_BINARY_DIR}/micro_ros_agent/${PROJECT_NAME}")
28+
set(_output_path "${CMAKE_CURRENT_BINARY_DIR}/../micro_ros_agent/xml_gen")
2929

3030

3131
# check if all templates exits
@@ -49,7 +49,7 @@ rosidl_write_generator_arguments(
4949
ROS_INTERFACE_FILES "${rosidl_generate_interfaces_IDL_FILES}"
5050
ROS_INTERFACE_DEPENDENCIES "${_dependencies}"
5151
OUTPUT_DIR "${_output_path}"
52-
TEMPLATE_DIR "${micro_ros_agent_TEMPLATE_DIR}"
52+
TEMPLATE_DIR "NONE"
5353
TARGET_DEPENDENCIES ${target_dependencies}
5454
ADDITIONAL_FILES ${_dds_idl_files}
5555
)
@@ -60,3 +60,10 @@ execute_process(
6060
COMMAND ${PYTHON_EXECUTABLE} ${micro_ros_agent_BIN}
6161
--generator-arguments-file "${generator_arguments_file}"
6262
)
63+
64+
65+
#Install
66+
install(
67+
DIRECTORY "${_output_path}/"
68+
DESTINATION "../micrortps_agent/bin"
69+
)

‎micro_ros_agent/__init__.py‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)