mirror of
https://github.com/micro-ROS/micro-ROS-Agent.git
synced 2026-09-06 09:55:15 +02:00
Feature/foxy migration (#30)
* Adding rosidl_cmake * Updated XML generation * Updated readme * Update README.md
This commit is contained in:
@@ -5,3 +5,31 @@
|
|||||||
|
|
||||||
ROS 2 package using Micro XRCE-DDS Agent.
|
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.
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ project(micro_ros_agent LANGUAGES CXX)
|
|||||||
|
|
||||||
find_package(ament_cmake REQUIRED)
|
find_package(ament_cmake REQUIRED)
|
||||||
find_package(microxrcedds_agent REQUIRED)
|
find_package(microxrcedds_agent REQUIRED)
|
||||||
|
find_package(rosidl_cmake REQUIRED)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} src/main.cpp)
|
add_executable(${PROJECT_NAME} src/main.cpp)
|
||||||
|
|
||||||
@@ -79,12 +80,11 @@ if(UROSAGENT_GENERATE_PROFILE)
|
|||||||
get_filename_component(_COLCON_CALL_DIR "${_COLCON_CALL_DIR}" DIRECTORY)
|
get_filename_component(_COLCON_CALL_DIR "${_COLCON_CALL_DIR}" DIRECTORY)
|
||||||
|
|
||||||
set(_PYTHON_SCRIPT_HEAD
|
set(_PYTHON_SCRIPT_HEAD
|
||||||
"
|
"import os
|
||||||
import os\n
|
import sys
|
||||||
import sys\n
|
sys.path.append('${_OUTPUT_PATH}')
|
||||||
sys.path.append('${_OUTPUT_PATH}')\n
|
from ${_PYTHON_PKG_TOOL} import *
|
||||||
from ${_PYTHON_PKG_TOOL} import *\n
|
"
|
||||||
"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
file(
|
file(
|
||||||
|
|||||||
@@ -164,21 +164,20 @@ def generate_XML(args):
|
|||||||
# Generate source file path
|
# Generate source file path
|
||||||
src_file = os.path.join(srcs_dir, "%s_%s_%s.xml" % (spec.base_type.pkg_name, subfolder, spec.msg_name))
|
src_file = os.path.join(srcs_dir, "%s_%s_%s.xml" % (spec.base_type.pkg_name, subfolder, spec.msg_name))
|
||||||
|
|
||||||
|
|
||||||
# Data writer
|
# Data writer
|
||||||
#file_content = " <dds>\n"
|
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 += " <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 += " <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 += " <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 += " <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 += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
|
||||||
file_content += " </topic>\n"
|
file_content += " </topic>\n"
|
||||||
file_content += " </data_writer>\n"
|
file_content += " </data_writer>\n"
|
||||||
#file_content += " </dds>\n"
|
file_content += " </dds>\n"
|
||||||
|
|
||||||
|
|
||||||
# Data reader
|
# 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 += " <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 += " <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 += " <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 += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
|
||||||
file_content += " </topic>\n"
|
file_content += " </topic>\n"
|
||||||
file_content += " </data_reader>\n"
|
file_content += " </data_reader>\n"
|
||||||
#file_content += " </dds>\n"
|
file_content += " </dds>\n"
|
||||||
|
|
||||||
|
|
||||||
# Topic
|
# 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 += " <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 += " <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 += " <dataType>%s::%s::dds_::%s_</dataType>\n" % (spec.base_type.pkg_name, subfolder, spec.msg_name)
|
||||||
file_content += " </topic>\n"
|
file_content += " </topic>\n"
|
||||||
#file_content += " </dds>\n"
|
file_content += " </dds>\n"
|
||||||
|
|
||||||
|
|
||||||
# Write file content
|
# Write file content
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<buildtool_export_depend>ament_cmake</buildtool_export_depend>
|
<buildtool_export_depend>ament_cmake</buildtool_export_depend>
|
||||||
|
|
||||||
<depend>microxrcedds_agent</depend>
|
<depend>microxrcedds_agent</depend>
|
||||||
|
<depend>rosidl_cmake</depend>
|
||||||
|
|
||||||
<test_depend>ament_lint_auto</test_depend>
|
<test_depend>ament_lint_auto</test_depend>
|
||||||
<test_depend>ament_lint_common</test_depend>
|
<test_depend>ament_lint_common</test_depend>
|
||||||
|
|||||||
Reference in New Issue
Block a user