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

Rclex on Nerves: a bare minimum runtime platfor...

takasehideki
October 19, 2023
270

Rclex on Nerves: a bare minimum runtime platform for ROS 2 nodes in Elixir

ROSCon 2023
2023/10/19
https://roscon.ros.org/2023/

Vimeo Archive:
https://vimeo.com/879001529/b23eaacae8

Speakers and Contributors:
Hideki Takase, Shintaro Hosoai (The Univ. of Tokyo), Ryota Kinukawa (Tombo Works), Shunsuke Kikuchi (SAKURA internet, Inc.)

Abstract:
Do you know the magic of Elixir programming language, and how easily this can be installed into robot systems? One of the solutions is "Rclex," which is a client library for ROS 2 platform. Furthermore, Nerves provides a powerful platform specifically tailored for Elixir on IoT systems. This talk introduces "Rclex on Nerves," a minimal runtime platform for operating ROS 2 nodes using the Elixir. In this presentation, we will delve into the features, advantages, and role of Rclex on Nerves within the ROS 2 ecosystem.

Demonstrations a.k.a 論よりRUN:
p.17-18 https://twitter.com/takasehideki/status/1715098391342985417
p.18 https://twitter.com/takasehideki/status/1588521053311365121

More Info (STAR please!!):
https://github.com/rclex/rclex

takasehideki

October 19, 2023
Tweet

Transcript

  1. on a bare minimum runtime platform for ROS 2 nodes

    in Elixir Hideki Takase, Shintaro Hosoai (The Univ. of Tokyo), Ryota Kinukawa (Tombo Works), Shunsuke Kikuchi (SAKURA internet, Inc.) ROSCon 2023 2023/10/19 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 Topic: Rclex on Nerves bare minimum and resilient runtime

    platform Client Library for Elixir node1 node2 node3 node4 topicA [string] topicB [image] node5 publish subscribe DDS Domain msg msg msg msg .1 1 ( 0 ) . .1 ) 11 .1 ) ) &0 1(. &0 1 Functional Language
  4. … … 4 rclcpp rclpy node.cpp node.py RCL (ROS Client

    Library) RMW (ROS MiddleWare) DDS B DDS A General Purpose OS • common functions for ROS 2 • implemented by C • any client library can be implemented by calling it • Abstraction layer for DDS • Able to select preferred DDS (and Zenoh??) rclrs node.rs Zenoh?? DDS (Data Distribution Service) • OMG standard specification • Pub/Sub communication functions • Automatic search of nodes by RTPS is awesome!!
  5. ROS 2 Client Library for,,, Rclex 5 rclcpp rclpy node.cpp

    node.py node.ex RCL (ROS Client Library) RMW (ROS MiddleWare) DDS B DDS A General Purpose OS rclrs node.rs Zenoh?? github.com/rclex
  6. We love Elixir!! Functional language (appeared in 2012) Operated on

    Erlang VM (BEAM) • lightweight processes with robustness • highly concurrency/parallelism • soft real-time feature • easy to realize distributed and fault tolerance system * The copyrights of these logos belong to their respective creators • Similar to Actor Model — Actors (processes) send and receive messages — "Let it Crash”: The problematic process should be promptly crashed and restored immediately — We can spawn a massive number of processes!! 6
  7. * The copyrights of these logos belong to their respective

    creators Language Design based on Ruby • easy to learn! familiar grammar and notation • very highly productive despite functional • high communication performance suitable for IoT Programming should be about transforming data .1 1 ( 0 ) . .1 ) 11 .1 ) ) &0 1(. &0 1 example Elixir code Ø Data flow and parallel processing can be described intuitively with Enum Flow |> We love Elixir!! Functional language (appeared in 2012) 7
  8. 8 We love Elixir!! * The copyrights of these logos

    belong to their respective creators • Awesome ecosystem!
  9. 9 • Actors on BEAM send and receive messages —

    (I believe) Actor Model is suitable for robot systems🤖 — We can enhance comm. scalability thanks to lightweight processes • (I suggest) Robot programming should be functional!! — ROS concept of combining existing packages has a high affinity System is like,,, node1 node2 node3 node4 topicA [string] topicB [image] node5 publish subscribe DDS Domain msg msg msg msg Actor Model!!
  10. github.com/rclex 10 Simple Publisher by Rclex number of nodes create

    node by name and index create topic :single-> one topic :multi-> multiple set callback func and timer interval create list of messages for each node publish message setting node info. with pipe operator processing a data message with Enum
  11. Developed by Nerves Project! • Dedicated IoT Platform for Elixir

    — fully compatible with Elixir — useful libraries for IoT systems • bare-minimum!! — too small (one linked fw, ~>30 MB) — portable and easy to configure • resilient!! — of course, robust thanks to Erlang VM!! — file system is duplicated and read-only for reliability github.com/rclex Master Boot Record file system A Erlang VM libraries file system B Erlang VM libraries Application Data boot A Linux kernel boot B Linux kernel
  12. github.com/rclex 13 on Supported Targets ROS_DISTRO arm64v8 arm32v7 Foxy ✅

    ✅ Galactic ✅ Humble ✅ ✅ Iron WiP,,, WiP,,, Jazzy, K**, L**, … T.B.A?? T.B.A?? arm64v8 arm32v7 Raspberry Pi 4 Kria KR260 BeagleBone STM32MP1 e-RT3 Plus
  13. copy github.com/rclex 14 on How to try it out? /opt/ros/humble/include

    /opt/ros/humble/lib/ /opt/ros/humble/share arm64v8/ros: humble-ros-core rootfs … /opt/ros/humble/* … rootfs • Only 7 steps, just in 5 min (I hope,,,:D 1. create & prepare project for target $ mix nerves.new rclex_on_nerves --target rpi40 2. Install Rclex into Nerves project add {:rclex, "~> 0.9.2"}, into mix.exs and $ mix deps.get0 3. prepare ros2 resources to Nerves filesystem $ mix rclex.prep.ros2 --arch arm64v80 4. generate resources for msg types of topic comm. $ mix rclex.gen.msgs0 5. set LIBRARY_PATH into Nerves firmware 6. enjoy writing Rclex code!! 7. finally, build firmware, and burn to microSD🔥 $ mix firmware && mix burn0 Installing ROS 2 env on the host is not required! https://hexdocs.pm/rclex/ use_on_nerves.html
  14. 15 • For ROS developers — will acquire performance, especially

    in communication — will want to employ Elixir/Erlang ecosystem — will get a bare minimum and resilient environment!! • For Elixir developers — will get autonomous communication — will utilize OSS packages published for ROS!! MAY THE BEAM BE WITH YOUR ROBOT!! [pic]https://aliexpress.com/item /32604221183.html on Benefit!! github.com/rclex
  15. 16 論よりRUN!! "ron yori run" The RUN is mightier than

    the word https://github.com/pojiro/rpi4_mouse Raspberry Pi Mouse V3 by RT Corporation Momo (WebRTC Native Client) by Shiguredo /cmd_vel control motors sensors /sensors
  16. Actual behavior of RPi Mouse Phoenix Web Page on Nerves

    for Sensor Values on RPi Mouse Camera image on RPi Mouse sent by Momo Nerves Console 論よりRUN!! "ron yori run" The RUN is mightier than the word
  17. 18 One More Thing?? Rclex on Nerves with Zenoh —Eloquent,

    Scalable, and Fast network protocol —The most promising candidate for a new Tier-1 RMW?? • Our Trial —Rclex msgs on Nerves go beyond the Pacific Ocean!! üCode BEAM America 2023 [Slide] [YouTube] [demo(on X)] —(WiP) Zenohex [GitHub] global IP: 23.185.0.4 global IP: 133.11.194.2 SFO TYO 192.168.10.10 192.168.10.?? 192.168.??.?? Rclex messages between nodes will go beyond the Pacific Ocean!!
  18. 19 Wrapping Up STAR our repo! try it out!! and,

    Give your contributions!!! https://github.com/rclex/rclex https://hex.pm/packages/rclex • Rclex: Robotics meets Elixir! — ROS will acquire Elixirʼs performance — Elixir will utilize ROS packages • Ongoing/upcoming works — Service, Action and Parameter — actively integration with Zenoh — documentation, academic paper,,,