Upgrade to Pro — share decks privately, control downloads, hide ads and more …

mROS 2: yet another runtime environment onto embedded devices

takasehideki
October 21, 2022

mROS 2: yet another runtime environment onto embedded devices

ROSCon 2022
2022/10/21
https://roscon.ros.org/2022/

Vimeo Archive:
https://vimeo.com/showcase/9954564/video/767150435

Speakers and Contributors:
Hideki Takase, Shintaro Hosoai, Yoichiro Hibara, Haruaki Tanaka (The University of Tokyo), Hidetoshi Yugen (Kyoto University), Shoji Morita (eSOL Co.,Ltd.)

Abstract:
By installing ROS 2 nodes onto embedded micro-controller, robots can acquire better real-time performance and power efficiency. Of course, micro-ROS is a de-facto environment, but it is better to have different options to realize them. This talk proposes mROS 2, which realizes an agent-less and lightweight runtime environment compatible with ROS 2 for embedded devices. It consists of basic APIs that are mostly compliant with Rclcpp for the topic communication, an embedded version of the RTPS protocol stack, and a real-time kernel. We will demonstrate that embedded nodes can now directly communicate with native ROS 2 nodes via topics efficiently.

Demonstrations a.k.a 論よりRUN:
Part1 (p.12) https://twitter.com/takasehideki/status/1505066116921524228
Part2 (p.13) https://twitter.com/takasehideki/status/1584486712780390401
Part3 (p.14) https://twitter.com/takasehideki/status/1584488359808102402

More Info (STAR please!!):
https://github.com/mROS-base/mros2

takasehideki

October 21, 2022
Tweet

More Decks by takasehideki

Other Decks in Technology

Transcript

  1. yet another runtime environment onto embedded devices Hideki Takase, Shintaro

    Hosoai, Yoichiro Hibara, Haruaki Tanaka (The University of Tokyo), Hidetoshi Yugen (Kyoto University), Shoji Morita (eSOL Co.,Ltd.) ROSCon 2022 2022/10/21 A part of this work is supported by JST CREST JPMJCR21D2 and the commissioned research (04001) by National Institute of Information and Communications Technology (NICT) , Japan.
  2. Hobby Recent R&D Affiliation Mission @takasehideki ശ ఉ ϩʔΧϧ؀ڥ ηϯγϯά

    ̇ ̇ ̇ ө૾ Ի Թ౓ ࣪౓ ѹྗ ৼಈ Edge AI ޯ഑ܭࢉɾߋ৽ -PTT 8FJHIU ਪ࿦ ੍ޚ ΢ΣΞϥϒϧ σόΠεɾ ϔϧεέΞ ϩϘοτ ϞϏϦςΟ ೖྗ ग़ྗ ϑΟʔυ όοΫ Edge AI Edge AI Edge AI Edge AI Fog AI ू໿ ෼഑ ϩʔΧϧ؀ڥ Fog AI Edge AI Edge AI ϩʔΧϧ؀ڥ Fog AI Edge AI Edge AI Cloud MEC BEAM クラウド BEAM エッジ BEAM 最適配分アルゴリズム 透過型分散プラットフォーム BEAM システム開発者 デプロイされる コード ① ③ ② ③ ③ ❤ 評価アプリ ❤ 評価アプリ ④ ④ ❤ 評価アプリ ④ ② ② ❤ 評価アプリ ④ ② ② ② ② a design infrastructure that connects all Things and Human Optimization Methodology Toward a world where anyone can easily create awesome products Cutting-Edge Platform and Design Methodology for embedded/IoT Computing
  3. 3 Platform for accelerating the development of robot systems http://www.ros.org/about-ros/

    • The essence of ROS is Plumbing — Loosely coupled arch. of ROS nodes — Easy to register, delete, and restore them — Basis is pub/sub comm. via Topic node1 node2 node3 node4 Topic1 Topic2 node5 出版(Publish) 購読(Subscribe) msg msg msg msg ROS 2/DDS communication tech. is also expected to be deployed in the IoT field • comm. performance — responsiveness (latency) — real-time performance (variation) • Power consumption Integration of Embedded Technology meets EMB for IoT!!
  4. mROS-base/mros2 4 X How to “embed”?? native ROS 2 on

    SBC micro-ROS on EMB board various kernels & boards serial, UDP, Bluetooth trans. fully compatible with rclc XRCE-DDS (with agent) mROS 2 on EMB board better perf. & mem. usage partially compatible with rclcpp only for Topic comm., and many unsupported features such as QoS, Service,,,
  5. Participant_A SPDP Endpoint Writer Reader SEDP Endpoint RTPS Endpoint HistoryCache

    Writer Reader Publisher Subscriber Topic_1 Topic_2 P_E W_E R_E W_E R_E P_E S_E T_3 P_D W_D R_D W_D R_D P_D S_D T_2 T_3 T_2 P_A C 1 D 2 B 2 P_C W_C R_C W_C R_C P_C S_C T_1 P_A T_1 T_2 P_B T_2 P_A T_1 T_2 P_C T_1 P_A T_1 T_2 P_D T_3 T_2 P_A T_1 T_2 P_E T_3 P_B W_B R_B W_B R_B P_B S_B (1) (2) (3) (4) 5 EMB GPC agent node node client node dds-xrce rtps rtps m ※GPC: General Purpose Computer EMB: Embedded Micro-controller Board Dive into comm. • RTPS: comm. protocol of DDS — SPDP/SEDP: autonomously searches/establishes communication partners/paths (w/o master) — GPOSes are essential!! (ROS 2 itself) • micro-ROS: de-fact of EMB platform — employ Micro-XRCE-DDS (default) Øagent is necessary as the master RTPS communication directly from EMB without an agent!!
  6. 6 Software Stack autonomous communication in accordance with RTPS specification

    real-time kernels for EMB contributes perf. and mem. usage pub/sub messaging for Topic partially compliant with rclcpp mROS-base/mros2 Embedded devices HAL library Kernel (ASP3, Mbed, POSIX) mROS 2 application mROS 2 comm. lib. mROS 2 API UDP stack (lwIP) RTPS (embeddedRTPS) CMSIS wrapper lightweight and efficient process by C/C++ for <~200MHz / <~1MB
  7. 7 Note: embeddedRTPS [A. Kampmann+ ITSC'2019] • Portable RTPS implementation

    by C++ —lwIP (Raw Mode) for UDP/IP —Micro-CDR for serialization — some code dependencies with FreeRTOS • Main features and contributions —Discovery: SPDP & SEDP features —Interoperability: tested with FastDDS 2.3.1 —QoS Policies: support best-effort & reliable —UDP Multicast: support multicast locators üMessage size is limited to buffer size of lwIP mROS-base/mros2 https://github.com/embedded- software-laboratory/embeddedRTPS
  8. • Steps for embedded board • Step for the host

    8 Getting started!! $ git clone https://github.com/mROS-base/mros2-mbed $ cd mros2-mbed $ ./build.bash all NUCLEO_F767ZI echoback_string $ picocom -b 115200 /dev/ttyACM0 mROS-base/mros2 $ docker run --rm -it --net=host ros:humble /bin/bash ¥ -c "mkdir -p ~/ros2/src && cd ~/ros2/src && ¥ git clone https://github.com/mROS-base/mros2-host-examples && ¥ cd ~/ros2_ws && ¥ colcon build --packages-select mros2_echoreply_string && ¥ source install/setup.bash && ¥ ros2 run mros2_echoreply_string echoreply_node "
  9. mROS-base/mros2 10 Evaluation [email protected] with Foxy uros-serial uros-udp uros-rtps mros2-asp3

    mros2-mbed API rclc (galactic) mROS 2 API v0.3.1 RTPS Micro XRCE DDS embeddedRTPS protocol USART UDP RTPS on UDP RTOS FreeRTOS v2 TOPPERS/ASP3 Mbed OS 6 compiler 8.3.1 9.3.1 7.3.1 10.3.1 Ubuntu20 on RPi4 /to_stm /to_linux Round-Trip Time for UInt16, Twist, String by rclcpp::WallTimer.get_clock() on the host STM32 NUCLEO-F767ZI https://github.com/mROS-base/eval/releases/tag/v0.1.1
  10. 11 Evaluation Results • UInt16 [ms] uros- serial uros- udp

    uros- rtps mros2- asp3 mros2- mbed avg 11.710 2.109 5.182 0.570 0.646 max 17.370 4.240 11.190 0.810 0.940 min 7.590 1.900 1.940 0.490 0.560 std.p 3.094 0.244 2.684 0.067 0.081 • Twist [ms] uros- serial uros- udp uros- rtps mros2- asp3 mros2- mbed avg 19.530 2.304 5.508 0.593 0.703 max 25.510 11.250 9.860 0.850 0.880 min 15.590 2.050 2.610 0.520 0.640 std.p 3.666 0.904 1.551 0.065 0.042 • mem size (binary for Twist) uros- serial uros- udp uros- rtps mros2- asp3 mros2- mbed text 209,836 233,656 174,752 90,551 393,312 data 356 356 576 16,632 3,336 bss 110,280 108,160 282,016 111,800 70,688 total 320,472 342,172 457,334 225,983 469,336 mROS-base/mros2 length of String 1 2 4 8 16 32 64 comm time [ms] 0.0 5.0 10.0 15.0 20.0 25.0 30.0 uros-serial uros-udp mros2-asp3 mros2-mbed • String
  11. mROS-base/mros2 12 https://twitter.com/takasehideki/status/ 1505066116921524228 turtlesim_node $ ros2 run mturtlesim turtlesim_node

    $ picocom /dev/ttyACM0 EMB board + analog joystick publish Twist 論よりRUN!! "ron yori run" The RUN is mightier than the word
  12. 13 論よりRUN!! part II mROS-base/mros2 mros2-mbed NUCLEO_F767ZI mros2-mbed ARCH_MAX mros2-mbed

    GR_MANGO mros2-posix RPi4 (w/o ROS 2) /to_humble /to_mros2 /to_hum ble /to_m ros2 /to_humble /to_mros2 /to_humble /to_mros2
  13. 14 論よりRUN!! Part III powered by mROS-base/mros2 robot body node

    calc. PWM node /to_pid IMU data /to_control PWM value wheeled inverted pendulum
  14. 15 Conclusion • Agent-less and lightweight runtime environment for ROS

    2 • Our Contribution — mROS 2 enables programs running on embedded devices to communicate autonomously with nodes on the native ROS 2 — mROS 2 would contribute to the construction of distributed robot systems with excellent communication performance mROS-base/mros2 If you wanna communicate only with Topic, please consider to try our mROS 2 as one of the candidates🤔🤔🤔
  15. mROS-base/mros2 Check now!! & Whatʼs next?? Please give us the

    Star! & your contribution!! https://github.com/mROS-base/mros2 • porting to other boards and kernels • implement new targets with POSIX-compliant RTOS • support QoS control, Service, Action, ... • design a dedicated board for real robots??