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.
Slide 2
Slide 2 text
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
Slide 3
Slide 3 text
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
Slide 4
Slide 4 text
… …
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!!
Slide 5
Slide 5 text
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
Slide 6
Slide 6 text
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
Slide 7
Slide 7 text
* 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
Slide 8
Slide 8 text
8
We love Elixir!!
* The copyrights of these logos
belong to their respective creators
• Awesome ecosystem!
Slide 9
Slide 9 text
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!!
Slide 10
Slide 10 text
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
Slide 11
Slide 11 text
github.com/rclex 11
Example of Rclex on Native Ubuntu
default ROS 2 env
Rclex on Ubuntu
Slide 12
Slide 12 text
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
Slide 13
Slide 13 text
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
Slide 14
Slide 14 text
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
Slide 15
Slide 15 text
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
Slide 16
Slide 16 text
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
Slide 17
Slide 17 text
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
Slide 18
Slide 18 text
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!!
Slide 19
Slide 19 text
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,,,