Skip to content

Commit 85ef532

Browse files
authored
Feature/foxy migration (#30)
* Adding rosidl_cmake * Updated XML generation * Updated readme * Update README.md
1 parent f0effec commit 85ef532

File tree

4 files changed

+42
-14
lines changed

4 files changed

+42
-14
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,31 @@
55

66
ROS 2 package using Micro XRCE-DDS Agent.
77

8+
## Overview
9+
10+
This repository contains the Micro-ROS Agent package.
11+
Micro-ROS Agent is a ROS 2 node that wraps the Micro XRCE-DDS Agent.
12+
For further information about Micro XRCE-DDS Agent click [here](https://github.com/eProsima/Micro-XRCE-DDS-Agent)
13+
This package is a part of the Micro-ROS project stack.
14+
For more information about Micro-ROS project click [here](https://microros.github.io/micro-ROS/).
15+
16+
The node acts as a server between DDS Network and Micro-ROS nodes inside MCU.
17+
It receives and send messages from Micro-ROS nodes, and keep track of the Micro-ROS nodes exposing them to the ROS 2 network.
18+
The node interacts with DDS Global Data Space on behalf of the Micro-ROS nodes.
19+
20+
## Package features
21+
22+
### XML generation
23+
24+
During the build process, the package looks for all ROS 2 messages to generate an initial list of XML profiles.
25+
These profiles can are referenced in the Agent-Client communication to avoid sending the full XML content.
26+
This reference mechanism can be switched on and off from the Micro XRCE-DDS middleware layer.
27+
28+
### Agent-Client communication mechanism
29+
30+
Communication between the Micro-ROS Agent and the Micro-ROS nodes supports two types of transport:
31+
32+
- UDP and TCP over IPv4 and IPv6.
33+
- Serial Port transports.
34+
35+
All available configurations are supported directly by the Micro XRCE-DDS agent.

micro_ros_agent/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ project(micro_ros_agent LANGUAGES CXX)
2323

2424
find_package(ament_cmake REQUIRED)
2525
find_package(microxrcedds_agent REQUIRED)
26+
find_package(rosidl_cmake REQUIRED)
2627

2728
add_executable(${PROJECT_NAME} src/main.cpp)
2829

@@ -79,12 +80,11 @@ if(UROSAGENT_GENERATE_PROFILE)
7980
get_filename_component(_COLCON_CALL_DIR "${_COLCON_CALL_DIR}" DIRECTORY)
8081

8182
set(_PYTHON_SCRIPT_HEAD
82-
"
83-
import os\n
84-
import sys\n
85-
sys.path.append('${_OUTPUT_PATH}')\n
86-
from ${_PYTHON_PKG_TOOL} import *\n
87-
"
83+
"import os
84+
import sys
85+
sys.path.append('${_OUTPUT_PATH}')
86+
from ${_PYTHON_PKG_TOOL} import *
87+
"
8888
)
8989

9090
file(

micro_ros_agent/micro_ros_agent/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,38 +164,37 @@ def generate_XML(args):
164164
# Generate source file path
165165
src_file = os.path.join(srcs_dir, "%s_%s_%s.xml" % (spec.base_type.pkg_name, subfolder, spec.msg_name))
166166

167-
168167
# Data writer
169-
#file_content = " <dds>\n"
170-
file_content = " <data_writer profile_name=\"%s_%s_%s_p\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
168+
file_content = " <dds>\n"
169+
file_content += " <data_writer profile_name=\"%s_%s_%s_p\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
171170
file_content += " <topic profile_name=\"%s_%s_%s_t\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
172171
file_content += " <kind>NO_KEY</kind>\n"
173172
file_content += " <name>%s%s_%s_%s</name>\n" % (ros2_prefix, spec.base_type.pkg_name, subfolder, spec.msg_name)
174173
file_content += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
175174
file_content += " </topic>\n"
176175
file_content += " </data_writer>\n"
177-
#file_content += " </dds>\n"
176+
file_content += " </dds>\n"
178177

179178

180179
# Data reader
181-
#file_content += " <dds>\n"
180+
file_content += " <dds>\n"
182181
file_content += " <data_reader profile_name=\"%s_%s_%s_s\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
183182
file_content += " <topic profile_name=\"%s_%s_%s_t\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
184183
file_content += " <kind>NO_KEY</kind>\n"
185184
file_content += " <name>%s%s_%s_%s</name>\n" % (ros2_prefix, spec.base_type.pkg_name, subfolder, spec.msg_name)
186185
file_content += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
187186
file_content += " </topic>\n"
188187
file_content += " </data_reader>\n"
189-
#file_content += " </dds>\n"
188+
file_content += " </dds>\n"
190189

191190

192191
# Topic
193-
#file_content += " <dds>\n"
192+
file_content += " <dds>\n"
194193
file_content += " <topic profile_name=\"%s_%s_%s_t\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
195194
file_content += " <name>%s%s_%s_%s</name>\n" % (ros2_prefix, spec.base_type.pkg_name, subfolder, spec.msg_name)
196195
file_content += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
197196
file_content += " </topic>\n"
198-
#file_content += " </dds>\n"
197+
file_content += " </dds>\n"
199198

200199

201200
# Write file content

micro_ros_agent/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<buildtool_export_depend>ament_cmake</buildtool_export_depend>
1212

1313
<depend>microxrcedds_agent</depend>
14+
<depend>rosidl_cmake</depend>
1415

1516
<test_depend>ament_lint_auto</test_depend>
1617
<test_depend>ament_lint_common</test_depend>

0 commit comments

Comments
 (0)