diff --git a/.gitignore b/.gitignore index ba0430d..c18dd8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -__pycache__/ \ No newline at end of file +__pycache__/ diff --git a/README.md b/README.md index 2261cc8..d66e0c4 100644 --- a/README.md +++ b/README.md @@ -5,27 +5,29 @@ It consists of basic APIs for pub/sub communication, RTPS protocol, UDP/IP stack Embedded nodes can now communicate directly with native ROS 2 nodes via topic! This repository maintains the communication layer of mROS 2, that mainly offers pub/sub APIs compatible with [rclcpp](https://docs.ros2.org/dashing/api/rclcpp/index.html) for embedded devices. -[ROS 2](https://docs.ros.org/en/dashing/) is a de-fact platform for the robot system development, and provides pub/sub communication infrastructure with the DDS/RTPS protocol. +[ROS 2](https://docs.ros.org/en/dashing/) is a de-fact platform for the robot system development and provides pub/sub communication infrastructure with the DDS/RTPS protocol. ## Features -- **Agent-less**: a node on mROS 2 autonomously discovers communication nodes on the host with the feature of [embeddedRTPS](https://github.com/mROS-base/embeddedRTPS). It means no agent/bridge is required for pub/sub communication from the embedded devices. - - mros2 currently uses [embeddedRTPS @ 1410a87](https://github.com/mROS-base/embeddedRTPS/tree/1410a8776660244249a84031ffa78c9bdaa45e19) as it is. +- **Agent-less**: A node on mROS 2 autonomously discovers communication nodes on the host. No agent/bridge is required for pub/sub communication from the embedded devices. + - mros2 adopts [embeddedRTPS](https://github.com/mROS-base/embeddedRTPS) with some modifications. - **Lightweight**: mROS 2 APIs are implemented by C++ to be operated on the embedded devices. All software stacks are also implemented only in C/C++. -- **Real-time**: mROS 2 employs the real-time kernel (e.g., [TOPPERS kernel](https://www.toppers.jp/en/project.html), [Mbed OS](https://os.mbed.com/mbed-os/)) as the runtime platform in order to enhance the real-time capability. +- **Real-time**: mROS 2 uses the real-time kernel (e.g., [TOPPERS kernel](https://www.toppers.jp/en/project.html), [Mbed OS](https://os.mbed.com/mbed-os/)) as the runtime platform in order to enhance the real-time capability. ## Functionalities and limitations -Here are functionalities that mROS 2 offers for you, and current limitations (a.k.a call for your contibutions!). +Here are the functionalities that mROS 2 offers for you, and current limitations (a.k.a call for your contributions!). - Pub/Sub communication via Topic is supported - - [Built-in-types](https://docs.ros.org/en/foxy/Concepts/About-ROS-Interfaces.html#field-types) except for `wstring` (UTF-16) - - Please check [mros2-asp3-f767zi#exapmle-applications](https://github.com/mROS-base/mros2-asp3-f767zi#example-applications) for more details. + - [Built-in-types](https://docs.ros.org/en/foxy/Concepts/About-ROS-Interfaces.html#field-types) + - `wstring` (UTF-16) is not provided due to its difficulty in verification, but it is unlikely to be used. - `array` types are not supported - Some custom message types (e.g., Twist, Pose) - - We think variable-length types and types exceeding one packet cannot be handled, probably due to the limitation of lwIP. + - Please check [mros2-mbed#generating-header-files-for-custom-msgtypes](https://github.com/mROS-base/mros2-mbed#generating-header-files-for-custom-msgtypes) for more details. + - Fragmented message types (that exceed one packet) are experimentally supported. See [PR#36](https://github.com/mROS-base/mros2/pull/36) for more details. + - We think variable-length types cannot be handled, probably due to the limitation of lwIP. - Service, Actions, and Parameters are not supported - - Please let us know if you want to use them as soon as possible. We can consider of raising the priority of these supports. + - Please let us know if you want to use them as soon as possible. We can consider raising the priority of these supports. ## Supported platform @@ -37,11 +39,12 @@ Please see each repository to learn how to use it. |:---|:---|:---|:---| | [mros2-asp3-f767zi](https://github.com/mROS-base/mros2-asp3-f767zi) | [TOPPERS/ASP3](https://www.toppers.jp/en/project.html) | [STM32 NUCLEO-F767ZI](https://www.st.com/en/evaluation-tools/nucleo-f767zi.html) | currently supported up to v0.3.2 (see [status](https://github.com/mROS-base/mros2-asp3-f767zi/issues/74)) | | [mros2-mbed](https://github.com/mROS-base/mros2-mbed) | [Mbed OS 6](https://github.com/ARMmbed/mbed-os) | Mbed enabled boards having an Ethernet port (See [detail](https://github.com/mROS-base/mros2-mbed#supported-environment)) | well maintained and easy to try | +| [mros2-esp32](https://github.com/mROS-base/mros2-esp32) | [ESP-IDF FreeRTOS](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos_idf.html) | ESP32 boards with 2.4 GHz Wi-Fi (See [detail](https://github.com/mROS-base/mros2-esp32#supported-environment)) | well maintained | | [mros2-posix](https://github.com/mROS-base/mros2-posix) | POSIX (pthread) | any machine that runs Linux | partly maintained | -Please let us know if you have a request for a support of board/kernel, or if you could implement this layer on another platform. +Please let us know if you have a request for support for other boards/kernels, or if you could implement this layer on other platforms. ## License The source code of this repository itself is published under [Apache License 2.0](https://github.com/mROS-base/mros2/blob/main/LICENSE). -Please note that this repository contains [embeddedRTPS and its third party libraries](https://github.com/mROS-base/embeddedRTPS#third-party-libraries) as the submodule, and also check their Licenses. +Please note that this repository contains [embeddedRTPS and its third-party libraries](https://github.com/mROS-base/embeddedRTPS#third-party-libraries) as the submodule, and also check their Licenses. diff --git a/embeddedRTPS b/embeddedRTPS index 52680b0..de70e01 160000 --- a/embeddedRTPS +++ b/embeddedRTPS @@ -1 +1 @@ -Subproject commit 52680b0bf1633b8af92951c52336a23f0f27af65 +Subproject commit de70e01959afdf218af8a227f054226f78806cdd diff --git a/mros2_header_generator/templates.tpl b/mros2_header_generator/templates.tpl index f024286..b19d859 100644 --- a/mros2_header_generator/templates.tpl +++ b/mros2_header_generator/templates.tpl @@ -1,3 +1,8 @@ +/* + * This file was automatically generated by generate_templates.py + * as one of mros2 features. You do not need to modify this. + */ + {%- for includeFile in includeFiles %} {{includeFile}} {%- endfor %} diff --git a/mros2_header_generator/templates_generator.py b/mros2_header_generator/templates_generator.py index 1eeae9f..cc2e17d 100644 --- a/mros2_header_generator/templates_generator.py +++ b/mros2_header_generator/templates_generator.py @@ -1,6 +1,7 @@ import os import sys import re +from os import path from jinja2 import Environment, FileSystemLoader arg = sys.argv @@ -37,13 +38,11 @@ def main(): includeFile = '#include "' + includeFile + '.hpp"' includeFiles.append(includeFile) - - env = Environment(loader=FileSystemLoader('../mros2/mros2_header_generator')) + env = Environment(loader=FileSystemLoader(path.dirname(__file__))) template = env.get_template('templates.tpl') datatext = template.render({ "includeFiles":includeFiles, "pubMsgTypes":pubMsgTypes, "subMsgTypes":subMsgTypes }) with open(os.path.join(app+"/templates.hpp"), "wb") as f: f.write(datatext.encode('utf-8')) - if __name__ == "__main__": main()