Feature/foxy migration (#30)

* Adding rosidl_cmake

* Updated XML generation

* Updated readme

* Update README.md
This commit is contained in:
Pablo Garrido
2020-06-29 10:22:23 +02:00
committed by GitHub
parent f0effec782
commit 85ef5321f8
4 changed files with 42 additions and 14 deletions
+28
View File
@@ -5,3 +5,31 @@
ROS 2 package using Micro XRCE-DDS Agent.
## Overview
This repository contains the Micro-ROS Agent package.
Micro-ROS Agent is a ROS 2 node that wraps the Micro XRCE-DDS Agent.
For further information about Micro XRCE-DDS Agent click [here](https://github.com/eProsima/Micro-XRCE-DDS-Agent)
This package is a part of the Micro-ROS project stack.
For more information about Micro-ROS project click [here](https://microros.github.io/micro-ROS/).
The node acts as a server between DDS Network and Micro-ROS nodes inside MCU.
It receives and send messages from Micro-ROS nodes, and keep track of the Micro-ROS nodes exposing them to the ROS 2 network.
The node interacts with DDS Global Data Space on behalf of the Micro-ROS nodes.
## Package features
### XML generation
During the build process, the package looks for all ROS 2 messages to generate an initial list of XML profiles.
These profiles can are referenced in the Agent-Client communication to avoid sending the full XML content.
This reference mechanism can be switched on and off from the Micro XRCE-DDS middleware layer.
### Agent-Client communication mechanism
Communication between the Micro-ROS Agent and the Micro-ROS nodes supports two types of transport:
- UDP and TCP over IPv4 and IPv6.
- Serial Port transports.
All available configurations are supported directly by the Micro XRCE-DDS agent.
+5 -5
View File
@@ -23,6 +23,7 @@ project(micro_ros_agent LANGUAGES CXX)
find_package(ament_cmake REQUIRED)
find_package(microxrcedds_agent REQUIRED)
find_package(rosidl_cmake REQUIRED)
add_executable(${PROJECT_NAME} src/main.cpp)
@@ -79,11 +80,10 @@ if(UROSAGENT_GENERATE_PROFILE)
get_filename_component(_COLCON_CALL_DIR "${_COLCON_CALL_DIR}" DIRECTORY)
set(_PYTHON_SCRIPT_HEAD
"
import os\n
import sys\n
sys.path.append('${_OUTPUT_PATH}')\n
from ${_PYTHON_PKG_TOOL} import *\n
"import os
import sys
sys.path.append('${_OUTPUT_PATH}')
from ${_PYTHON_PKG_TOOL} import *
"
)
+7 -8
View File
@@ -164,21 +164,20 @@ def generate_XML(args):
# Generate source file path
src_file = os.path.join(srcs_dir, "%s_%s_%s.xml" % (spec.base_type.pkg_name, subfolder, spec.msg_name))
# Data writer
#file_content = " <dds>\n"
file_content = " <data_writer profile_name=\"%s_%s_%s_p\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content = " <dds>\n"
file_content += " <data_writer profile_name=\"%s_%s_%s_p\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " <topic profile_name=\"%s_%s_%s_t\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " <kind>NO_KEY</kind>\n"
file_content += " <name>%s%s_%s_%s</name>\n" % (ros2_prefix, spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " </topic>\n"
file_content += " </data_writer>\n"
#file_content += " </dds>\n"
file_content += " </dds>\n"
# Data reader
#file_content += " <dds>\n"
file_content += " <dds>\n"
file_content += " <data_reader profile_name=\"%s_%s_%s_s\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " <topic profile_name=\"%s_%s_%s_t\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " <kind>NO_KEY</kind>\n"
@@ -186,16 +185,16 @@ def generate_XML(args):
file_content += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " </topic>\n"
file_content += " </data_reader>\n"
#file_content += " </dds>\n"
file_content += " </dds>\n"
# Topic
#file_content += " <dds>\n"
file_content += " <dds>\n"
file_content += " <topic profile_name=\"%s_%s_%s_t\">\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " <name>%s%s_%s_%s</name>\n" % (ros2_prefix, spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
file_content += " </topic>\n"
#file_content += " </dds>\n"
file_content += " </dds>\n"
# Write file content
+1
View File
@@ -11,6 +11,7 @@
<buildtool_export_depend>ament_cmake</buildtool_export_depend>
<depend>microxrcedds_agent</depend>
<depend>rosidl_cmake</depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>