Robotics StackExchange | Archived questions

Using cyclone-dds from android phone to send messages to ros2 galactic

I have just come across this README from the cyclone dds github repo, which shows how to build and deploy cyclone dds on Android 9+

Since ros2 galactic makes rmw-cyclonedds-cpp the default ros middleware interface, I am wondering if this means one can simply use cyclone dds from an android device without the rest of the ros2 ecosystem to communicate with a ros2 galactic node running on a Linux device?

If yes, then how? Can you please provide a general outline of how to achieve this?

Ultimately my goal is to send Twist messages from an adroid phone to an Nvidia Jetson TX2 where the WiFi interface is acting as an Access Point, to which the phone is connected.

I already have all the machinery in place. ros2 galactic is installed on the Jetson TX2 using docker. I used hostapd to turn the WiFi interface on the Jetson into an AP device and verified connection from an Android phone

Please Note I realize there are various ways of achieving the goal of sending Twist messages from an Android device that maybe simpler, for example:

  1. ros2-web-bridge found here
  2. A simple python Flask REST API running on the Jetson that uses native ros2 python bindings to publish the messages. I can then use HTML or a basic Android App to send values to the REST API.

Somehow neither of these approaches seems reliable to me. While I am only a DIY / Hobby Roboticist, I still would like to develop the most professional thing that I can do

If you recommend against going with the cyclone dds method, please say why...

Asked by sameh4 on 2021-10-12 23:27:56 UTC

Comments

Since ros2 galactic makes rmw-cyclonedds-cpp the default ros middleware interface, I am wondering if this means one can simply use cyclone dds from an android device without the rest of the ros2 ecosystem to communicate with a ros2 galactic node running on a Linux device?

No, it's not that simple.

DDS (or RTPS) is only used as a transport. What is sent/received using that transport is what makes it "ROS 2 over DDS". Besides the content of the messages (ie: message fields), the names all need to match as well, and ROS 2 adds name-mangling to topics, participant names and other DDS domain concepts.

Without both sides (ie: your vanilla Cyclone DDS application and the ROS 2 side) using the same name-mangling, you can't communicate with a ROS 2 node graph.

(and once you have name-mangling working, you shouldn't even need to use a DDS implementation from the same vendor on both sides, due to inter-vendor DDS compatibility)

Asked by gvdhoorn on 2021-10-13 02:09:45 UTC

Unfortunately I can't point you to any specific resource which describes how to implement vanilla-DDS-to-ROS2 interoperability. The best I can do right now is point you to Topic and Service name mapping to DDS, which describes how name-mangling is implemented.

Note though it is possible to do what you describe, it's just more involved than using the same DDS vendor on both sides.

You might see whether the Cyclone devs could lend you a hand. They might have done this already.

Asked by gvdhoorn on 2021-10-13 02:12:02 UTC

@gvdhoorn many thanks for your great comments! OK, I will have to reconsider this approach, and think how to move forward

Asked by sameh4 on 2021-10-13 06:59:22 UTC

Micro-ROS recently was made Android compatible. Perhaps you could consider using that. See micro-ROS/micro_ros_setup.

Asked by gvdhoorn on 2021-10-13 07:10:56 UTC

Thanks @gvdhoorn. I am using micro-ROS with esp32 to control the motor driver, as well as read and publish IMU. I was not aware that's now android compatible though! I will check that out

Asked by sameh4 on 2021-10-13 08:09:12 UTC

Answers